diff options
author | Tejun Heo <tj@kernel.org> | 2008-07-31 04:02:40 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-29 00:22:28 -0400 |
commit | 82ef04fb4c82542b3eda81cca461f0594ce9cd0b (patch) | |
tree | e513df5ad8dc9f7400830bfc8786afb6bec90fb6 /drivers/ata/ahci.c | |
parent | 6ef190cc92e33565accff6a320f0e7d90480bfe7 (diff) |
libata: make SCR access ops per-link
Logically, SCR access ops should take @link; however, there was no
compelling reason to convert all SCR access ops when adding @link
abstraction as there's one-to-one mapping between a port and a non-PMP
link. However, that assumption won't hold anymore with the scheduled
addition of slave link.
Make SCR access ops per-link.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r-- | drivers/ata/ahci.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2e1a7cb2ed5f..6acea41eb7ca 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -267,8 +267,8 @@ struct ahci_port_priv { | |||
267 | * per PM slot */ | 267 | * per PM slot */ |
268 | }; | 268 | }; |
269 | 269 | ||
270 | static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val); | 270 | static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
271 | static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); | 271 | static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
272 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 272 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
273 | static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); | 273 | static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); |
274 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); | 274 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); |
@@ -820,10 +820,10 @@ static unsigned ahci_scr_offset(struct ata_port *ap, unsigned int sc_reg) | |||
820 | return 0; | 820 | return 0; |
821 | } | 821 | } |
822 | 822 | ||
823 | static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | 823 | static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) |
824 | { | 824 | { |
825 | void __iomem *port_mmio = ahci_port_base(ap); | 825 | void __iomem *port_mmio = ahci_port_base(link->ap); |
826 | int offset = ahci_scr_offset(ap, sc_reg); | 826 | int offset = ahci_scr_offset(link->ap, sc_reg); |
827 | 827 | ||
828 | if (offset) { | 828 | if (offset) { |
829 | *val = readl(port_mmio + offset); | 829 | *val = readl(port_mmio + offset); |
@@ -832,10 +832,10 @@ static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | |||
832 | return -EINVAL; | 832 | return -EINVAL; |
833 | } | 833 | } |
834 | 834 | ||
835 | static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) | 835 | static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) |
836 | { | 836 | { |
837 | void __iomem *port_mmio = ahci_port_base(ap); | 837 | void __iomem *port_mmio = ahci_port_base(link->ap); |
838 | int offset = ahci_scr_offset(ap, sc_reg); | 838 | int offset = ahci_scr_offset(link->ap, sc_reg); |
839 | 839 | ||
840 | if (offset) { | 840 | if (offset) { |
841 | writel(val, port_mmio + offset); | 841 | writel(val, port_mmio + offset); |
@@ -973,7 +973,7 @@ static void ahci_disable_alpm(struct ata_port *ap) | |||
973 | writel(PORT_IRQ_PHYRDY, port_mmio + PORT_IRQ_STAT); | 973 | writel(PORT_IRQ_PHYRDY, port_mmio + PORT_IRQ_STAT); |
974 | 974 | ||
975 | /* go ahead and clean out PhyRdy Change from Serror too */ | 975 | /* go ahead and clean out PhyRdy Change from Serror too */ |
976 | ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18))); | 976 | ahci_scr_write(&ap->link, SCR_ERROR, ((1 << 16) | (1 << 18))); |
977 | 977 | ||
978 | /* | 978 | /* |
979 | * Clear flag to indicate that we should ignore all PhyRdy | 979 | * Clear flag to indicate that we should ignore all PhyRdy |
@@ -1937,8 +1937,8 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | |||
1937 | ata_ehi_push_desc(host_ehi, "irq_stat 0x%08x", irq_stat); | 1937 | ata_ehi_push_desc(host_ehi, "irq_stat 0x%08x", irq_stat); |
1938 | 1938 | ||
1939 | /* AHCI needs SError cleared; otherwise, it might lock up */ | 1939 | /* AHCI needs SError cleared; otherwise, it might lock up */ |
1940 | ahci_scr_read(ap, SCR_ERROR, &serror); | 1940 | ahci_scr_read(&ap->link, SCR_ERROR, &serror); |
1941 | ahci_scr_write(ap, SCR_ERROR, serror); | 1941 | ahci_scr_write(&ap->link, SCR_ERROR, serror); |
1942 | host_ehi->serror |= serror; | 1942 | host_ehi->serror |= serror; |
1943 | 1943 | ||
1944 | /* some controllers set IRQ_IF_ERR on device errors, ignore it */ | 1944 | /* some controllers set IRQ_IF_ERR on device errors, ignore it */ |
@@ -2027,7 +2027,7 @@ static void ahci_port_intr(struct ata_port *ap) | |||
2027 | if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) && | 2027 | if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) && |
2028 | (status & PORT_IRQ_PHYRDY)) { | 2028 | (status & PORT_IRQ_PHYRDY)) { |
2029 | status &= ~PORT_IRQ_PHYRDY; | 2029 | status &= ~PORT_IRQ_PHYRDY; |
2030 | ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18))); | 2030 | ahci_scr_write(&ap->link, SCR_ERROR, ((1 << 16) | (1 << 18))); |
2031 | } | 2031 | } |
2032 | 2032 | ||
2033 | if (unlikely(status & PORT_IRQ_ERROR)) { | 2033 | if (unlikely(status & PORT_IRQ_ERROR)) { |