diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-02-22 10:53:30 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-22 15:35:41 -0500 |
commit | 039ece38da45f5e6a94be3aa7611cf3634bc2461 (patch) | |
tree | c496379b086ca1c4251b1fd914ecafb68eb22063 /drivers/ata/ahci.c | |
parent | b2a52b6a0a03000d07edb359b4059d4d871a7602 (diff) |
libahci: Allow drivers to override start_engine
Allwinner A10 and A20 ARM SoCs have an AHCI sata controller which needs a
special register to be poked before starting the DMA engine.
This register gets reset on an ahci_stop_engine call, so there is no other
place then ahci_start_engine where this poking can be done.
This commit allows drivers to override ahci_start_engine behavior for use by
the Allwinner AHCI driver (and potentially other drivers in the future).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r-- | drivers/ata/ahci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b6a49ce71f6e..1d4efe540604 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -563,6 +563,7 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, | |||
563 | unsigned long deadline) | 563 | unsigned long deadline) |
564 | { | 564 | { |
565 | struct ata_port *ap = link->ap; | 565 | struct ata_port *ap = link->ap; |
566 | struct ahci_host_priv *hpriv = ap->host->private_data; | ||
566 | bool online; | 567 | bool online; |
567 | int rc; | 568 | int rc; |
568 | 569 | ||
@@ -573,7 +574,7 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, | |||
573 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), | 574 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), |
574 | deadline, &online, NULL); | 575 | deadline, &online, NULL); |
575 | 576 | ||
576 | ahci_start_engine(ap); | 577 | hpriv->start_engine(ap); |
577 | 578 | ||
578 | DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class); | 579 | DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class); |
579 | 580 | ||
@@ -588,6 +589,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, | |||
588 | { | 589 | { |
589 | struct ata_port *ap = link->ap; | 590 | struct ata_port *ap = link->ap; |
590 | struct ahci_port_priv *pp = ap->private_data; | 591 | struct ahci_port_priv *pp = ap->private_data; |
592 | struct ahci_host_priv *hpriv = ap->host->private_data; | ||
591 | u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; | 593 | u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; |
592 | struct ata_taskfile tf; | 594 | struct ata_taskfile tf; |
593 | bool online; | 595 | bool online; |
@@ -603,7 +605,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, | |||
603 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), | 605 | rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), |
604 | deadline, &online, NULL); | 606 | deadline, &online, NULL); |
605 | 607 | ||
606 | ahci_start_engine(ap); | 608 | hpriv->start_engine(ap); |
607 | 609 | ||
608 | /* The pseudo configuration device on SIMG4726 attached to | 610 | /* The pseudo configuration device on SIMG4726 attached to |
609 | * ASUS P5W-DH Deluxe doesn't send signature FIS after | 611 | * ASUS P5W-DH Deluxe doesn't send signature FIS after |