]> git.baikalelectronics.ru Git - kernel.git/commit
libata: port and host should be stopped before hardware resources are released
authorTejun Heo <htejun@gmail.com>
Thu, 8 Nov 2007 04:09:00 +0000 (13:09 +0900)
committerJeff Garzik <jeff@garzik.org>
Thu, 8 Nov 2007 18:08:42 +0000 (13:08 -0500)
commit46a4f6d224d1ca7193ea927bd6e1274e91a85520
tree7da2103a3fd6998da95c3b38b5db69c24122df1d
parent6d4c26b0b243a618c240b0cea4ca8c2a2b284468
libata: port and host should be stopped before hardware resources are released

Port / host stop calls used to be made from ata_host_release() which
is called after all hardware resources acquired after host allocation
are released.  This is wrong as port and host stop routines often
access the hardware.

Add separate devres for port / host stop which is invoked right after
IRQ is released but with all other hardware resources intact.  The
devres is added iff ->host_stop and/or ->port_stop exist.

This problem has been spotted by Mark Lord.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c