]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.drivers/ipr-slave-alloc-crash
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / ipr-slave-alloc-crash
1 From: Brian King <brking@linux.vnet.ibm.com>
2 Subject: ipr: Fix sleeping function called with interrupts disabled
3 References: bnc#501234
4 Patch-Mainline: Yes
5
6 During 2.6.30-rc2-git2 bootup on a power 7 box, i found the following BUG in
7 the boot log
8
9 BUG: sleeping function called from invalid context at mm/slab.c:3055
10 in_atomic(): 0, irqs_disabled(): 1, pid: 198, name: modprobe
11
12 The ata_sas_slave_configure was changed such that it now allocates
13 some memory for a drain buffer for ATAPI devices. Fixup the ipr
14 driver such that we no longer make this call with interrupts disabled.
15
16 Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
17 Signed-off-by: Hannes Reinecke <hare@suse.de>
18 ---
19
20 drivers/scsi/ipr.c | 13 +++++++++----
21 1 file changed, 9 insertions(+), 4 deletions(-)
22
23 --- a/drivers/scsi/ipr.c
24 +++ b/drivers/scsi/ipr.c
25 @@ -3658,6 +3658,7 @@ static int ipr_slave_configure(struct sc
26 {
27 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
28 struct ipr_resource_entry *res;
29 + struct ata_port *ap = NULL;
30 unsigned long lock_flags = 0;
31
32 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
33 @@ -3676,12 +3677,16 @@ static int ipr_slave_configure(struct sc
34 }
35 if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res))
36 sdev->allow_restart = 1;
37 - if (ipr_is_gata(res) && res->sata_port) {
38 + if (ipr_is_gata(res) && res->sata_port)
39 + ap = res->sata_port->ap;
40 + spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
41 +
42 + if (ap) {
43 scsi_adjust_queue_depth(sdev, 0, IPR_MAX_CMD_PER_ATA_LUN);
44 - ata_sas_slave_configure(sdev, res->sata_port->ap);
45 - } else {
46 + ata_sas_slave_configure(sdev, ap);
47 + } else
48 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
49 - }
50 + return 0;
51 }
52 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
53 return 0;