]> git.baikalelectronics.ru Git - kernel.git/commit
sata_promise: fix hardreset lockdep error
authorMikael Pettersson <mikpe@it.uu.se>
Sun, 16 Sep 2012 18:53:43 +0000 (20:53 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 28 Nov 2012 17:37:56 +0000 (12:37 -0500)
commit4f17d2be158db48c257e6a4b4cbaaa2a68d4a694
tree7fb4455806be0ac8dad86e26adc0efe82967f874
parent3784ba10f2de8fb6434f38c651d65bf03fa81866
sata_promise: fix hardreset lockdep error

sata_promise's pdc_hard_reset_port() needs to serialize because it
flips a port-specific bit in controller register that's shared by
all ports. The code takes the ata host lock for this, but that's
broken because an interrupt may arrive on our irq during the hard
reset sequence, and that too will take the ata host lock. With
lockdep enabled a big nasty warning is seen.

Fixed by adding private state to the ata host structure, containing
a second lock used only for serializing the hard reset sequences.
This eliminated the lockdep warnings both on my test rig and on
the original reporter's machine.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Adko Branil <adkobranil@yahoo.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_promise.c