@@ -83,6 +83,7 @@ enum board_ids {
83
83
static int ahci_init_one (struct pci_dev * pdev , const struct pci_device_id * ent );
84
84
static void ahci_remove_one (struct pci_dev * dev );
85
85
static void ahci_shutdown_one (struct pci_dev * dev );
86
+ static void ahci_intel_pcs_quirk (struct pci_dev * pdev , struct ahci_host_priv * hpriv );
86
87
static int ahci_vt8251_hardreset (struct ata_link * link , unsigned int * class ,
87
88
unsigned long deadline );
88
89
static int ahci_avn_hardreset (struct ata_link * link , unsigned int * class ,
@@ -676,6 +677,25 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,
676
677
ahci_save_initial_config (& pdev -> dev , hpriv );
677
678
}
678
679
680
+ static int ahci_pci_reset_controller (struct ata_host * host )
681
+ {
682
+ struct pci_dev * pdev = to_pci_dev (host -> dev );
683
+ struct ahci_host_priv * hpriv = host -> private_data ;
684
+ int rc ;
685
+
686
+ rc = ahci_reset_controller (host );
687
+ if (rc )
688
+ return rc ;
689
+
690
+ /*
691
+ * If platform firmware failed to enable ports, try to enable
692
+ * them here.
693
+ */
694
+ ahci_intel_pcs_quirk (pdev , hpriv );
695
+
696
+ return 0 ;
697
+ }
698
+
679
699
static void ahci_pci_init_controller (struct ata_host * host )
680
700
{
681
701
struct ahci_host_priv * hpriv = host -> private_data ;
@@ -870,7 +890,7 @@ static int ahci_pci_device_runtime_resume(struct device *dev)
870
890
struct ata_host * host = pci_get_drvdata (pdev );
871
891
int rc ;
872
892
873
- rc = ahci_reset_controller (host );
893
+ rc = ahci_pci_reset_controller (host );
874
894
if (rc )
875
895
return rc ;
876
896
ahci_pci_init_controller (host );
@@ -906,7 +926,7 @@ static int ahci_pci_device_resume(struct device *dev)
906
926
ahci_mcp89_apple_enable (pdev );
907
927
908
928
if (pdev -> dev .power .power_state .event == PM_EVENT_SUSPEND ) {
909
- rc = ahci_reset_controller (host );
929
+ rc = ahci_pci_reset_controller (host );
910
930
if (rc )
911
931
return rc ;
912
932
@@ -1784,12 +1804,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1784
1804
/* save initial config */
1785
1805
ahci_pci_save_initial_config (pdev , hpriv );
1786
1806
1787
- /*
1788
- * If platform firmware failed to enable ports, try to enable
1789
- * them here.
1790
- */
1791
- ahci_intel_pcs_quirk (pdev , hpriv );
1792
-
1793
1807
/* prepare host */
1794
1808
if (hpriv -> cap & HOST_CAP_NCQ ) {
1795
1809
pi .flags |= ATA_FLAG_NCQ ;
@@ -1899,7 +1913,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1899
1913
if (rc )
1900
1914
return rc ;
1901
1915
1902
- rc = ahci_reset_controller (host );
1916
+ rc = ahci_pci_reset_controller (host );
1903
1917
if (rc )
1904
1918
return rc ;
1905
1919
0 commit comments