Commit 4f404caf6791227754d67679d0b2350afc1ad522
Exists in
master
and in
7 other branches
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [PATCH] libata: Fixup ata_sas_queuecmd to handle __ata_scsi_queuecmd failure [PATCH] ahci: AHCI mode SATA patch for Intel ICH9 [PATCH] libata: don't schedule EH on wcache on/off if old EH
Showing 2 changed files Side-by-side Diff
drivers/ata/ahci.c
... | ... | @@ -314,6 +314,17 @@ |
314 | 314 | { PCI_VDEVICE(INTEL, 0x2824), board_ahci }, /* ICH8 */ |
315 | 315 | { PCI_VDEVICE(INTEL, 0x2829), board_ahci }, /* ICH8M */ |
316 | 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 | 329 | /* JMicron */ |
319 | 330 | { PCI_VDEVICE(JMICRON, 0x2360), board_ahci }, /* JMicron JMB360 */ |
drivers/ata/libata-scsi.c
... | ... | @@ -1451,6 +1451,7 @@ |
1451 | 1451 | |
1452 | 1452 | static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) |
1453 | 1453 | { |
1454 | + struct ata_port *ap = qc->ap; | |
1454 | 1455 | struct scsi_cmnd *cmd = qc->scsicmd; |
1455 | 1456 | u8 *cdb = cmd->cmnd; |
1456 | 1457 | int need_sense = (qc->err_mask != 0); |
1457 | 1458 | |
... | ... | @@ -1459,11 +1460,12 @@ |
1459 | 1460 | * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE |
1460 | 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 | 1465 | ((qc->tf.feature == SETFEATURES_WC_ON) || |
1464 | 1466 | (qc->tf.feature == SETFEATURES_WC_OFF))) { |
1465 | - qc->ap->eh_info.action |= ATA_EH_REVALIDATE; | |
1466 | - ata_port_schedule_eh(qc->ap); | |
1467 | + ap->eh_info.action |= ATA_EH_REVALIDATE; | |
1468 | + ata_port_schedule_eh(ap); | |
1467 | 1469 | } |
1468 | 1470 | |
1469 | 1471 | /* For ATA pass thru (SAT) commands, generate a sense block if |
... | ... | @@ -1490,8 +1492,8 @@ |
1490 | 1492 | } |
1491 | 1493 | } |
1492 | 1494 | |
1493 | - if (need_sense && !qc->ap->ops->error_handler) | |
1494 | - ata_dump_status(qc->ap->id, &qc->result_tf); | |
1495 | + if (need_sense && !ap->ops->error_handler) | |
1496 | + ata_dump_status(ap->id, &qc->result_tf); | |
1495 | 1497 | |
1496 | 1498 | qc->scsidone(cmd); |
1497 | 1499 | |
1498 | 1500 | |
1499 | 1501 | |
1500 | 1502 | |
... | ... | @@ -3345,21 +3347,24 @@ |
3345 | 3347 | * @ap: ATA port to which the command is being sent |
3346 | 3348 | * |
3347 | 3349 | * RETURNS: |
3348 | - * Zero. | |
3350 | + * Return value from __ata_scsi_queuecmd() if @cmd can be queued, | |
3351 | + * 0 otherwise. | |
3349 | 3352 | */ |
3350 | 3353 | |
3351 | 3354 | int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), |
3352 | 3355 | struct ata_port *ap) |
3353 | 3356 | { |
3357 | + int rc = 0; | |
3358 | + | |
3354 | 3359 | ata_scsi_dump_cdb(ap, cmd); |
3355 | 3360 | |
3356 | 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 | 3363 | else { |
3359 | 3364 | cmd->result = (DID_BAD_TARGET << 16); |
3360 | 3365 | done(cmd); |
3361 | 3366 | } |
3362 | - return 0; | |
3367 | + return rc; | |
3363 | 3368 | } |
3364 | 3369 | EXPORT_SYMBOL_GPL(ata_sas_queuecmd); |