From: Jason Gunthorpe <jgg@nvidia.com>
To: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Cc: <danil.kipnis@cloud.ionos.com>, <jinpu.wang@cloud.ionos.com>,
<linux-rdma@vger.kernel.org>, <dledford@redhat.com>,
<leon@kernel.org>
Subject: Re: [PATCH] RDMA/rtrs-srv: Replace device_register with device_initialize and device_add
Date: Mon, 24 Aug 2020 13:59:25 -0300 [thread overview]
Message-ID: <20200824165925.GA3208822@nvidia.com> (raw)
In-Reply-To: <20200811092722.2450-1-haris.iqbal@cloud.ionos.com>
On Tue, Aug 11, 2020 at 02:57:22PM +0530, Md Haris Iqbal wrote:
> There are error cases when we will call free_srv before device kobject is
> initialized; in such cases calling put_device generates the following
> warning,
>
> kobject: '(null)' (000000009f5445ed): is not initialized, yet
> kobject_put() is being called.
>
> It was suggested by Jason to call device_initialize() sooner.
>
> So call device_initialize() only once when the server is allocated. If we
> end up calling put_srv() and subsequently free_srv(), our call to
> put_device() would result in deletion of the obj. Call device_add() later
> when we actually have a connection. Correspondingly, call device_del()
> instead of device_unregister() when srv->dev_ref falls to 0.
>
> Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality")
> Signed-off-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
> Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> ---
> drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 8 ++++----
> drivers/infiniband/ulp/rtrs/rtrs-srv.c | 1 +
> 2 files changed, 5 insertions(+), 4 deletions(-)
Applied to for-rc, thanks
Jason
prev parent reply other threads:[~2020-08-24 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 9:27 [PATCH] RDMA/rtrs-srv: Replace device_register with device_initialize and device_add Md Haris Iqbal
2020-08-18 18:57 ` Haris Iqbal
2020-08-24 16:59 ` Jason Gunthorpe [this message]
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=20200824165925.GA3208822@nvidia.com \
--to=jgg@nvidia.com \
--cc=danil.kipnis@cloud.ionos.com \
--cc=dledford@redhat.com \
--cc=haris.iqbal@cloud.ionos.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).