* [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id
@ 2020-07-07 13:09 Kamal Heib
2020-07-07 14:30 ` Bernard Metzler
2020-07-08 12:25 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Kamal Heib @ 2020-07-07 13:09 UTC (permalink / raw)
To: linux-rdma; +Cc: Jason Gunthorpe, Doug Ledford, Bernard Metzler, Kamal Heib
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id
2020-07-07 13:09 [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id Kamal Heib
@ 2020-07-07 14:30 ` Bernard Metzler
2020-07-08 12:25 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Bernard Metzler @ 2020-07-07 14:30 UTC (permalink / raw)
To: Kamal Heib; +Cc: linux-rdma, Jason Gunthorpe, Doug Ledford
-----"Kamal Heib" <kamalheib1@gmail.com> wrote: -----
>To: linux-rdma@vger.kernel.org
>From: "Kamal Heib" <kamalheib1@gmail.com>
>Date: 07/07/2020 03:09PM
>Cc: "Jason Gunthorpe" <jgg@ziepe.ca>, "Doug Ledford"
><dledford@redhat.com>, "Bernard Metzler" <bmt@zurich.ibm.com>, "Kamal
>Heib" <kamalheib1@gmail.com>
>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@gmail.com>
>---
> 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@zurich.ibm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id
2020-07-07 13:09 [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id Kamal Heib
2020-07-07 14:30 ` Bernard Metzler
@ 2020-07-08 12:25 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-07-08 12:25 UTC (permalink / raw)
To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Bernard Metzler
On Tue, Jul 07, 2020 at 04:09:31PM +0300, Kamal Heib wrote:
> 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@gmail.com>
> Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
> drivers/infiniband/sw/siw/siw_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to for-rc, thanks
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-08 12:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 13:09 [PATCH for-rc] RDMA/siw: Fix reporting vendor_part_id Kamal Heib
2020-07-07 14:30 ` Bernard Metzler
2020-07-08 12:25 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).