> If a PCIe ExpressCard34 is inserted into the slot *before*
According to pciehp_debug output from you, your slot doesn't
have software programmable power controller. So your hardware
automatically power on the slot. I think this is why the value
of "power" file is already "1". (But I'm not sure if it is
correct, especially because your firmware doesn't have _OSC.)
On the other hand, my slot has software programmable power
controller. So the value of "power" file is "0" in this case.
Ok. I think your patch is trying to solve the following two
problems. Right?
- When the card is inserted *after* modprobing pciehp, the card
is automatically enabled (pciehp tries to automatically enable
slot when the card is inserted if the slot is surprise remove
capable). But if the card is inserted *before* modprobing
pciehp, the card is not automatically enabled even after
modprobing pciehp.
- When the card is inserted *before* modprobing pciehp, the card
is automatically powered on by hardware, but it is not detected
by OS. That is, "power" file tells the card is working, but it
is not working actually. It is strange.
But those are not problems on the slot which is not surprise remove
capable and has software programmable power controller because:
- When the card is inserted *after* modprobing pciehp, the card
is *not* automatically powered on/detected. So it is very
natural that the card, which had been inserted before modprobing
pciehp, is not automatically enabled at the pciehp modprobe time.
- When the card is inserted *before* modprobing pciehp, the card
is not automatically powered on by hardware if the slot has
sortware programmable power controller. So there is no
contradiction.
I think your patch has a bad effect to this kind of slots. So I
think your patch needs additional checks to see if the slot should
be enabled or not.
And you need to test your patch on PCIe Native hotplug capable
hardware:)
Thanks,
Kenji Kaneshige
-