diff options
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r-- | drivers/ata/ahci.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2e1a7cb2ed5f..aeadd00411a1 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); |
@@ -316,6 +316,7 @@ static struct device_attribute *ahci_shost_attrs[] = { | |||
316 | 316 | ||
317 | static struct device_attribute *ahci_sdev_attrs[] = { | 317 | static struct device_attribute *ahci_sdev_attrs[] = { |
318 | &dev_attr_sw_activity, | 318 | &dev_attr_sw_activity, |
319 | &dev_attr_unload_heads, | ||
319 | NULL | 320 | NULL |
320 | }; | 321 | }; |
321 | 322 | ||
@@ -820,10 +821,10 @@ static unsigned ahci_scr_offset(struct ata_port *ap, unsigned int sc_reg) | |||
820 | return 0; | 821 | return 0; |
821 | } | 822 | } |
822 | 823 | ||
823 | static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | 824 | static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) |
824 | { | 825 | { |
825 | void __iomem *port_mmio = ahci_port_base(ap); | 826 | void __iomem *port_mmio = ahci_port_base(link->ap); |
826 | int offset = ahci_scr_offset(ap, sc_reg); | 827 | int offset = ahci_scr_offset(link->ap, sc_reg); |
827 | 828 | ||
828 | if (offset) { | 829 | if (offset) { |
829 | *val = readl(port_mmio + offset); | 830 | *val = readl(port_mmio + offset); |
@@ -832,10 +833,10 @@ static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | |||
832 | return -EINVAL; | 833 | return -EINVAL; |
833 | } | 834 | } |
834 | 835 | ||
835 | static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) | 836 | static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) |
836 | { | 837 | { |
837 | void __iomem *port_mmio = ahci_port_base(ap); | 838 | void __iomem *port_mmio = ahci_port_base(link->ap); |
838 | int offset = ahci_scr_offset(ap, sc_reg); | 839 | int offset = ahci_scr_offset(link->ap, sc_reg); |
839 | 840 | ||
840 | if (offset) { | 841 | if (offset) { |
841 | writel(val, port_mmio + offset); | 842 | writel(val, port_mmio + offset); |
@@ -973,7 +974,7 @@ static void ahci_disable_alpm(struct ata_port *ap) | |||
973 | writel(PORT_IRQ_PHYRDY, port_mmio + PORT_IRQ_STAT); | 974 | writel(PORT_IRQ_PHYRDY, port_mmio + PORT_IRQ_STAT); |
974 | 975 | ||
975 | /* go ahead and clean out PhyRdy Change from Serror too */ | 976 | /* go ahead and clean out PhyRdy Change from Serror too */ |
976 | ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18))); | 977 | ahci_scr_write(&ap->link, SCR_ERROR, ((1 << 16) | (1 << 18))); |
977 | 978 | ||
978 | /* | 979 | /* |
979 | * Clear flag to indicate that we should ignore all PhyRdy | 980 | * Clear flag to indicate that we should ignore all PhyRdy |
@@ -1937,8 +1938,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); | 1938 | ata_ehi_push_desc(host_ehi, "irq_stat 0x%08x", irq_stat); |
1938 | 1939 | ||
1939 | /* AHCI needs SError cleared; otherwise, it might lock up */ | 1940 | /* AHCI needs SError cleared; otherwise, it might lock up */ |
1940 | ahci_scr_read(ap, SCR_ERROR, &serror); | 1941 | ahci_scr_read(&ap->link, SCR_ERROR, &serror); |
1941 | ahci_scr_write(ap, SCR_ERROR, serror); | 1942 | ahci_scr_write(&ap->link, SCR_ERROR, serror); |
1942 | host_ehi->serror |= serror; | 1943 | host_ehi->serror |= serror; |
1943 | 1944 | ||
1944 | /* some controllers set IRQ_IF_ERR on device errors, ignore it */ | 1945 | /* some controllers set IRQ_IF_ERR on device errors, ignore it */ |
@@ -2027,7 +2028,7 @@ static void ahci_port_intr(struct ata_port *ap) | |||
2027 | if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) && | 2028 | if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) && |
2028 | (status & PORT_IRQ_PHYRDY)) { | 2029 | (status & PORT_IRQ_PHYRDY)) { |
2029 | status &= ~PORT_IRQ_PHYRDY; | 2030 | status &= ~PORT_IRQ_PHYRDY; |
2030 | ahci_scr_write(ap, SCR_ERROR, ((1 << 16) | (1 << 18))); | 2031 | ahci_scr_write(&ap->link, SCR_ERROR, ((1 << 16) | (1 << 18))); |
2031 | } | 2032 | } |
2032 | 2033 | ||
2033 | if (unlikely(status & PORT_IRQ_ERROR)) { | 2034 | if (unlikely(status & PORT_IRQ_ERROR)) { |