Bug 70261 - [PATCH]No card reader is available due to missing pciehp hotplug handling
Summary: [PATCH]No card reader is available due to missing pciehp hotplug handling
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-02-07 17:19 UTC by Takashi Iwai
Modified: 2014-02-19 07:33 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.13.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
lspci output (61.16 KB, text/plain)
2014-02-07 17:19 UTC, Takashi Iwai
Details
kernel messages (88.08 KB, text/plain)
2014-02-07 17:19 UTC, Takashi Iwai
Details
Fix patch (to 3.14-rc) (2.00 KB, patch)
2014-02-07 17:20 UTC, Takashi Iwai
Details | Diff
Fix patch to remove surprise bit checks (2.99 KB, patch)
2014-02-11 11:36 UTC, Takashi Iwai
Details | Diff

Description Takashi Iwai 2014-02-07 17:19:06 UTC
The SD/MMC card reader on HP ProBook 445 and 455 laptops doesn't work properly unless the machine is booted with the card inserted.

When a card is inserted, the machine generates a PCI hotplug event, and pciehp driver receives it, showing "Slot [xx] register" and "Slot [xx] unregistered" upon inserting/removing the card.  But, it doesn't do anything more than that.
The reason is that the corresponding PCIe device has no SURPRISE bit enabled, thus pciehp doesn't handle it.

The patch below is a fix for that, setting the surprise bit for the selected hardware.

We may fix pciehp just not to check the surprise bit but always handling the event, but some people showed objection, at the time I reported the problem in last March.  The discussion thread is found at:
    https://lkml.org/lkml/2013/3/20/274
Comment 1 Takashi Iwai 2014-02-07 17:19:27 UTC
Created attachment 125131 [details]
lspci output
Comment 2 Takashi Iwai 2014-02-07 17:19:44 UTC
Created attachment 125141 [details]
kernel messages
Comment 3 Takashi Iwai 2014-02-07 17:20:31 UTC
Created attachment 125151 [details]
Fix patch (to 3.14-rc)
Comment 4 Greg Kroah-Hartman 2014-02-07 17:36:28 UTC
On Fri, Feb 07, 2014 at 05:19:06PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
>          Component: HotPlug

This is a PCI issue, please reassign.
Comment 5 Bjorn Helgaas 2014-02-10 21:14:44 UTC
Takashi, I'm very sorry this has languished for so long.  I really think we need to just ignore the surprise bit.  I don't think we should bother with a DMI blacklist.

This might cause issues with KVM device assignment.  But Alex has recently added code to ignore hotplug events during secondary bus resets, so maybe that will be enough to avoid the KVM issues.

Would you mind updating your patch to remove the DMI whitelist and reference this bugzilla, and then post it to the linux-pci list and cc: Alex?
Comment 6 Takashi Iwai 2014-02-11 11:36:02 UTC
OK, will do.

Below is a patch to simply remove the surprise bit checks in pciehp driver.  If rather one-liner (forcibly adding the surprise bit) would be preferred, let me know.
Comment 7 Takashi Iwai 2014-02-11 11:36:38 UTC
Created attachment 125601 [details]
Fix patch to remove surprise bit checks
Comment 8 Takashi Iwai 2014-02-19 07:33:49 UTC
It turned out that Rajat's patch series for 3.15 fixed this issue, too.

commit e48f1b67
  PCI: pciehp: Use link change notifications for hot-plug and removal

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