Re: [RESEND][PATCH 1/1] fpga: altera-cvp: Limit driver registration to specific device ID

From: Xu Yilun

Date: Mon Nov 03 2025 - 03:59:21 EST


On Thu, Oct 30, 2025 at 03:05:44AM +0800, Kuhanh Murugasen Krishnan wrote:
> From: "Murugasen Krishnan, Kuhanh" <kuhanh.murugasen.krishnan@xxxxxxxxxx>

Is this your first post?

https://lore.kernel.org/all/20250212223553.2717304-1-kuhanh.murugasen.krishnan@xxxxxxxxx/

Please mark the patch v2 if this patch is for the same issue. And please
firstly response the talk and make clear all previous concerns, rather than
just sent the patch and left.

>
> The Altera CvP driver previously used PCI_ANY_ID, which caused it to
> bind to all PCIe devices with the Altera vendor ID. This led to
> incorrect driver association when multiple PCIe devices with different
> device IDs were present on the same platform.
>
> Update the device ID table to use 0x00 instead of PCI_ANY_ID so that
> the driver only attaches to the intended device.

So could you please answer the previous concern here?

Does dev_id 0x00 covers all supported devices? Do you have any DOC for
this?

>
> Reviewed-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>

I didn't see where the tag is from. Generally we don't prefer a
Reviewed-by tag firstly appear from other than the person named.

Thanks,
Yilun

> Signed-off-by: Ang Tien Sung <tien.sung.ang@xxxxxxxxxx>
> Signed-off-by: Murugasen Krishnan, Kuhanh <kuhanh.murugasen.krishnan@xxxxxxxxxx>
> ---
> drivers/fpga/altera-cvp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
> index 5af0bd33890c..97e9d4d981ad 100644
> --- a/drivers/fpga/altera-cvp.c
> +++ b/drivers/fpga/altera-cvp.c
> @@ -560,7 +560,7 @@ static int altera_cvp_probe(struct pci_dev *pdev,
> static void altera_cvp_remove(struct pci_dev *pdev);
>
> static struct pci_device_id altera_cvp_id_tbl[] = {
> - { PCI_VDEVICE(ALTERA, PCI_ANY_ID) },
> + { PCI_VDEVICE(ALTERA, 0x00) },
> { }
> };
> MODULE_DEVICE_TABLE(pci, altera_cvp_id_tbl);
> --
> 2.25.1
>
>