diff options
Diffstat (limited to 'drivers/ata/ahci.c')
| -rw-r--r-- | drivers/ata/ahci.c | 34 | 
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 639de2d75d63..3bb9bb483fe3 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -26,7 +26,6 @@  #include <linux/device.h>  #include <linux/dmi.h>  #include <linux/gfp.h> -#include <linux/msi.h>  #include <scsi/scsi_host.h>  #include <scsi/scsi_cmnd.h>  #include <linux/libata.h> @@ -84,6 +83,7 @@ enum board_ids {  static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);  static void ahci_remove_one(struct pci_dev *dev);  static void ahci_shutdown_one(struct pci_dev *dev); +static void ahci_intel_pcs_quirk(struct pci_dev *pdev, struct ahci_host_priv *hpriv);  static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,  				 unsigned long deadline);  static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class, @@ -421,6 +421,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {  	{ PCI_VDEVICE(INTEL, 0x34d3), board_ahci_low_power }, /* Ice Lake LP AHCI */  	{ PCI_VDEVICE(INTEL, 0x02d3), board_ahci_low_power }, /* Comet Lake PCH-U AHCI */  	{ PCI_VDEVICE(INTEL, 0x02d7), board_ahci_low_power }, /* Comet Lake PCH RAID */ +	{ PCI_VDEVICE(INTEL, 0xa0d3), board_ahci_low_power }, /* Tiger Lake UP{3,4} AHCI */  	/* JMicron 360/1/3/5/6, match class to avoid IDE function */  	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, @@ -677,6 +678,25 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,  	ahci_save_initial_config(&pdev->dev, hpriv);  } +static int ahci_pci_reset_controller(struct ata_host *host) +{ +	struct pci_dev *pdev = to_pci_dev(host->dev); +	struct ahci_host_priv *hpriv = host->private_data; +	int rc; + +	rc = ahci_reset_controller(host); +	if (rc) +		return rc; + +	/* +	 * If platform firmware failed to enable ports, try to enable +	 * them here. +	 */ +	ahci_intel_pcs_quirk(pdev, hpriv); + +	return 0; +} +  static void ahci_pci_init_controller(struct ata_host *host)  {  	struct ahci_host_priv *hpriv = host->private_data; @@ -871,7 +891,7 @@ static int ahci_pci_device_runtime_resume(struct device *dev)  	struct ata_host *host = pci_get_drvdata(pdev);  	int rc; -	rc = ahci_reset_controller(host); +	rc = ahci_pci_reset_controller(host);  	if (rc)  		return rc;  	ahci_pci_init_controller(host); @@ -907,7 +927,7 @@ static int ahci_pci_device_resume(struct device *dev)  		ahci_mcp89_apple_enable(pdev);  	if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { -		rc = ahci_reset_controller(host); +		rc = ahci_pci_reset_controller(host);  		if (rc)  			return rc; @@ -1785,12 +1805,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)  	/* save initial config */  	ahci_pci_save_initial_config(pdev, hpriv); -	/* -	 * If platform firmware failed to enable ports, try to enable -	 * them here. -	 */ -	ahci_intel_pcs_quirk(pdev, hpriv); -  	/* prepare host */  	if (hpriv->cap & HOST_CAP_NCQ) {  		pi.flags |= ATA_FLAG_NCQ; @@ -1900,7 +1914,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)  	if (rc)  		return rc; -	rc = ahci_reset_controller(host); +	rc = ahci_pci_reset_controller(host);  	if (rc)  		return rc;  |