Commit dd406ef8 authored by Brian King's avatar Brian King Committed by James Bottomley

[SCSI] ipr: Fix sleeping function called with interrupts disabled

The ata_sas_slave_configure was changed such that it now allocates
some memory for a drain buffer for ATAPI devices. Fixup the ipr
driver such that we no longer make this call with interrupts disabled.
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 6401bdca
...@@ -3654,6 +3654,7 @@ static int ipr_slave_configure(struct scsi_device *sdev) ...@@ -3654,6 +3654,7 @@ static int ipr_slave_configure(struct scsi_device *sdev)
{ {
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
struct ipr_resource_entry *res; struct ipr_resource_entry *res;
struct ata_port *ap = NULL;
unsigned long lock_flags = 0; unsigned long lock_flags = 0;
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
...@@ -3672,12 +3673,16 @@ static int ipr_slave_configure(struct scsi_device *sdev) ...@@ -3672,12 +3673,16 @@ static int ipr_slave_configure(struct scsi_device *sdev)
} }
if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res)) if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res))
sdev->allow_restart = 1; sdev->allow_restart = 1;
if (ipr_is_gata(res) && res->sata_port) { if (ipr_is_gata(res) && res->sata_port)
ap = res->sata_port->ap;
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
if (ap) {
scsi_adjust_queue_depth(sdev, 0, IPR_MAX_CMD_PER_ATA_LUN); scsi_adjust_queue_depth(sdev, 0, IPR_MAX_CMD_PER_ATA_LUN);
ata_sas_slave_configure(sdev, res->sata_port->ap); ata_sas_slave_configure(sdev, ap);
} else { } else
scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
} return 0;
} }
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment