Bug 87781 - ExpressCards can not be hotplugged (recognized by colboot only)
Summary: ExpressCards can not be hotplugged (recognized by colboot only)
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-05 13:49 UTC by Elmar Stellnberger
Modified: 2015-05-20 18:44 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.2.0-4-amd64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
lspci -vvv (coldplugged) (47.87 KB, text/plain)
2014-11-05 13:50 UTC, Elmar Stellnberger
Details
lspci -vvv (before plugging, clean boot) (45.06 KB, text/plain)
2014-11-05 13:50 UTC, Elmar Stellnberger
Details
lspci -vvv (plugged) (45.06 KB, text/plain)
2014-11-05 13:51 UTC, Elmar Stellnberger
Details
/proc/interrupts (coldplug) (1.95 KB, text/plain)
2014-11-05 13:52 UTC, Elmar Stellnberger
Details
/proc/interrupts (before plugging) (1.78 KB, text/plain)
2014-11-05 13:53 UTC, Elmar Stellnberger
Details
/proc/interrupts (after plugging) (1.78 KB, text/plain)
2014-11-05 13:53 UTC, Elmar Stellnberger
Details
/var/log/messages (153.12 KB, text/plain)
2014-11-05 13:54 UTC, Elmar Stellnberger
Details
pm-suspend.log (139.07 KB, text/plain)
2014-11-05 13:55 UTC, Elmar Stellnberger
Details
dmesg with debug ignore_loglevel initcall_debug: empty (122.45 KB, text/plain)
2014-11-05 20:07 UTC, Elmar Stellnberger
Details
lspci -vvxx (after hotplugging) (51.09 KB, text/plain)
2014-11-05 20:08 UTC, Elmar Stellnberger
Details
lspci -tv (after hotplugging) (1.89 KB, text/plain)
2014-11-05 20:09 UTC, Elmar Stellnberger
Details
kernel configuration + modules available / loaded after boot (50.86 KB, application/x-bzip2)
2014-11-06 10:26 UTC, Elmar Stellnberger
Details
acpidump for Amilo Xi2550 (112.26 KB, text/plain)
2014-11-10 19:44 UTC, Elmar Stellnberger
Details
acpidump for Amilo Xi2550 (new mainboard, same BIOS) (125.20 KB, text/plain)
2015-05-20 17:17 UTC, Elmar Stellnberger
Details

Description Elmar Stellnberger 2014-11-05 13:49:50 UTC
My USB3.0 ExpressCard is only recognized per coldboot.
Once I remove the ExpressCard all device nodes stay intact (i.e. of USB sticks plugged into the card) but can no more be mounted on re-plugging the ExpressCard.
  Additionally s2ram will no more work as soon as I boot into Linux with an ExpressCard plugged in.
Comment 1 Elmar Stellnberger 2014-11-05 13:50:36 UTC
Created attachment 156661 [details]
lspci -vvv (coldplugged)
Comment 2 Elmar Stellnberger 2014-11-05 13:50:59 UTC
Created attachment 156671 [details]
lspci -vvv (before plugging, clean boot)
Comment 3 Elmar Stellnberger 2014-11-05 13:51:22 UTC
Created attachment 156681 [details]
lspci -vvv (plugged)
Comment 4 Elmar Stellnberger 2014-11-05 13:52:32 UTC
Created attachment 156691 [details]
/proc/interrupts (coldplug)
Comment 5 Elmar Stellnberger 2014-11-05 13:53:08 UTC
Created attachment 156701 [details]
/proc/interrupts (before plugging)
Comment 6 Elmar Stellnberger 2014-11-05 13:53:35 UTC
Created attachment 156711 [details]
/proc/interrupts (after plugging)
Comment 7 Elmar Stellnberger 2014-11-05 13:54:50 UTC
Created attachment 156721 [details]
/var/log/messages
Comment 8 Elmar Stellnberger 2014-11-05 13:55:16 UTC
Created attachment 156731 [details]
pm-suspend.log
Comment 9 Yinghai Lu 2014-11-05 19:33:34 UTC
can you post dmesg instead with "debug ignore_loglevel initcall_debug"?

also good to have
lspci -vvxxx
lspci -tv
Comment 10 Elmar Stellnberger 2014-11-05 20:07:21 UTC
Created attachment 156801 [details]
dmesg with debug ignore_loglevel initcall_debug: empty

Simply nothing in the logs; not even with debug ignore_loglevel initcall_debug.
Comment 11 Elmar Stellnberger 2014-11-05 20:08:07 UTC
Created attachment 156811 [details]
lspci -vvxx (after hotplugging)
Comment 12 Elmar Stellnberger 2014-11-05 20:09:02 UTC
Created attachment 156821 [details]
lspci -tv (after hotplugging)
Comment 13 Yinghai Lu 2014-11-05 22:20:59 UTC
[    0.352170]  pci0000:00: Requesting ACPI _OSC control (0x1d)
[    0.352238]  pci0000:00: ACPI _OSC request failed (AE_NOT_FOUND), returned control mask: 0x1d
[    0.352314] ACPI _OSC control for PCIe not granted, disabling ASPM

your system BIOS does not have _OSC to handle pcie etc control (including pcie hp) to kernel, so kernel does not load pciehp.

Please check if you have acpiphp loaded or built-in.
Comment 14 Elmar Stellnberger 2014-11-06 10:26:43 UTC
Created attachment 156891 [details]
kernel configuration + modules available / loaded after boot

  There is an acpiphp_ibm module which can not be loaded but apparently nothing else (I should not have hesitated to also post cfg+mods initially.).

root:/home/elm/bugs/expresscard> modprobe acpiphp_ibm
ERROR: could not insert 'acpiphp_ibm': No such device
root:/home/elm/bugs/expresscard> modprobe pciehp
root:/home/elm/bugs/expresscard> lsmod | grep pciehp
root:/home/elm/bugs/expresscard>
Comment 15 Yinghai Lu 2014-11-07 00:26:38 UTC
acpiphp is loaded in

CONFIG_HOTPLUG_PCI_ACPI=y

and 

[    0.729191] calling  acpiphp_init+0x0/0x55 @ 1
[    0.729258] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.729618] initcall acpiphp_init+0x0/0x55 returned -19 after 350 usecs

so looks like you BIOS does not support acpiphp.

No acpiphp and no pciehp support, you will not have hotplug automatically.

The only solution for you:
use 
echo 1 > /sys/bus/pci/devices/0000:02:00.0/remove
before take Expresscard out from slots physically.

use
echo 1 > /sys/bus/pci/rescan
after plug the card ....

Or check if there is BIOS update or even get another laptop to try luck.
Comment 16 Elmar Stellnberger 2014-11-08 11:14:08 UTC
  Yes, that works in deed. I hope that one day we will get coreboot support for that machine; at least as soon as I would receive something about the schematic of the board (There will be no BIOS updates).
  Yinghai, do you have anything against having a look at the ExpressCard adapter (Bug 43192)? It would be even more valuable than a working native slot since I still have some computers with PCMCIA but no eSATA and USB3.0 support.
Comment 17 Bjorn Helgaas 2014-11-10 19:13:00 UTC
Elmar, does ExpressCard hotplug work as you expect on Windows?  If it works on Windows but not on Linux, there should be something we can do to make Linux work better.

Can you also attach an acpidump for reference?
Comment 18 Elmar Stellnberger 2014-11-10 19:44:49 UTC
Created attachment 157191 [details]
acpidump for Amilo Xi2550

Hmmm, Windows. The computer was sold with Windows Vista. That is why I would presume that it works with Vista. I currently have no OEM-DVD but can offer to install Windows 7 and give you test results in a week or two.
Comment 19 Elmar Stellnberger 2014-11-13 20:49:43 UTC
Bjorn; I have tested it with Windows 7 and it can recognize when an ExpressCard has been plugged - it prompts me to install USB3.0 drivers, then.
Comment 20 Bjorn Helgaas 2014-11-13 21:36:14 UTC
Thanks for testing that, Elmar.  So we *should* be able to make this work on Linux, too.  The only ways I can think of are:

1) Figure out if it's safe for us to use pciehp (native PCIe hotplug) on this box.
2) Figure out if acpiphp (ACPI hotplug) is supposed to work, but it doesn't work on Linux because we're not using it correctly.

An acpidump is the first place I'd look, to see if there's an _OSC where we don't expect it, or if there are acpiphp methods that we're not using for some reason.
Comment 21 Alan 2014-12-10 17:19:41 UTC
3) suspect windows is polling
Comment 22 Elmar Stellnberger 2015-05-20 17:17:15 UTC
Created attachment 177531 [details]
acpidump for Amilo Xi2550 (new mainboard, same BIOS)

Great! Now it works. I have the same BIOS version, a new mainboard and Linux 3.16.0-4-amd64; tested: s2ram with ExpressCard and Data Medium, autorecognition of plugging an USB3 ExpressCard and USB sticks into the ExpressCard.
Comment 23 Elmar Stellnberger 2015-05-20 17:28:48 UTC
There seems to be no difference in the main section (DSDT) of the acpi dump (which is displayed by both versions of acpidump in the same way) so I would guess that there has been a fix for it in the kernel.
Comment 24 Elmar Stellnberger 2015-05-20 18:44:02 UTC
Definitely resolved by Linux (It reproducably does not work with 3.2.0-4-amd64 but with 3.16.0-4-amd64 it does.). Well done!

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