From: Maverickk 78 <maverickk1778@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: pcie hotplug driver probe is not getting called
Date: Mon, 30 Sep 2024 18:19:37 +0530 [thread overview]
Message-ID: <CALfBBTtzhH_Dro+a2OGrz30CAWy7rcAcDNL3hio8EVU3o6+4Hw@mail.gmail.com> (raw)
In-Reply-To: <CALfBBTsmKYf5FT-pxLfM-C1EgdrKKhQU43OhMDBz2ZPtKcxaLQ@mail.gmail.com>
Update:
Hi Bjorn,
Looks like the pciehp_probe is invoked and the corresponding ISR
(pciehp_isr) is triggered if there is an event, but somehow only
pciehp_isr is traced by ftrace but not the probe function.
Maybe my assumptions of ftrace need correction.
Thanks for the response.
Regards
On Sun, 29 Sept 2024 at 19:29, Maverickk 78 <maverickk1778@gmail.com> wrote:
>
> Hi Bjorn,
>
> I have a switch connecting to the Host bridge, one of the downstream port(02:1.0) on the switch has the slot enabled.
>
> Appended pcie_ports=native along with pciehp.pciehp_force=1 pciehp.pciehp_debug=1 to the cmdline and I see the driver creating symlink to sysfs device node.
>
> Does this mean pciehp can handle the hotplug events? asking this because none of the functions in pciehp_core listed in ftrace?
>
> # uname -a
>
> Linux qemu-01 6.11.0+ #2 SMP PREEMPT_DYNAMIC Sat Sep 28 01:32:57 EEST 2024 x86_64 x86_64 x86_64 GNU/Linux
>
> # cat /proc/cmdline
>
> BOOT_IMAGE=/boot/vmlinuz-6.11.0+ root=UUID=f563804b-1b93-4921-90e1-4114c8111e8f ro ftrace=function_graph ftrace_graph_filter=*pcie* pciehp.pciehp_force=1 pciehp.pciehp_debug=1 pcie_ports=native quite splash crashkernel=512M-:192M vt.handoff=7
>
> # ls -ltr /sys/bus/pci_express/drivers/pciehp
>
> total 0
>
> --w------- 1 root root 4096 Sep 29 16:46 uevent
>
> --w------- 1 root root 4096 Sep 29 16:49 unbind
>
> --w------- 1 root root 4096 Sep 29 16:49 bind
>
> lrwxrwxrwx 1 root root 0 Sep 29 16:49 0000:02:01.0:pcie204 -> ../../../../devices/pci0000:00/0000:00:04.0/0000:01:00.0/0000:02:01.0/0000:02:01.0:pcie204
>
> #
>
>
> # lspci -vv -s 2:1.0
>
> 02:01.0 PCI bridge: Broadcom / LSI Device c040 (rev a0) (prog-if 00 [Normal decode])
>
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
>
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>
> Latency: 0
>
> Interrupt: pin ? routed to IRQ 25
>
> Bus: primary=02, secondary=03, subordinate=03, sec-latency=0
>
> I/O behind bridge: 00001000-00001fff [size=4K]
>
> Memory behind bridge: f8000000-f9ffffff [size=32M]
>
> Prefetchable memory behind bridge: 00000000fe200000-00000000fe3fffff [size=2M]
>
> Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
>
> BridgeCtl: Parity- SERR+ NoISA- VGA- VGA16- MAbort- >Reset- FastB2B-
>
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>
> Capabilities: [40] Power Management version 3
>
> Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
>
> Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>
> Capabilities: [48] MSI: Enable+ Count=1/8 Maskable+ 64bit+
>
> Address: 00000000fee03000 Data: 0020
>
> Masking: 000000fe Pending: 00000000
>
> Capabilities: [68] Express (v2) Downstream Port (Slot+), MSI 00
>
> DevCap: MaxPayload 512 bytes, PhantFunc 0
>
> ExtTag- RBE+
>
> DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
>
> RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
>
> MaxPayload 512 bytes, MaxReadReq 128 bytes
>
> DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr- TransPend-
>
> LnkCap: Port #0, Speed unknown, Width x2, ASPM L1, Exit Latency L1 <32us
>
> ClockPM- Surprise+ LLActRep+ BwNot+ ASPMOptComp+
>
> LnkCtl: ASPM Disabled; Disabled- CommClk-
>
> ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>
> LnkSta: Speed 32GT/s (downgraded), Width x2 (ok)
>
> TrErr- Train- SlotClk- DLActive+ BWMgmt- ABWMgmt-
>
> SltCap: AttnBtn+ PwrCtrl+ MRL+ AttnInd+ PwrInd+ HotPlug+ Surprise+
>
> Slot #0, PowerLimit 0.000W; Interlock- NoCompl-
>
> SltCtl: Enable: AttnBtn+ PwrFlt- MRL- PresDet- CmdCplt+ HPIrq+ LinkChg+
>
> Control: AttnInd Off, PwrInd Off, Power+ Interlock-
>
> SltSta: Status: AttnBtn- PowerFlt- MRL+ CmdCplt- PresDet- Interlock-
>
> Changed: MRL- PresDet- LinkState-
>
> DevCap2: Completion Timeout: Not Supported, TimeoutDis- NROPrPrP- LTR+
>
> 10BitTagComp+ 10BitTagReq- OBFF Not Supported, ExtFmt+ EETLPPrefix+, MaxEETLPPrefixes 4
>
> EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
>
> FRS- ARIFwd+
>
> AtomicOpsCap: Routing+
>
> DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- OBFF Disabled, ARIFwd-
>
> AtomicOpsCtl: EgressBlck-
>
> LnkCap2: Supported Link Speeds: RsvdP, Crosslink+ Retimer+ 2Retimers+ DRS+
>
> LnkCtl2: Target Link Speed: Unknown, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
>
> Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
>
> Compliance De-emphasis: -6dB
>
> LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
>
> EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
>
> Retimer- 2Retimers- CrosslinkRes: Downstream Port, DRS-
>
> DownstreamComp: Link Up - Present
>
> Capabilities: [a4] Subsystem: Broadcom / LSI Device 0144
>
> Capabilities: [100 v1] Extended Capability ID 0x2f
>
> Capabilities: [294 v3] Advanced Error Reporting
>
> UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>
> UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>
> UESvrt: DLP+ SDES+ TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>
> CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
>
> CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
>
> AERCap: First Error Pointer: 1f, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
>
> MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
>
> HeaderLog: 00000000 00000000 00000000 00000000
>
> Capabilities: [138 v1] Power Budgeting <?>
>
> Capabilities: [db4 v1] Secondary PCI Express
>
> LnkCtl3: LnkEquIntrruptEn- PerformEqu-
>
> LaneErrStat: 0
>
> Capabilities: [148 v1] Virtual Channel
>
> Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
>
> Arb: Fixed- WRR32- WRR64- WRR128-
>
> Ctrl: ArbSelect=Fixed
>
> Status: InProgress-
>
> VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>
> Arb: Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-
>
> Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>
> Status: NegoPending- InProgress-
>
> Capabilities: [af4 v1] Data Link Feature <?>
>
> Capabilities: [d00 v1] Physical Layer 16.0 GT/s <?>
>
> Capabilities: [d40 v1] Lane Margining at the Receiver <?>
>
> Capabilities: [e40 v1] Extended Capability ID 0x2a
>
> Capabilities: [e70 v1] Extended Capability ID 0x31
>
> Capabilities: [ec0 v1] Extended Capability ID 0x32
>
> Capabilities: [a80 v1] Extended Capability ID 0x34
>
> Capabilities: [b70 v1] Vendor Specific Information: ID=0001 Rev=0 Len=010 <?>
>
> Capabilities: [f24 v1] Access Control Services
>
> ACSCap: SrcValid+ TransBlk+ ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans+
>
> ACSCtl: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans-
>
> Capabilities: [b60 v1] Downstream Port Containment
>
> DpcCap: INT Msg #0, RPExt- PoisonedTLP+ SwTrigger+ RP PIO Log 0, DL_ActiveErr+
>
> DpcCtl: Trigger:0 Cmpl- INT- ErrCor- PoisonedTLP- SwTrigger- DL_ActiveErr-
>
> DpcSta: Trigger- Reason:00 INT- RPBusy- TriggerExt:00 RP PIO ErrPtr:00
>
> Source: 0000
>
> Capabilities: [b20 v1] Extended Capability ID 0x2c
>
> Kernel driver in use: pcieport
>
>
> On Fri, 27 Sept 2024 at 22:47, Bjorn Helgaas <helgaas@kernel.org> wrote:
>>
>> On Fri, Sep 27, 2024 at 08:50:41PM +0530, Maverickk 78 wrote:
>> > Hello
>> >
>> > Debugging a downstream port with slot capabilities indicating hotplug
>> > capability is advertised in pci capability(id =0x10) .
>> >
>> > None of the hotplug driver is getting invoked.
>> >
>> > I assume pciehp_probe should've been called because its associated
>> > with ".port_type = PCIE_ANY_PORT," in the pcie_port_service_driver
>> > structure.
>> >
>> > I assumed SHPC shpc_probe function would be called because the pci_id
>> > table has PCI_CLASS_BRIDGE_PCI_NORMAL, but nothing related to hotplug
>> > drivers is seen in the ftrace or dmesg.
>> >
>> > Tried "pciehp.pciehp_force=1 pciehp.pciehp_debug=1" in the command
>> > line but no luck
>> >
>> > As part of port initialization if the hotplug capability is indicated
>> > in the capability register the hotplug drivers should have been
>> > invoked, but looks like its not the case.
>>
>> I would expect pciehp to work in this case, but there is some
>> negotiation between the OS and the firmware to figure out which
>> owns it.
>>
>> I assume you have CONFIG_PCIEPORTBUS and CONFIG_HOTPLUG_PCI_PCIE
>> enabled? Can you supply the dmesg log and output of "sudo lspci -vv"?
>>
>> Bjorn
next prev parent reply other threads:[~2024-09-30 12:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 15:20 pcie hotplug driver probe is not getting called Maverickk 78
2024-09-27 17:17 ` Bjorn Helgaas
2024-09-29 13:59 ` Maverickk 78
2024-09-30 12:49 ` Maverickk 78 [this message]
2024-09-30 19:28 ` Bjorn Helgaas
2024-10-01 12:48 ` Maverickk 78
2024-10-01 18:09 ` Maverickk 78
2024-10-01 18:19 ` Keith Busch
[not found] ` <CALfBBTtxJB1BQkSZ=RBKCiZKNeTxsJHAZ50jdBUjNSmOf79NWw@mail.gmail.com>
2024-10-04 18:20 ` Maverickk 78
2024-10-04 21:56 ` Bjorn Helgaas
[not found] ` <CALfBBTtjXJiZBSfFTUAPsD+G15nPQQsn-2sCrAt1UwPsrNsqNg@mail.gmail.com>
2024-10-15 8:44 ` Maverickk 78
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=CALfBBTtzhH_Dro+a2OGrz30CAWy7rcAcDNL3hio8EVU3o6+4Hw@mail.gmail.com \
--to=maverickk1778@gmail.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).