]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: ata: wake port before DMA stop for ALPM
authorDanesh Petigara <dpetigara@broadcom.com>
Mon, 11 Jan 2016 21:22:26 +0000 (13:22 -0800)
committerTejun Heo <tj@kernel.org>
Mon, 25 Jan 2016 20:20:44 +0000 (15:20 -0500)
commit9c64e22ef72e1c93c1e2d288c85f4241676a36e9
tree0dae24ccd8a24d7b20c95503e9793eae3d7d7e4d
parent5367e65a538f2d59834d845f582bc1f1ae9599b8
drivers: ata: wake port before DMA stop for ALPM

The AHCI driver code stops and starts port DMA engines at will
without considering the power state of the particular port. The
AHCI specification isn't very clear on how to handle this scenario,
leaving implementation open to interpretation.

Broadcom's STB SATA host controller is unable to handle port DMA
controller restarts when the port in question is in low power mode.
When a port enters partial or slumber mode, its PHY is powered down.
When a controller restart is requested, the controller's internal
state machine expects the PHY to be brought back up by software which
never happens in this case, resulting in failures.

To avoid this situation, logic is added to manually wake up the port
just before its DMA engine is stopped, if the port happens to be in
a low power state. HBA initiated power management ensures that the port
eventually returns to its configured low power state, when the link is
idle (as per the conditions listed in the spec). A new host flag is also
added to ensure this logic is only exercised for hosts with the above
limitation.

tj: Formatting changes.

Signed-off-by: Danesh Petigara <dpetigara@broadcom.com>
Reviewed-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/ahci.h
drivers/ata/ahci_brcmstb.c
drivers/ata/libahci.c
include/linux/libata.h