Bug 41832 - [BISECTED]ata hotplug doesn't work on ports where link_power_management_policy=min_power
Summary: [BISECTED]ata hotplug doesn't work on ports where link_power_management_polic...
Status: NEW
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Serial ATA (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Tejun Heo
URL:
Keywords:
Depends on:
Blocks: 36912
  Show dependency tree
 
Reported: 2011-08-28 07:58 UTC by tcl_de
Modified: 2016-03-19 17:03 UTC (History)
5 users (show)

See Also:
Kernel Version: 3.02
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description tcl_de 2011-08-28 07:58:42 UTC
I recently upgraded to kernel 3.0.3 (from 2.6.38) and noticed that after the upgrade sata hotplug doesn't work any more after I have set the port's link_power_management_policy to min_power. After setting link_power_management_policy back to max_performance hotplug still keeps not working.
But sata hotplug works if I never set the policy to min_power.

I looked through recent libata commits and found out that I can make sata hotplug work regardless of the link power management policy state again by reverting http://git.kernel.org/?p=linux/kernel/git/stable/linux-3.0.y.git;a=commit;h=8a745f1f39b7a20047a362b67ce9151c07d14440
Comment 1 Tejun Heo 2011-08-28 09:34:04 UTC
Hmm... what controller are you using? Can you please post the output of "lspci -nn" and "dmesg" right after boot? Hotplug is expected to not work on min_power setting - hotplug requires keeping the link hot which drains power. Probably your controller simply doesn't support proper LPM so you didn't notice before the power off change. At any rate, it's the expected behavior.
Comment 2 tcl_de 2011-08-29 12:46:15 UTC
I actually tried this on two different PCs: (I hope I copied all relevant parts)
PC 1
lspci -nn:
00:11.0 SATA controller [0106]: ATI Technologies Inc SB7x0/SB8x0/SB9x0 SATA Controller [IDE mode] [1002:4390]
dmesg:
...
pci 0000:00:11.0: [1002:4390] type 0 class 0x000101
pci 0000:00:11.0: reg 10: [io  0xff00-0xff07]
pci 0000:00:11.0: reg 14: [io  0xfe00-0xfe03]
pci 0000:00:11.0: reg 18: [io  0xfd00-0xfd07]
pci 0000:00:11.0: reg 1c: [io  0xfc00-0xfc03]
pci 0000:00:11.0: reg 20: [io  0xfb00-0xfb0f]
pci 0000:00:11.0: reg 24: [mem 0xfe02f000-0xfe02f3ff]
pci 0000:00:11.0: set SATA to AHCI mode
...
ahci 0000:00:11.0: version 3.0
ahci 0000:00:11.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
ahci 0000:00:11.0: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode
ahci 0000:00:11.0: flags: 64bit ncq sntf ilck pm led clo pmp pio slum part ccc 
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
ata1: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f100 irq 22
ata2: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f180 irq 22
ata3: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f200 irq 22
ata4: SATA max UDMA/133 abar m1024@0xfe02f000 port 0xfe02f280 irq 22
ata2: SATA link down (SStatus 0 SControl 300) <- the port I use for hotplug
ata4: SATA link down (SStatus 0 SControl 300)
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8: HARD DISK 1, max UDMA/133
ata1.00: 1250263728 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
ata3.00: ATA-7: HARD DISK 2, max UDMA/133
ata3.00: 1465149168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
ata1.00: configured for UDMA/133
ata3.00: configured for UDMA/133


PC 2:
lspci -nn
00:1f.2 SATA controller [0106]: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller [8086:3b29] (rev 06)

dmesg
pci 0000:00:1f.2: [8086:3b29] type 0 class 0x000106
pci 0000:00:1f.2: reg 10: [io  0x3048-0x304f]
pci 0000:00:1f.2: reg 14: [io  0x305c-0x305f]
pci 0000:00:1f.2: reg 18: [io  0x3040-0x3047]
pci 0000:00:1f.2: reg 1c: [io  0x3058-0x305b]
pci 0000:00:1f.2: reg 20: [io  0x3000-0x301f]
pci 0000:00:1f.2: reg 24: [mem 0xd4627000-0xd46277ff]
pci 0000:00:1f.2: PME# supported from D3hot
pci 0000:00:1f.2: PME# disabled
...
ahci 0000:00:1f.2: version 3.0
ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: irq 40 for MSI/MSI-X
ahci: SSS flag set, parallel bus scan disabled
ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 4 ports 3 Gbps 0x23 impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part ems sxs apst 
ahci 0000:00:1f.2: setting latency timer to 64
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
scsi4 : ahci
scsi5 : ahci
ata1: SATA max UDMA/133 abar m2048@0xd4627000 port 0xd4627100 irq 40
ata2: SATA max UDMA/133 abar m2048@0xd4627000 port 0xd4627180 irq 40
ata3: DUMMY
ata4: DUMMY
ata5: DUMMY
ata6: SATA max UDMA/133 abar m2048@0xd4627000 port 0xd4627380 irq 40
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ACPI Error: [GTF0] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT0._SDD] (Node ffff880130c53230), AE_NOT_FOUND (20110413/psparse-536)
ACPI Error: [GTF0] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT0._GTF] (Node ffff880130c53258), AE_NOT_FOUND (20110413/psparse-536)
ata1.00: ATA-8: HARD DISK, max UDMA/133
ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 31/32), AA
ACPI Error: [GTF0] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT0._SDD] (Node ffff880130c53230), AE_NOT_FOUND (20110413/psparse-536)
ACPI Error: [GTF0] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT0._GTF] (Node ffff880130c53258), AE_NOT_FOUND (20110413/psparse-536)
ata1.00: configured for UDMA/133
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ACPI Error: [GTF1] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT1._SDD] (Node ffff880130c53348), AE_NOT_FOUND (20110413/psparse-536)
ACPI Error: [GTF1] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT1._GTF] (Node ffff880130c53370), AE_NOT_FOUND (20110413/psparse-536)
ata2.00: ATAPI: DVD BURNER, max UDMA/100
ACPI Error: [GTF1] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT1._SDD] (Node ffff880130c53348), AE_NOT_FOUND (20110413/psparse-536)
ACPI Error: [GTF1] Namespace lookup failure, AE_NOT_FOUND (20110413/psargs-359)
ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.PRT1._GTF] (Node ffff880130c53370), AE_NOT_FOUND (20110413/psparse-536)
ata2.00: configured for UDMA/100
ata6: SATA link down (SStatus 0 SControl 300) <- the port I use for hotplug


Even if hotplug is not expected to work in min_power state, one problem remains: "wakeup" going from min_power to max_performance doesn't work on empty ports!
Comment 3 Tejun Heo 2011-08-31 07:00:06 UTC
Those controllers do support LPM. Not sure why hotplug worked, weird. Unfortunately, I'm currently moving and can't test for a while. What do you mean by "wakeup" doesn't work on empty ports?

Thanks.
Comment 4 tcl_de 2011-08-31 07:48:07 UTC
I mean using kernel 3.0.3, if I set link power management policy of an empty port first to min_power and then back to max_performance, hotplug will NOT work on that port (even if the port is in max_performance state again now)! This did work with kernel 2.6.38.
Comment 5 Florian Mickler 2012-01-24 22:51:17 UTC
Is this still a problem in 3.2 or 3.3-rc1?
Comment 6 tcl_de 2012-02-17 11:03:17 UTC
I still experience the problem in 3.2.0.

Note You need to log in before you can comment on or make changes to this bug.