Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[libata] AHCI: fix newly introduced host-reset bug

The recent fix to host reset introduced a problem, whereby AHCI-enable
bit would be cleared upon reset, if it was not asserted prior to reset.

Unconditionally enable AHCI-enable bit.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

+4 -2
+4 -2
drivers/ata/ahci.c
··· 898 898 * AHCI-specific, such as HOST_RESET. 899 899 */ 900 900 tmp = readl(mmio + HOST_CTL); 901 - if (!(tmp & HOST_AHCI_EN)) 902 - writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL); 901 + if (!(tmp & HOST_AHCI_EN)) { 902 + tmp |= HOST_AHCI_EN; 903 + writel(tmp, mmio + HOST_CTL); 904 + } 903 905 904 906 /* global controller reset */ 905 907 if ((tmp & HOST_RESET) == 0) {