diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:22 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:25 -0400 |
commit | 071f44b1d2c051641b62a3571223314737ccbe59 (patch) | |
tree | a07794c8109e5d82a78223ae0159eadbf862c463 /drivers/ata/libata-eh.c | |
parent | 48515f6c006c2a9d7b624ee8ad068018c2d3fe0e (diff) |
libata: implement PMP helpers
Implement helpers to test whether PMP is supported, attached and
determine pmp number to use when issuing SRST to a link. While at it,
move ata_is_host_link() so that it's together with the two new PMP
helpers.
This change simplifies LLDs and helps making PMP support optional.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 4ec1397434c0..99f83bdc572b 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -873,9 +873,9 @@ int sata_async_notification(struct ata_port *ap) | |||
873 | if (rc == 0) | 873 | if (rc == 0) |
874 | sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); | 874 | sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); |
875 | 875 | ||
876 | if (!ap->nr_pmp_links || rc) { | 876 | if (!sata_pmp_attached(ap) || rc) { |
877 | /* PMP is not attached or SNTF is not available */ | 877 | /* PMP is not attached or SNTF is not available */ |
878 | if (!ap->nr_pmp_links) { | 878 | if (!sata_pmp_attached(ap)) { |
879 | /* PMP is not attached. Check whether ATAPI | 879 | /* PMP is not attached. Check whether ATAPI |
880 | * AN is configured. If so, notify media | 880 | * AN is configured. If so, notify media |
881 | * change. | 881 | * change. |
@@ -1853,7 +1853,7 @@ void ata_eh_autopsy(struct ata_port *ap) | |||
1853 | /* Autopsy of fanout ports can affect host link autopsy. | 1853 | /* Autopsy of fanout ports can affect host link autopsy. |
1854 | * Perform host link autopsy last. | 1854 | * Perform host link autopsy last. |
1855 | */ | 1855 | */ |
1856 | if (ap->nr_pmp_links) | 1856 | if (sata_pmp_attached(ap)) |
1857 | ata_eh_link_autopsy(&ap->link); | 1857 | ata_eh_link_autopsy(&ap->link); |
1858 | } | 1858 | } |
1859 | 1859 | ||
@@ -2076,7 +2076,7 @@ static int ata_eh_followup_srst_needed(struct ata_link *link, | |||
2076 | } | 2076 | } |
2077 | if (rc != 0) | 2077 | if (rc != 0) |
2078 | return 0; | 2078 | return 0; |
2079 | if ((link->ap->flags & ATA_FLAG_PMP) && ata_is_host_link(link)) | 2079 | if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) |
2080 | return 1; | 2080 | return 1; |
2081 | return 0; | 2081 | return 0; |
2082 | } | 2082 | } |
@@ -2668,7 +2668,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
2668 | /* if PMP is attached, this function only deals with | 2668 | /* if PMP is attached, this function only deals with |
2669 | * downstream links, port should stay thawed. | 2669 | * downstream links, port should stay thawed. |
2670 | */ | 2670 | */ |
2671 | if (!ap->nr_pmp_links) | 2671 | if (!sata_pmp_attached(ap)) |
2672 | ata_eh_freeze_port(ap); | 2672 | ata_eh_freeze_port(ap); |
2673 | 2673 | ||
2674 | ata_port_for_each_link(link, ap) { | 2674 | ata_port_for_each_link(link, ap) { |
@@ -2687,7 +2687,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
2687 | } | 2687 | } |
2688 | } | 2688 | } |
2689 | 2689 | ||
2690 | if (!ap->nr_pmp_links) | 2690 | if (!sata_pmp_attached(ap)) |
2691 | ata_eh_thaw_port(ap); | 2691 | ata_eh_thaw_port(ap); |
2692 | } | 2692 | } |
2693 | 2693 | ||
@@ -2731,7 +2731,7 @@ dev_fail: | |||
2731 | /* PMP reset requires working host port. | 2731 | /* PMP reset requires working host port. |
2732 | * Can't retry if it's frozen. | 2732 | * Can't retry if it's frozen. |
2733 | */ | 2733 | */ |
2734 | if (ap->nr_pmp_links) | 2734 | if (sata_pmp_attached(ap)) |
2735 | goto out; | 2735 | goto out; |
2736 | break; | 2736 | break; |
2737 | } | 2737 | } |