summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorGabriele Mazzotta2015-04-25 19:52:36 +0200
committerTejun Heo2015-04-25 22:50:14 +0200
commit8393b811f38acdf7fd8da2028708edad3e68ce1f (patch)
tree416d3ec188647783e4364f162a793ef3369aabc0 /drivers/ata/libata-core.c
parentata: ahci_st: fixup layering violations / drvdata errors (diff)
downloadkernel-qcow2-linux-8393b811f38acdf7fd8da2028708edad3e68ce1f.tar.gz
kernel-qcow2-linux-8393b811f38acdf7fd8da2028708edad3e68ce1f.tar.xz
kernel-qcow2-linux-8393b811f38acdf7fd8da2028708edad3e68ce1f.zip
libata: Add helper to determine when PHY events should be ignored
This is a preparation commit that will allow to add other criteria according to which PHY events should be dropped. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index f6cb1f1b30b7..12adcf78f94b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6752,6 +6752,25 @@ u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, u32 val,
return tmp;
}
+/**
+ * sata_lpm_ignore_phy_events - test if PHY event should be ignored
+ * @link: Link receiving the event
+ *
+ * Test whether the received PHY event has to be ignored or not.
+ *
+ * LOCKING:
+ * None:
+ *
+ * RETURNS:
+ * True if the event has to be ignored.
+ */
+bool sata_lpm_ignore_phy_events(struct ata_link *link)
+{
+ /* if LPM is enabled, PHYRDY doesn't mean anything */
+ return !!(link->lpm_policy > ATA_LPM_MAX_POWER);
+}
+EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
+
/*
* Dummy port_ops
*/