mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]> Cc: [email protected]
This commit is contained in:
parent
e0e2674b92
commit
8393b811f3
3 changed files with 21 additions and 2 deletions
|
|
@ -1707,8 +1707,7 @@ static void ahci_handle_port_interrupt(struct ata_port *ap,
|
|||
if (unlikely(resetting))
|
||||
status &= ~PORT_IRQ_BAD_PMP;
|
||||
|
||||
/* if LPM is enabled, PHYRDY doesn't mean anything */
|
||||
if (ap->link.lpm_policy > ATA_LPM_MAX_POWER) {
|
||||
if (sata_lpm_ignore_phy_events(&ap->link)) {
|
||||
status &= ~PORT_IRQ_PHYRDY;
|
||||
ahci_scr_write(&ap->link, SCR_ERROR, SERR_PHYRDY_CHG);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue