libata: Keep shadow last_ctl up to date during resets
authorStuart MENEFY <stuart.menefy@st.com>
Tue, 10 Mar 2009 11:38:13 +0000 (11:38 +0000)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 13 Mar 2009 18:55:58 +0000 (14:55 -0400)
commite3e4385f6181f434c0d786998ad1d0eef4e21c9b
treeb5195b312ca7acebe99d0125e60fcc4eebb7e458
parent9d51af7bd2f1d730cb6eeeb9ff837e3441ad4e07
libata: Keep shadow last_ctl up to date during resets

libata keeps a shadow copy of the ATA CTL register (which is write only),
and only writes to the hardware when the required value doesn't match
the shadow. However this copy wasn't being maintained when performing
reset functions. This could cause problems for the first operation after
a reset when the correct value might not be written to the CTL register.

This problem was observed when hotplugging a drive: the identify command
was being issued with interrupts enabled, when they should have been
disabled.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-sff.c