Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-20 Thread lizhij...@fujitsu.com
On 21/03/2023 10:38, Dan Williams wrote: > lizhij...@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

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-20 Thread Dan Williams
lizhij...@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

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-20 Thread lizhij...@fujitsu.com
On 21/03/2023 01:30, Dan Williams wrote: > lizhij...@fujitsu.com wrote: > [..] Dan, Configure the kconfig with ACPI_NFIT [=m] && LIBNVDIMM [=y], and add extra kernel booting parameter 'initcall_blacklist=libnvdimm_init'. Then kernel panic! >>> >>> That's expected

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-20 Thread Dan Williams
lizhij...@fujitsu.com wrote: [..] > >> Dan, > >> > >> Configure the kconfig with ACPI_NFIT [=m] && LIBNVDIMM [=y], and add extra > >> kernel booting parameter > >> 'initcall_blacklist=libnvdimm_init'. Then kernel panic! > > > > That's expected though, > > Do you mean we just keep it as it is.

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-19 Thread lizhij...@fujitsu.com
On 17/03/2023 13:59, Dan Williams wrote: > lizhij...@fujitsu.com wrote: >> >> >> On 16/03/2023 23:54, Dan Williams wrote: >>> Li Zhijian wrote: nvdimm_bus_register() could be called from other modules, such as nfit, but it can only be called after the nvdimm_bus_type is registered.

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-17 Thread Dan Williams
lizhij...@fujitsu.com wrote: > > > On 16/03/2023 23:54, Dan Williams wrote: > > Li Zhijian wrote: > >> nvdimm_bus_register() could be called from other modules, such as nfit, > >> but it can only be called after the nvdimm_bus_type is registered. > >> > >> BUG: kernel NULL pointer dereference,

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-16 Thread lizhij...@fujitsu.com
On 17/03/2023 10:26, Dan Williams wrote: > lizhij...@fujitsu.com wrote: >> >> >> On 16/03/2023 23:54, Dan Williams wrote: >>> Li Zhijian wrote: nvdimm_bus_register() could be called from other modules, such as nfit, but it can only be called after the nvdimm_bus_type is registered.

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-16 Thread Dan Williams
lizhij...@fujitsu.com wrote: > > > On 16/03/2023 23:54, Dan Williams wrote: > > Li Zhijian wrote: > >> nvdimm_bus_register() could be called from other modules, such as nfit, > >> but it can only be called after the nvdimm_bus_type is registered. > >> > >> BUG: kernel NULL pointer dereference,

Re: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-16 Thread lizhij...@fujitsu.com
On 16/03/2023 23:54, Dan Williams wrote: > Li Zhijian wrote: >> nvdimm_bus_register() could be called from other modules, such as nfit, >> but it can only be called after the nvdimm_bus_type is registered. >> >> BUG: kernel NULL pointer dereference, address: 0098 >> #PF:

RE: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-16 Thread Dan Williams
Li Zhijian wrote: > nvdimm_bus_register() could be called from other modules, such as nfit, > but it can only be called after the nvdimm_bus_type is registered. > > BUG: kernel NULL pointer dereference, address: 0098 > #PF: supervisor read access in kernel mode > #PF:

[PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus

2023-03-16 Thread Li Zhijian
nvdimm_bus_register() could be called from other modules, such as nfit, but it can only be called after the nvdimm_bus_type is registered. BUG: kernel NULL pointer dereference, address: 0098 #PF: supervisor read access in kernel mode #PF: error_code(0x) - not-present page PGD