ahci/libata: clean up platform device removal
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest14 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | ahci_platform: enable hotplug unbindingdrivers/ | +3 | 0 replies | |
| 2/14 | ahci_platform: convert to module_platform_driverdrivers/ | +1 | 0 replies | |
| 3/14 | ahci_platform: perform platform exit in host_stop() hookdrivers/ | +23 | 0 replies | |
| 4/14 | libata: implement ata_platform_remove_one()drivers/ include/ | +27 | 6 replies | |
| 5/14 | ahci_platform: utilize common ata_platform_remove_one()drivers/ | +1 | 0 replies | |
| 6/14 | pata_ixp4xx_cf: utilize common ata_platform_remove_one()drivers/ | +1 | 0 replies | |
| 7/14 | pata_mpc52xx: utilize common ata_platform_remove_one()drivers/ | +3 | 0 replies | |
| 8/14 | pata_of_platform: utilize common ata_platform_remove_one()drivers/ | +1 | 0 replies | |
| 9/14 | pata_platform: utilize common ata_platform_remove_one()drivers/ | +1 | 0 replies | |
| 10/14 | ata_platform: remove unused remove functiondrivers/ include/ | +0 | 0 replies | |
| 11/14 | pata_palmld: utilize common ata_platform_remove_one()drivers/ | +1 | 0 replies | |
| 12/14 | sata_highbank: utilize common ata_platform_remove_one()drivers/ | +1 | 3 replies | |
| 13/14 | pata_octeon_cf: perform host detach, removal on exitdrivers/ | +1 | 0 replies | |
| 14/14 | libata: use pci_get_drvdata() helperdrivers/ | +3 | 0 replies |
Reviews trailers per patch
None of the 14 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Tejun Heo |
|---|---|
| Series | A-b |
| 1/14 | |
| 2/14 | |
| 3/14 | |
| 4/14 | |
| 5/14 | |
| 6/14 | |
| 7/14 | |
| 8/14 | |
| 9/14 | |
| 10/14 | |
| 11/14 | |
| 12/14 | |
| 13/14 | |
| 14/14 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/14] ahci/libata: clean up platform device removal
Hi,
This is a revision and extension of an RFC series I sent out a few times. Here are links to the previous patches, discussion, and questions.
http://article.gmane.org/gmane.linux.ide/53159 http://article.gmane.org/gmane.linux.ide/53143 http://article.gmane.org/gmane.linux.ide/52951
The major change from RFC v2 is that I rebased to the current libata/NEXT, then added new patches (PATCH 04/14 through PATCH 14/14).
This series does the following:
(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)
Thanks to Tejun for the comments, which suggested that ahci_platform (not libata-core) was broken.
Note that patch 13 provides untested new functionality to the pata_octeon_cf driver. It was missing a .remove function, so I took the liberty to add the common one. Feel free to exclude this patch.
Thanks,
Brian
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:
# echo strict-ahci.0 > /sys/bus/platform/drivers/ahci/unbind ata2.00: disabled sd 1:0:0:0: [sda] Synchronizing SCSI cache sd 1:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00 sd 1:0:0:0: [sda] Stopping disk sd 1:0:0:0: [sda] START_STOP FAILED sd 1:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
This is reproducible on my laptop (v3.2 kernel, AHCI PCI driver) and on my SoC AHCI core (v3.3 kernel, AHCI platform driver). I haven't been able to try a more recent kernel, but nothing I see in the changelogs suggests that there would be any difference.
I have narrowed down the error messages to the following info, although I am not yet familiar enough with these codepaths to make a recommendation:
ata_host_detach
|_ ata_port_detach
|_ ata_port_schedule_eh => SCSI error handler calls ata_dev_disable()
| ...
|_scsi_remove_host()
| ...
|__..._ sd_start_stop_device() => failure!Brian Norris (14):
ahci_platform: enable hotplug unbinding
ahci_platform: convert to module_platform_driver
ahci_platform: perform platform exit in host_stop() hook
libata: implement ata_platform_remove_one()
ahci_platform: utilize common ata_platform_remove_one()
pata_ixp4xx_cf: utilize common ata_platform_remove_one()
pata_mpc52xx: utilize common ata_platform_remove_one()
pata_of_platform: utilize common ata_platform_remove_one()
pata_platform: utilize common ata_platform_remove_one()
ata_platform: remove unused remove function
pata_palmld: utilize common ata_platform_remove_one()
sata_highbank: utilize common ata_platform_remove_one()
pata_octeon_cf: perform host detach, removal on exit
libata: use pci_get_drvdata() helper
drivers/ata/ahci_platform.c | 44 +++++++++++++++++++----------------------- drivers/ata/libata-core.c | 30 ++++++++++++++++++++++++---- drivers/ata/pata_ixp4xx_cf.c | 11 +---------- drivers/ata/pata_mpc52xx.c | 17 +++------------- drivers/ata/pata_octeon_cf.c | 1 + drivers/ata/pata_of_platform.c | 7 +------ drivers/ata/pata_palmld.c | 4 +--- drivers/ata/pata_platform.c | 24 +---------------------- drivers/ata/sata_highbank.c | 12 +----------- include/linux/ata_platform.h | 2 -- include/linux/libata.h | 4 ++++ 11 files changed, 59 insertions(+), 97 deletions(-)
Signature · 1 line
1.7.11.3