Re: [PATCH 1/1] PCI/IDE: Fix using wrong VF ID for RID range calculation
From: Bjorn Helgaas
Date: Tue Jan 13 2026 - 16:46:31 EST
On Sun, Jan 11, 2026 at 04:06:31PM +0800, Li Ming wrote:
> When allocate a new IDE stream for a pci device in SR-IOV case, the RID
> range of the new IDE stream should cover all VFs of the device. VF id
> range of a pci device is [0 - (num_VFs - 1)], so should use (num_VFs - )
> as the last VF's ID.
s/(num_VFs - )/(num_VFs - 1)/ (I think?)
s/pci/PCI/ (or could just omit, it's obvious these are PCI devices)
s/id/ID/
> Fixes: 1e4d2ff3ae45 ("PCI/IDE: Add IDE establishment helpers")
> Signed-off-by: Li Ming <ming.li@xxxxxxxxxxxx>
> ---
> drivers/pci/ide.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/ide.c b/drivers/pci/ide.c
> index 26f7cc94ec31..9629f3ceb213 100644
> --- a/drivers/pci/ide.c
> +++ b/drivers/pci/ide.c
> @@ -283,8 +283,8 @@ struct pci_ide *pci_ide_stream_alloc(struct pci_dev *pdev)
> /* for SR-IOV case, cover all VFs */
> num_vf = pci_num_vf(pdev);
> if (num_vf)
> - rid_end = PCI_DEVID(pci_iov_virtfn_bus(pdev, num_vf),
> - pci_iov_virtfn_devfn(pdev, num_vf));
> + rid_end = PCI_DEVID(pci_iov_virtfn_bus(pdev, num_vf - 1),
> + pci_iov_virtfn_devfn(pdev, num_vf - 1));
> else
> rid_end = pci_dev_id(pdev);
>
> --
> 2.34.1
>