mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: Vivek.Pernamitta@quicinc.com, Manivannan Sadhasivam <mani@kernel.org>
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Vivek Pernamitta <quic_vpernami@quicinc.com>
Subject: Re: [PATCH 3/5] bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status
Date: Wed, 9 Jul 2025 18:09:48 +0530	[thread overview]
Message-ID: <7ed53821-c86a-41f0-bb99-ff43ebedd680@oss.qualcomm.com> (raw)
In-Reply-To: <20250703-sriov_vdev_next-20250630-v1-3-87071d1047e3@quicinc.com>



On 7/3/2025 8:39 PM, 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.
> 
Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

- Krishna Chaitanya.
> Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.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 22de02c26ceb946fb618d962ac8882d2db1be6b4..938f37d306a18b9a47f302df85697f837c225f0d 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);
>   
>   	if (vendor == (u16) ~0 || vendor == 0)
>   		return false;
> 

  reply	other threads:[~2025-07-09 12:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 15:09 [PATCH 0/5] bus: mhi: host: Enable SRIOV support in MHI driver Vivek.Pernamitta
2025-07-03 15:09 ` [PATCH 1/5] bus: mhi: host: pci_generic: Add SRIOV support for PCIe device Vivek.Pernamitta
2025-07-03 15:32   ` Konrad Dybcio
2025-07-09 12:35   ` Krishna Chaitanya Chundru
2025-07-03 15:09 ` [PATCH 2/5] bus: mhi: host: Add support for separate controller configurations for VF and PF Vivek.Pernamitta
2025-07-09 12:38   ` Krishna Chaitanya Chundru
2025-07-03 15:09 ` [PATCH 3/5] bus: mhi: host: pci_generic: Read SUBSYSTEM_VENDOR_ID for VF's to check status Vivek.Pernamitta
2025-07-09 12:39   ` Krishna Chaitanya Chundru [this message]
2025-07-03 15:09 ` [PATCH 4/5] bus: mhi: host: pci_generic: Remove MHI driver and ensure graceful device recovery Vivek.Pernamitta
2025-07-04  9:15   ` kernel test robot
2025-07-09 12:45   ` Krishna Chaitanya Chundru
2025-07-03 15:09 ` [PATCH 5/5] bus: host: mhi: Need to honor sys_err at power_up state Vivek.Pernamitta
2025-07-09 12:50   ` Krishna Chaitanya Chundru

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=7ed53821-c86a-41f0-bb99-ff43ebedd680@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®