mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "lizhijian@fujitsu.com" <lizhijian@fujitsu.com>
To: Dan Williams <dan.j.williams@intel.com>,
	"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
	"dave.jiang@intel.com" <dave.jiang@intel.com>,
	"ira.weiny@intel.com" <ira.weiny@intel.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus
Date: Tue, 21 Mar 2023 03:19:27 +0000	[thread overview]
Message-ID: <f6f97630-5a45-3e75-bb34-b0bdb66c1bee@fujitsu.com> (raw)
In-Reply-To: <641918a2cf2d3_26992942@dwillia2-xfh.jf.intel.com.notmuch>



On 21/03/2023 10:38, Dan Williams wrote:
> lizhijian@fujitsu.com wrote:
> [..]
>>> Now I do think it would be a good idea to fail device_add() if the bus
>>> is not registered,
>>
>> BTW, below line 369: device_add() didn't fail in practical.
>>
> 
> I think that's ok because the device gets added, but never probed due to
> this part of that commit I referenced:

Very thanks for your explanation.

> 
> @@ -503,20 +517,21 @@ int bus_add_device(struct device *dev)
>    */
>   void bus_probe_device(struct device *dev)
>   {
> -       struct bus_type *bus = dev->bus;
> +       struct subsys_private *sp = bus_to_subsys(dev->bus);
>          struct subsys_interface *sif;
>   
> -       if (!bus)
> +       if (!sp)
>                  return;
>   
> 
> ...so it does what you want which is disable the libnvdimm subsystem
> from binding to any devices without crashing.

Yes, it's fine enough to me.

      reply	other threads:[~2023-03-21  3:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  8:38 Li Zhijian
2023-03-16 15:54 ` Dan Williams
2023-03-17  1:42   ` lizhijian
2023-03-17  2:26     ` Dan Williams
2023-03-17  5:37       ` lizhijian
2023-03-17  5:59     ` Dan Williams
2023-03-20  2:06       ` lizhijian
2023-03-20 17:30         ` Dan Williams
2023-03-21  2:17           ` lizhijian
2023-03-21  2:38             ` Dan Williams
2023-03-21  3:19               ` lizhijian [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=f6f97630-5a45-3e75-bb34-b0bdb66c1bee@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    /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

all inboxes | Powered by JetHome®