aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/ahci.c11
-rw-r--r--drivers/ata/libata-scsi.c21
2 files changed, 24 insertions, 8 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 234197e57e9e..f510e1196dc6 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -314,6 +314,17 @@ static const struct pci_device_id ahci_pci_tbl[] = {
314 { PCI_VDEVICE(INTEL, 0x2824), board_ahci }, /* ICH8 */ 314 { PCI_VDEVICE(INTEL, 0x2824), board_ahci }, /* ICH8 */
315 { PCI_VDEVICE(INTEL, 0x2829), board_ahci }, /* ICH8M */ 315 { PCI_VDEVICE(INTEL, 0x2829), board_ahci }, /* ICH8M */
316 { PCI_VDEVICE(INTEL, 0x282a), board_ahci }, /* ICH8M */ 316 { PCI_VDEVICE(INTEL, 0x282a), board_ahci }, /* ICH8M */
317 { PCI_VDEVICE(INTEL, 0x2922), board_ahci }, /* ICH9 */
318 { PCI_VDEVICE(INTEL, 0x2923), board_ahci }, /* ICH9 */
319 { PCI_VDEVICE(INTEL, 0x2924), board_ahci }, /* ICH9 */
320 { PCI_VDEVICE(INTEL, 0x2925), board_ahci }, /* ICH9 */
321 { PCI_VDEVICE(INTEL, 0x2927), board_ahci }, /* ICH9 */
322 { PCI_VDEVICE(INTEL, 0x2929), board_ahci }, /* ICH9M */
323 { PCI_VDEVICE(INTEL, 0x292a), board_ahci }, /* ICH9M */
324 { PCI_VDEVICE(INTEL, 0x292b), board_ahci }, /* ICH9M */
325 { PCI_VDEVICE(INTEL, 0x292f), board_ahci }, /* ICH9M */
326 { PCI_VDEVICE(INTEL, 0x294d), board_ahci }, /* ICH9 */
327 { PCI_VDEVICE(INTEL, 0x294e), board_ahci }, /* ICH9M */
317 328
318 /* JMicron */ 329 /* JMicron */
319 { PCI_VDEVICE(JMICRON, 0x2360), board_ahci }, /* JMicron JMB360 */ 330 { PCI_VDEVICE(JMICRON, 0x2360), board_ahci }, /* JMicron JMB360 */
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 5c1fc467fc7f..47ea111d5ace 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1451,6 +1451,7 @@ nothing_to_do:
1451 1451
1452static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) 1452static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1453{ 1453{
1454 struct ata_port *ap = qc->ap;
1454 struct scsi_cmnd *cmd = qc->scsicmd; 1455 struct scsi_cmnd *cmd = qc->scsicmd;
1455 u8 *cdb = cmd->cmnd; 1456 u8 *cdb = cmd->cmnd;
1456 int need_sense = (qc->err_mask != 0); 1457 int need_sense = (qc->err_mask != 0);
@@ -1459,11 +1460,12 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1459 * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE 1460 * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE
1460 * cache 1461 * cache
1461 */ 1462 */
1462 if (!need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) && 1463 if (ap->ops->error_handler &&
1464 !need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) &&
1463 ((qc->tf.feature == SETFEATURES_WC_ON) || 1465 ((qc->tf.feature == SETFEATURES_WC_ON) ||
1464 (qc->tf.feature == SETFEATURES_WC_OFF))) { 1466 (qc->tf.feature == SETFEATURES_WC_OFF))) {
1465 qc->ap->eh_info.action |= ATA_EH_REVALIDATE; 1467 ap->eh_info.action |= ATA_EH_REVALIDATE;
1466 ata_port_schedule_eh(qc->ap); 1468 ata_port_schedule_eh(ap);
1467 } 1469 }
1468 1470
1469 /* For ATA pass thru (SAT) commands, generate a sense block if 1471 /* For ATA pass thru (SAT) commands, generate a sense block if
@@ -1490,8 +1492,8 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1490 } 1492 }
1491 } 1493 }
1492 1494
1493 if (need_sense && !qc->ap->ops->error_handler) 1495 if (need_sense && !ap->ops->error_handler)
1494 ata_dump_status(qc->ap->id, &qc->result_tf); 1496 ata_dump_status(ap->id, &qc->result_tf);
1495 1497
1496 qc->scsidone(cmd); 1498 qc->scsidone(cmd);
1497 1499
@@ -3345,20 +3347,23 @@ EXPORT_SYMBOL_GPL(ata_sas_slave_configure);
3345 * @ap: ATA port to which the command is being sent 3347 * @ap: ATA port to which the command is being sent
3346 * 3348 *
3347 * RETURNS: 3349 * RETURNS:
3348 * Zero. 3350 * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
3351 * 0 otherwise.
3349 */ 3352 */
3350 3353
3351int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), 3354int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
3352 struct ata_port *ap) 3355 struct ata_port *ap)
3353{ 3356{
3357 int rc = 0;
3358
3354 ata_scsi_dump_cdb(ap, cmd); 3359 ata_scsi_dump_cdb(ap, cmd);
3355 3360
3356 if (likely(ata_scsi_dev_enabled(ap->device))) 3361 if (likely(ata_scsi_dev_enabled(ap->device)))
3357 __ata_scsi_queuecmd(cmd, done, ap->device); 3362 rc = __ata_scsi_queuecmd(cmd, done, ap->device);
3358 else { 3363 else {
3359 cmd->result = (DID_BAD_TARGET << 16); 3364 cmd->result = (DID_BAD_TARGET << 16);
3360 done(cmd); 3365 done(cmd);
3361 } 3366 }
3362 return 0; 3367 return rc;
3363} 3368}
3364EXPORT_SYMBOL_GPL(ata_sas_queuecmd); 3369EXPORT_SYMBOL_GPL(ata_sas_queuecmd);