diff options
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 6ca8e5dd6eec..f3c69a8c1103 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2389,7 +2389,10 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2389 | /* FIXME: is this needed? */ | 2389 | /* FIXME: is this needed? */ |
2390 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2390 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2391 | 2391 | ||
2392 | ap->ops->tf_read(ap, &qc->tf); | 2392 | #ifdef CONFIG_ATA_SFF |
2393 | if (ap->ops->sff_tf_read) | ||
2394 | ap->ops->sff_tf_read(ap, &qc->tf); | ||
2395 | #endif | ||
2393 | 2396 | ||
2394 | /* fill these in, for the case where they are -not- overwritten */ | 2397 | /* fill these in, for the case where they are -not- overwritten */ |
2395 | cmd->sense_buffer[0] = 0x70; | 2398 | cmd->sense_buffer[0] = 0x70; |
@@ -2611,7 +2614,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2611 | 2614 | ||
2612 | static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) | 2615 | static struct ata_device *ata_find_dev(struct ata_port *ap, int devno) |
2613 | { | 2616 | { |
2614 | if (ap->nr_pmp_links == 0) { | 2617 | if (!sata_pmp_attached(ap)) { |
2615 | if (likely(devno < ata_link_max_devices(&ap->link))) | 2618 | if (likely(devno < ata_link_max_devices(&ap->link))) |
2616 | return &ap->link.device[devno]; | 2619 | return &ap->link.device[devno]; |
2617 | } else { | 2620 | } else { |
@@ -2628,7 +2631,7 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap, | |||
2628 | int devno; | 2631 | int devno; |
2629 | 2632 | ||
2630 | /* skip commands not addressed to targets we simulate */ | 2633 | /* skip commands not addressed to targets we simulate */ |
2631 | if (ap->nr_pmp_links == 0) { | 2634 | if (!sata_pmp_attached(ap)) { |
2632 | if (unlikely(scsidev->channel || scsidev->lun)) | 2635 | if (unlikely(scsidev->channel || scsidev->lun)) |
2633 | return NULL; | 2636 | return NULL; |
2634 | devno = scsidev->id; | 2637 | devno = scsidev->id; |
@@ -3486,7 +3489,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3486 | if (lun != SCAN_WILD_CARD && lun) | 3489 | if (lun != SCAN_WILD_CARD && lun) |
3487 | return -EINVAL; | 3490 | return -EINVAL; |
3488 | 3491 | ||
3489 | if (ap->nr_pmp_links == 0) { | 3492 | if (!sata_pmp_attached(ap)) { |
3490 | if (channel != SCAN_WILD_CARD && channel) | 3493 | if (channel != SCAN_WILD_CARD && channel) |
3491 | return -EINVAL; | 3494 | return -EINVAL; |
3492 | devno = id; | 3495 | devno = id; |
@@ -3503,8 +3506,8 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3503 | 3506 | ||
3504 | ata_port_for_each_link(link, ap) { | 3507 | ata_port_for_each_link(link, ap) { |
3505 | struct ata_eh_info *ehi = &link->eh_info; | 3508 | struct ata_eh_info *ehi = &link->eh_info; |
3506 | ehi->probe_mask |= (1 << ata_link_max_devices(link)) - 1; | 3509 | ehi->probe_mask |= ATA_ALL_DEVICES; |
3507 | ehi->action |= ATA_EH_SOFTRESET; | 3510 | ehi->action |= ATA_EH_RESET; |
3508 | } | 3511 | } |
3509 | } else { | 3512 | } else { |
3510 | struct ata_device *dev = ata_find_dev(ap, devno); | 3513 | struct ata_device *dev = ata_find_dev(ap, devno); |
@@ -3512,8 +3515,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, | |||
3512 | if (dev) { | 3515 | if (dev) { |
3513 | struct ata_eh_info *ehi = &dev->link->eh_info; | 3516 | struct ata_eh_info *ehi = &dev->link->eh_info; |
3514 | ehi->probe_mask |= 1 << dev->devno; | 3517 | ehi->probe_mask |= 1 << dev->devno; |
3515 | ehi->action |= ATA_EH_SOFTRESET; | 3518 | ehi->action |= ATA_EH_RESET; |
3516 | ehi->flags |= ATA_EHI_RESUME_LINK; | ||
3517 | } else | 3519 | } else |
3518 | rc = -EINVAL; | 3520 | rc = -EINVAL; |
3519 | } | 3521 | } |