1 From: Brian King <brking@linux.vnet.ibm.com>
2 Subject: ipr: Fix sleeping function called with interrupts disabled
6 During 2.6.30-rc2-git2 bootup on a power 7 box, i found the following BUG in
9 BUG: sleeping function called from invalid context at mm/slab.c:3055
10 in_atomic(): 0, irqs_disabled(): 1, pid: 198, name: modprobe
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.
16 Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
17 Signed-off-by: Hannes Reinecke <hare@suse.de>
20 drivers/scsi/ipr.c | 13 +++++++++----
21 1 file changed, 9 insertions(+), 4 deletions(-)
23 --- a/drivers/scsi/ipr.c
24 +++ b/drivers/scsi/ipr.c
25 @@ -3658,6 +3658,7 @@ static int ipr_slave_configure(struct sc
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;
32 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
33 @@ -3676,12 +3677,16 @@ static int ipr_slave_configure(struct sc
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);
43 scsi_adjust_queue_depth(sdev, 0, IPR_MAX_CMD_PER_ATA_LUN);
44 - ata_sas_slave_configure(sdev, res->sata_port->ap);
46 + ata_sas_slave_configure(sdev, ap);
48 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
52 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);