From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Vivek.Pernamitta@quicinc.com, mhi@lists.linux.dev,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Vivek Pernamitta <quic_vpernami@quicinc.com>
Subject: Re: [PATCH v2 2/5] bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status
Date: Thu, 7 Aug 2025 13:45:42 +0530 [thread overview]
Message-ID: <7118392a-2a19-44a4-97c0-d5e8a3190c08@oss.qualcomm.com> (raw)
In-Reply-To: <tynmkh4isrbi473zh6t4kd5bswrthxy3garhgpzafq6n2wrmqk@rfanfjgciyqv>
On 8/7/2025 1:43 PM, Manivannan Sadhasivam wrote:
> On Thu, Aug 07, 2025 at 12:39:26PM GMT, Krishna Chaitanya Chundru wrote:
>>
>>
>> On 8/6/2025 10:29 PM, Manivannan Sadhasivam wrote:
>>> On Thu, Jul 10, 2025 at 02:28:33PM GMT, Vivek.Pernamitta@quicinc.com wrote:
>>>> From: Vivek Pernamitta <quic_vpernami@quicinc.com>
>>>>
>>>> In SRIOV enabled devices, the VF DEVICE/VENDOR ID register returns FFFFh
>>>> when read (PCIe SRIOV spec-3.4.1.1). Therefore, read the PCIe
>>>> SUBSYSTEM_VENDOR_ID to check if the device is active.
>>>>
>>>> Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.com>
>>>> Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
>>>> ---
>>>> drivers/bus/mhi/host/pci_generic.c | 6 ++++--
>>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
>>>> index 7d0ac1c34ddf95ace2a85e5f08884f51604d9b0f..4bafe93b56c54e2b091786e7fcd68a36c8247b8e 100644
>>>> --- a/drivers/bus/mhi/host/pci_generic.c
>>>> +++ b/drivers/bus/mhi/host/pci_generic.c
>>>> @@ -1025,8 +1025,10 @@ static bool mhi_pci_is_alive(struct mhi_controller *mhi_cntrl)
>>>> struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
>>>> u16 vendor = 0;
>>>> - if (pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor))
>>>> - return false;
>>>> + if (pdev->is_virtfn)
>>>> + pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor);
>>>> + else
>>>> + pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor);
>>>
>>> You should not read the sub Vendor ID for VF. PCIe spec suggests reading the PF
>>> Vendor ID for VF. So you should just use pci_physfn() API as below:
>>>
>>> pci_read_config_word(pci_physfn(pdev), PCI_VENDOR_ID, &vendor);
>>>
>>> This will work for both PF and VF.
>>>
>> This will defeat the purpose of having health check monitor for VF,
>> as we are always reading PF vendor ID and will not know VF status at all.
>
> Do we really have a usecase to perform health check for VFs? Health check is
> supposed to happen for devices that can fail abruptly.
>
yeah as VF is not a physical link we can disable health check monitor
for VF's in the probe itself.
- Krishna Chaitanya.
> - Mani
>
next prev parent reply other threads:[~2025-08-07 8:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 8:58 [PATCH v2 0/5] bus: mhi: host: Enable SRIOV support in MHI driver Vivek.Pernamitta
2025-07-10 8:58 ` [PATCH v2 1/5] bus: mhi: host: Add support for separate controller configurations for VF and PF Vivek.Pernamitta
2025-07-10 8:58 ` [PATCH v2 2/5] bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status Vivek.Pernamitta
2025-08-06 16:59 ` Manivannan Sadhasivam
2025-08-07 7:09 ` Krishna Chaitanya Chundru
2025-08-07 8:13 ` Manivannan Sadhasivam
2025-08-07 8:15 ` Krishna Chaitanya Chundru [this message]
2025-08-07 8:26 ` Manivannan Sadhasivam
2025-07-10 8:58 ` [PATCH v2 3/5] bus: mhi: host: pci_generic: Remove MHI driver and ensure graceful device recovery Vivek.Pernamitta
2025-07-10 12:42 ` Konrad Dybcio
2025-07-23 12:11 ` Vivek Pernamitta
2025-07-23 12:51 ` Konrad Dybcio
2025-08-06 17:28 ` Manivannan Sadhasivam
2025-07-10 8:58 ` [PATCH v2 4/5] bus: mhi: host: pci_generic: Add SRIOV support for PCIe device Vivek.Pernamitta
2025-07-10 12:43 ` Konrad Dybcio
2025-07-10 8:58 ` [PATCH v2 5/5] bus: host: mhi: Need to honor sys_err at power_up state Vivek.Pernamitta
2025-07-10 12:46 ` Konrad Dybcio
2025-08-06 17:32 ` Manivannan Sadhasivam
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=7118392a-2a19-44a4-97c0-d5e8a3190c08@oss.qualcomm.com \
--to=krishna.chundru@oss.qualcomm.com \
--cc=Vivek.Pernamitta@quicinc.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=quic_vpernami@quicinc.com \
/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
all inboxes | Powered by JetHome®