]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
libata: port and host should be stopped before hardware resources are released
authorTejun Heo <htejun@gmail.com>
Fri, 18 Jan 2008 12:52:50 +0000 (21:52 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Feb 2008 20:01:47 +0000 (12:01 -0800)
commit236dd7e3143e79b216e9f51e2488f9e3a60b4161
treed11a9366f6e858d4c5ecd25c151a8ac13f60e6d2
parent1ce946cdae3bef836416d8ced58eab4d18c45675
libata: port and host should be stopped before hardware resources are released

This is backport of 32ebbc0c0d5d18c0135b55d1eb0029f48c54aff0 and fixes
oops on driver module unload.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/libata-core.c