Re: [PATCH 00/14] ahci/libata: clean up platform device removal
From: Tejun Heo <tj@kernel.org>
Date: 2012-11-02 17:01:47
Hello, On Fri, Nov 02, 2012 at 12:46:14AM -0700, Brian Norris wrote:
(1) Allows ahci_platform to unbind a device from the driver. This is useful for
allowing total power-off of the device, for instance.
(2) Adds ahci_platform ata_port_operations.host_stop() hook, so that
platform-device exit() can power down the device at the appropriate point
in the removal sequence.
(3) Adds a common ata_platform_remove_one() function so that we don't
re-implement a simple host detach across many platform drivers
(4) Switches many platform drivers to the new .remove function from (3)I personally would have converted all drivers in one patch but I think either way is fine. Other than the indentation thing, for all patches in this series. Acked-by: Tejun Heo [off-list ref]
P.S. A related but distinct issue: someting is still broken in the ata_host_detach() function, for shutting down the host, spinning down disks, etc. When I rmmod the driver or unbind the device, I get the following failures, and the HDD doesn't spin down:
That's because detaching the driver is handled basically as controller hot unplug. By the time SCSI is noticing the SCSI devices are going away, the corresponding ATA devices are already away. It's kinda natural to implement that way. Is this an actual problem? Thanks. -- tejun