diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 12adcf78f94b..85e659945c12 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -6766,8 +6766,21 @@ u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, u32 val, | |||
6766 | */ | 6766 | */ |
6767 | bool sata_lpm_ignore_phy_events(struct ata_link *link) | 6767 | bool sata_lpm_ignore_phy_events(struct ata_link *link) |
6768 | { | 6768 | { |
6769 | unsigned long lpm_timeout = link->last_lpm_change + | ||
6770 | msecs_to_jiffies(ATA_TMOUT_SPURIOUS_PHY); | ||
6771 | |||
6769 | /* if LPM is enabled, PHYRDY doesn't mean anything */ | 6772 | /* if LPM is enabled, PHYRDY doesn't mean anything */ |
6770 | return !!(link->lpm_policy > ATA_LPM_MAX_POWER); | 6773 | if (link->lpm_policy > ATA_LPM_MAX_POWER) |
6774 | return true; | ||
6775 | |||
6776 | /* ignore the first PHY event after the LPM policy changed | ||
6777 | * as it is might be spurious | ||
6778 | */ | ||
6779 | if ((link->flags & ATA_LFLAG_CHANGED) && | ||
6780 | time_before(jiffies, lpm_timeout)) | ||
6781 | return true; | ||
6782 | |||
6783 | return false; | ||
6771 | } | 6784 | } |
6772 | EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events); | 6785 | EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events); |
6773 | 6786 | ||