aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 15795394b0a8..fedf62de9460 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2393,7 +2393,9 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
2393 /* FIXME: is this needed? */ 2393 /* FIXME: is this needed? */
2394 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 2394 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
2395 2395
2396 ap->ops->tf_read(ap, &qc->tf); 2396#ifdef CONFIG_ATA_SFF
2397 ap->ops->sff_tf_read(ap, &qc->tf);
2398#endif
2397 2399
2398 /* fill these in, for the case where they are -not- overwritten */ 2400 /* fill these in, for the case where they are -not- overwritten */
2399 cmd->sense_buffer[0] = 0x70; 2401 cmd->sense_buffer[0] = 0x70;
@@ -2615,7 +2617,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2615 2617
2616static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) 2618static struct ata_device *ata_find_dev(struct ata_port *ap, int devno)
2617{ 2619{
2618 if (ap->nr_pmp_links == 0) { 2620 if (!sata_pmp_attached(ap)) {
2619 if (likely(devno < ata_link_max_devices(&ap->link))) 2621 if (likely(devno < ata_link_max_devices(&ap->link)))
2620 return &ap->link.device[devno]; 2622 return &ap->link.device[devno];
2621 } else { 2623 } else {
@@ -2632,7 +2634,7 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap,
2632 int devno; 2634 int devno;
2633 2635
2634 /* skip commands not addressed to targets we simulate */ 2636 /* skip commands not addressed to targets we simulate */
2635 if (ap->nr_pmp_links == 0) { 2637 if (!sata_pmp_attached(ap)) {
2636 if (unlikely(scsidev->channel || scsidev->lun)) 2638 if (unlikely(scsidev->channel || scsidev->lun))
2637 return NULL; 2639 return NULL;
2638 devno = scsidev->id; 2640 devno = scsidev->id;
@@ -3490,7 +3492,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3490 if (lun != SCAN_WILD_CARD && lun) 3492 if (lun != SCAN_WILD_CARD && lun)
3491 return -EINVAL; 3493 return -EINVAL;
3492 3494
3493 if (ap->nr_pmp_links == 0) { 3495 if (!sata_pmp_attached(ap)) {
3494 if (channel != SCAN_WILD_CARD && channel) 3496 if (channel != SCAN_WILD_CARD && channel)
3495 return -EINVAL; 3497 return -EINVAL;
3496 devno = id; 3498 devno = id;
@@ -3507,8 +3509,8 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3507 3509
3508 ata_port_for_each_link(link, ap) { 3510 ata_port_for_each_link(link, ap) {
3509 struct ata_eh_info *ehi = &link->eh_info; 3511 struct ata_eh_info *ehi = &link->eh_info;
3510 ehi->probe_mask |= (1 << ata_link_max_devices(link)) - 1; 3512 ehi->probe_mask |= ATA_ALL_DEVICES;
3511 ehi->action |= ATA_EH_SOFTRESET; 3513 ehi->action |= ATA_EH_RESET;
3512 } 3514 }
3513 } else { 3515 } else {
3514 struct ata_device *dev = ata_find_dev(ap, devno); 3516 struct ata_device *dev = ata_find_dev(ap, devno);
@@ -3516,8 +3518,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3516 if (dev) { 3518 if (dev) {
3517 struct ata_eh_info *ehi = &dev->link->eh_info; 3519 struct ata_eh_info *ehi = &dev->link->eh_info;
3518 ehi->probe_mask |= 1 << dev->devno; 3520 ehi->probe_mask |= 1 << dev->devno;
3519 ehi->action |= ATA_EH_SOFTRESET; 3521 ehi->action |= ATA_EH_RESET;
3520 ehi->flags |= ATA_EHI_RESUME_LINK;
3521 } else 3522 } else
3522 rc = -EINVAL; 3523 rc = -EINVAL;
3523 } 3524 }