AHCI: Clear GHC.IS to prevent unexpectly asserting INTx
authorPang Raymond <Raymond_rule@hotmail.com>
Wed, 20 Jul 2016 12:13:46 +0000 (12:13 +0000)
committerTejun Heo <tj@kernel.org>
Wed, 20 Jul 2016 15:10:10 +0000 (11:10 -0400)
commit0516900adfa1955f91f1c310f9a2fa857949de1c
treeef78ae7de1456cd75e89be78a0b0d678d4697632
parent01c292068e43e72091c22542df5f01b3c09714b2
AHCI: Clear GHC.IS to prevent unexpectly asserting INTx

Due to PCI subsystem behaviour, unloading AHCI driver will disable
MSI and enable INTx. When HBA supports MSIx or Multiple MSI, Driver's
irq handler doesn't clear GHC.IS register. It works well when reading or
writing data and GHC.IS is always non-zero. But when unloading driver
(or any other operation which causes disable MSIx and enable INTx), PCI
 subsystem uses config write(Rx04.bit10) to enable INTx. Because
GHC.IS is non-zero, HBA will falsely assume some port needs interrupt
service. Then it asserts INTx. To make things worse, when AHCI controller
shares the same interrupt pin with other PCI device, that PCI device's ISR
will be called and nobody de-asserts previous INTx.
This patch clears GHC.IS in ahci_port_stop() even when using MSIx or
MMSI to prevent this case. It ensures GHC.IS is zero before PCI subsystem
enables INTx.

tj: Minor updates to the comment.

Signed-off-by: Raymond Pang <raymond_rule@hotmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libahci.c
This page took 0.035563 seconds and 5 git commands to generate.