Re: [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----"Kamal Heib" <kamalheib1@xxxxxxxxx> wrote: -----

>To: linux-rdma@xxxxxxxxxxxxxxx
>From: "Kamal Heib" <kamalheib1@xxxxxxxxx>
>Date: 07/07/2020 03:09PM
>Cc: "Jason Gunthorpe" <jgg@xxxxxxxx>, "Doug Ledford"
><dledford@xxxxxxxxxx>, "Bernard Metzler" <bmt@xxxxxxxxxxxxxx>, "Kamal
>Heib" <kamalheib1@xxxxxxxxx>
>Subject: [EXTERNAL] [PATCH for-rc] RDMA/siw: Fix reporting
>vendor_part_id
>
>Move the initialization of the vendor_part_id to be before calling
>ib_register_device(), this is needed because the query_device()
>callback
>is called from the context of ib_register_device() before
>initializing
>the vendor_part_id, so the reported value is wrong.
>
>Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface")
>Signed-off-by: Kamal Heib <kamalheib1@xxxxxxxxx>
>---
> drivers/infiniband/sw/siw/siw_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/infiniband/sw/siw/siw_main.c
>b/drivers/infiniband/sw/siw/siw_main.c
>index a0b8cc643c5c..ed60c9e4643e 100644
>--- a/drivers/infiniband/sw/siw/siw_main.c
>+++ b/drivers/infiniband/sw/siw/siw_main.c
>@@ -67,12 +67,13 @@ static int siw_device_register(struct siw_device
>*sdev, const char *name)
> 	static int dev_id = 1;
> 	int rv;
> 
>+	sdev->vendor_part_id = dev_id++;
>+
> 	rv = ib_register_device(base_dev, name);
> 	if (rv) {
> 		pr_warn("siw: device registration error %d\n", rv);
> 		return rv;
> 	}
>-	sdev->vendor_part_id = dev_id++;
> 
> 	siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr);
> 
>-- 
>2.25.4
>
>
Many thanks, Kamal!
Reviewed-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx>




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux