From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, linux-pci@vger.kernel.org
Subject: Re: Add option to passively listen for PCIE hotplug events
Date: Sun, 09 Nov 2008 16:08:54 +0000 [thread overview]
Message-ID: <49170B16.4010909@tuffmail.co.uk> (raw)
In-Reply-To: <491076BD.1030704@tuffmail.co.uk>
Alan Jenkins wrote:
> Matthew Garrett wrote:
>> On Tue, Nov 04, 2008 at 03:44:23PM +0000, Alan Jenkins wrote:
>>
>>
>>> I instrumented all the delays I could find. hpc_check_lnk_status() was
>>> the only one that came up. 1000ms delay per call, and I get 6 such
>>> delays.
>>>
>>
>> Ok, which is getting called from pciehp_enable_slot(). I'm not quite
>> clear on why this is being called 6 times - any chance you can put a
>> dump_stack() in there? Some are probably directly from the resume
>> code. This confuses me a little, since there's a check for whether
>> there's a card in the slot first. If that fails, pciehp_enable_slot()
>> isn't called. If it succeeds, pciehp_enable_slot checks whether the
>> slot is already powered up. If it is, it bails before doing the link
>> setup.
Bump. In case you're still slightly confused, I've found out why. It
skips the slot power check because POWER_CTRL(ctrl) == 0. (See "Power
Controller" in the debug output below).
Interestingly, I can see that hpc_get_power_status() is still being
called from elsewhere. So I'm not sure why we avoid calling it here.
Should I try out the obvious dumb fix (removing the POWER_CTRL test)?
Ta
Alan
# modprobe pciehp pciehp_passive=1 pciehp_debug=1
dmesg output from last of 3 pcie slots:
[ 328.873347] pciehp 0000:00:1c.1:pcie02: hpc_check_lnk_status: lnk_status = 1011
[ 328.873347] pciehp 0000:00:1c.1:pcie02: Device 0000:03:00.0 already exists at 0000:03:00, cannot hot-add
[ 328.873347] pciehp 0000:00:1c.1:pcie02: Cannot add device at 0000:03:00
[ 328.873347] pciehp 0000:00:1c.1:pcie02: hpc_get_power_status: SLOTCTRL 58 value read 38
[ 328.873347] pciehp 0000:00:1c.1:pcie02: hpc_get_attention_status: SLOTCTRL 58, value read 38
[ 328.873347] pciehp 0000:00:1c.1:pcie02: service driver pciehp loaded
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Hotplug Controller:
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Seg/Bus/Dev/Func/IRQ : 0000:00:1c.2 IRQ 45
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Vendor ID : 0x8086
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Device ID : 0x2664
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Subsystem ID : 0x0000
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Subsystem Vendor ID : 0x0000
[ 328.873347] pciehp 0000:00:1c.2:pcie02: PCIe Cap offset : 0x40
[ 328.873347] pciehp 0000:00:1c.2:pcie02: PCI resource [8] : 0x3f00000@0xf8000000
[ 328.873347] pciehp 0000:00:1c.2:pcie02: PCI resource [9] : 0x7000000@0xf0000000
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Slot Capabilities : 0x00180560
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Physical Slot Number : 3
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Attention Button : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Power Controller : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: MRL Sensor : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Attention Indicator : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Power Indicator : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Hot-Plug Surprise : yes
[ 328.873347] pciehp 0000:00:1c.2:pcie02: EMI Present : no
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Command Completed : yes
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Slot Status : 0x0040
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Slot Control : 0x0000
[ 328.873347] pciehp 0000:00:1c.2:pcie02: HPC vendor_id 8086 device_id 2664 ss_vid 0 ss_did 0
[ 328.873347] pciehp 0000:00:1c.2:pcie02: Registering domain:bus:dev=0000:01:00 hp_slot=0 sun=3 slot_device_offset=0
[ 328.873347] pciehp 0000:00:1c.2:pcie02: get_power_status: physical_slot = 3
[ 328.873347] pciehp 0000:00:1c.2:pcie02: hpc_get_power_status: SLOTCTRL 58 value read 38
[ 328.873347] pciehp 0000:00:1c.2:pcie02: get_attention_status: physical_slot = 3
[ 328.873347] pciehp 0000:00:1c.2:pcie02: hpc_get_attention_status: SLOTCTRL 58, value read 38
[ 328.873347] pciehp 0000:00:1c.2:pcie02: get_latch_status: physical_slot = 3
[ 328.873347] pciehp 0000:00:1c.2:pcie02: get_adapter_status: physical_slot = 3
[ 328.873347] pciehp 0000:00:1c.2:pcie02: board_added: slot device, slot offset, hp slot = 0, 0, 0
[ 329.876677] pciehp 0000:00:1c.2:pcie02: hpc_check_lnk_status: DEBUG TIME 1000ms
[ 329.876677] Pid: 5101, comm: modprobe Not tainted 2.6.28-rc3eeepc #128
[ 329.876677] Call Trace:
[ 329.876677] [<e02d3b11>] hpc_check_lnk_status+0x107/0x1ba [pciehp]
[ 329.876677] [<e02d1eaa>] pciehp_enable_slot+0x19d/0x2c9 [pciehp]
[ 329.876677] [<e02d19b8>] pciehp_probe+0x3b2/0x3ee [pciehp]
[ 329.876677] [<c01c276d>] pcie_port_probe_service+0x29/0x63
[ 329.876677] [<c020759b>] driver_probe_device+0xa1/0x117
[ 329.876677] [<c020765a>] __driver_attach+0x49/0x67
[ 329.876677] [<c0206df8>] bus_for_each_dev+0x35/0x56
[ 329.876677] [<c020744a>] driver_attach+0x11/0x13
[ 329.876677] [<c0207611>] __driver_attach+0x0/0x67
[ 329.876677] [<c020713f>] bus_add_driver+0x91/0x192
[ 329.876677] [<c02077b1>] driver_register+0x6d/0xc2
[ 329.876677] [<c0191561>] sysfs_addrm_finish+0x13/0x16f
[ 329.876677] [<e027d000>] pcied_init+0x0/0x5c [pciehp]
[ 329.876677] [<e027d00b>] pcied_init+0xb/0x5c [pciehp]
[ 329.876677] [<c0101134>] _stext+0x4c/0x136
[ 329.876677] [<c01576c3>] __vunmap+0x7c/0x8a
[ 329.876677] [<c0135324>] load_module+0xfe3/0x10e8
[ 329.876677] [<e0046c77>] acpi_get_hp_params_from_firmware+0x0/0x49d [pci_hotplug]
[ 329.876677] [<c01354b0>] sys_init_module+0x87/0x177
[ 329.876677] [<c010376d>] sysenter_do_call+0x12/0x21
[ 329.876677] pciehp 0000:00:1c.2:pcie02: hpc_check_lnk_status: lnk_status = 1011
[ 329.876677] pciehp 0000:00:1c.2:pcie02: Device 0000:01:00.0 already exists at 0000:01:00, cannot hot-add
[ 329.876677] pciehp 0000:00:1c.2:pcie02: Cannot add device at 0000:01:00
[ 329.876677] pciehp 0000:00:1c.2:pcie02: hpc_get_power_status: SLOTCTRL 58 value read 38
[ 329.876677] pciehp 0000:00:1c.2:pcie02: hpc_get_attention_status: SLOTCTRL 58, value read 38
[ 329.876677] pciehp 0000:00:1c.2:pcie02: service driver pciehp loaded
next prev parent reply other threads:[~2008-11-09 16:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bspwK-420-11@gated-at.bofh.it>
[not found] ` <bujnh-2fr-5@gated-at.bofh.it>
[not found] ` <bujwT-2Ew-5@gated-at.bofh.it>
[not found] ` <buml1-6du-3@gated-at.bofh.it>
2008-11-04 11:29 ` Add option to passively listen for PCIE hotplug events Alan Jenkins
2008-11-04 12:47 ` Matthew Garrett
2008-11-04 13:32 ` Matthew Garrett
2008-11-04 14:26 ` Alan Jenkins
2008-11-04 14:33 ` Matthew Garrett
2008-11-04 15:01 ` Alan Jenkins
2008-11-04 15:11 ` Matthew Garrett
2008-11-04 15:44 ` Alan Jenkins
2008-11-04 15:57 ` Matthew Garrett
2008-11-04 16:22 ` Alan Jenkins
2008-11-09 16:08 ` Alan Jenkins [this message]
2008-11-12 23:34 ` Matthew Garrett
2008-11-14 16:16 ` Matthew Garrett
2008-11-14 17:07 ` Alan Jenkins
2008-11-14 17:12 ` Matthew Garrett
2008-11-14 17:27 ` Alan Jenkins
2008-11-14 17:35 ` Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49170B16.4010909@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox