Concern about commit bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Manivannan Sadhasivam
maintainerQuoted 23 lines · Slark Xiao
Hi Mani,
I got a problem recently about thehealth_checkfunction. It's disabled in my Thinkpad X1 Gen14.
After checking, this feature was disbaled because the commit bus: mhi: host:pci_generic: ReadSUBSYSTEM_VENDOR_IDfor VF's to check status.This commit only allows the device that the value "
pdev->is_physfn" is true to enable health check. But I don't know why my PC and WWAN device would get a false result. Test result as below:[ 3.920101] mhi-pci-generic 0000:08:00.0: MHI PCI device found: foxconn-t99w696 [ 3.920113] mhi-pci-generic 0000:08:00.0: ##debug## mhi_cntrl_config is assign [ 3.920114] mhi-pci-generic 0000:08:00.0: ##debug## mhi_pci_claim .. [ 3.920127] mhi-pci-generic 0000:08:00.0: enabling device (0000 -> 0002) [ 3.920179] mhi-pci-generic 0000:08:00.0: ##debug## mhi_pci_get_irqs .. [ 3.930223] mhi-pci-generic 0000:08:00.0: ##debug## mhi_register_controller .. [ 3.935268] mhi-pci-generic 0000:08:00.0: ##debug## mhi_prepare_for_power_up .. [ 3.935373] mhi-pci-generic 0000:08:00.0: ##debug## mhi_sync_power_up .. [ 3.935375] mhi mhi0: Requested to power ON [ 3.935388] mhi mhi0: Power on setup success [ 3.971342] mhi-pci-generic 0000:08:00.0: pdev->is_physfn is 0 [ 3.971346] mhi-pci-generic 0000:08:00.0: pdev->is_virtfn is 0
Quoted 7 lines
For my situation, both
pdev->is_virtfnandpdev->is_physfnare false.
And I also checked the requirement forpdev->is_physf, seems it will only be 1 if the device has SR-IOV capbility and the function is recognized as a PF. If your device is just a regular PCIe function or the kernel does not recognize the SR-IOV capability, it will be 0.So for
mhi_pci_genericside, I suggest that we should modify it by using "!pdev->is_virtfn" instead of "pdev->is_physfn".
Sorry for the breakage! Yeah, that was a mistake. It should've been "!pdev->is_virtfn". Let me fix it right away.
Thanks for reporting. Please share your tested-by tag for the patch after testing it.
- Mani
Signature · 1 line
மணிவண்ணன் சதாசிவம்