Skip to content

Commit

Permalink
Merge pull request #264 from leoliu-oc/linux-6.6.y-30-sata-lpm
Browse files Browse the repository at this point in the history
[linux-6.6.y] ata: libata: disabling PhyRdy Change Interrupt based on actual LPM capability
  • Loading branch information
opsiff authored Jun 25, 2024
2 parents 546d0d9 + 9202555 commit a8ede05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -3374,6 +3374,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
struct ata_device **r_failed_dev)
{
struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL;
struct device *device = ap ? ap->host->dev : NULL;
struct pci_dev *pdev = (!device || !dev_is_pci(device)) ? NULL : to_pci_dev(device);
struct ata_eh_context *ehc = &link->eh_context;
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
enum ata_lpm_policy old_policy = link->lpm_policy;
Expand All @@ -3382,6 +3384,11 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
unsigned int err_mask;
int rc;

/* if controller does not support lpm, then sets no LPM flags*/
if ((pdev && pdev->vendor == PCI_VENDOR_ID_ZHAOXIN) &&
!(~ap->host->flags & (ATA_HOST_NO_PART | ATA_HOST_NO_SSC | ATA_HOST_NO_DEVSLP)))
link->flags |= ATA_LFLAG_NO_LPM;

/* if the link or host doesn't do LPM, noop */
if (!IS_ENABLED(CONFIG_SATA_HOST) ||
(link->flags & ATA_LFLAG_NO_LPM) || (ap && !ap->ops->set_lpm))
Expand Down

0 comments on commit a8ede05

Please sign in to comment.