]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
libata: mask off DET when restoring SControl for detach
authorTejun Heo <tj@kernel.org>
Mon, 3 Nov 2008 10:27:07 +0000 (19:27 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 4 Nov 2008 06:08:33 +0000 (01:08 -0500)
libata restores SControl on detach; however, trying to restore
non-zero DET can cause undeterministic behavior including PMP device
going offline till power cycling.  Mask off DET when restoring
SControl.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-core.c

index 91b478f205572ec6570e17bb41bda4b635593311..622350d9b2e3af3915b07ca03ccdd2de4bf00d47 100644 (file)
@@ -5936,7 +5936,7 @@ static void ata_port_detach(struct ata_port *ap)
         * to us.  Restore SControl and disable all existing devices.
         */
        __ata_port_for_each_link(link, ap) {
-               sata_scr_write(link, SCR_CONTROL, link->saved_scontrol);
+               sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
                ata_link_for_each_dev(dev, link)
                        ata_dev_disable(dev);
        }