Skip to content

Commit 299246f

Browse files
htejunJeff Garzik
authored andcommitted
libata: mask off DET when restoring SControl for detach
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>
1 parent 6a87e42 commit 299246f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5936,7 +5936,7 @@ static void ata_port_detach(struct ata_port *ap)
59365936
* to us. Restore SControl and disable all existing devices.
59375937
*/
59385938
__ata_port_for_each_link(link, ap) {
5939-
sata_scr_write(link, SCR_CONTROL, link->saved_scontrol);
5939+
sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
59405940
ata_link_for_each_dev(dev, link)
59415941
ata_dev_disable(dev);
59425942
}

0 commit comments

Comments
 (0)