Re: [PATCH] dax: include bus.h for definition of run_dax()

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The run_dax() prototype is defined in "bus.h" but drivers/dax/super.c > does not include this. Include bus.h to silece the following sparse > warning: > > drivers/dax/super.c:337:6: warning: symbol 'run_dax' was not declared. Should > it be static? A different version of this

Re: [PATCH] nvdimm: make nd_class variable static

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse > is generating the following warning. Remove this by making it static: > > drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. > Should it be static? Reviewed-by: Ira Weiny >

[PATCH v5 10/10] acpi/thermal: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 09/10] acpi/nfit: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 08/10] acpi/nfit: Improve terminator line in acpi_nfit_ids

2023-06-16 Thread Michal Wilczynski
Currently terminator line contains redunant characters. Remove them and also remove a comma at the end. Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index

[PATCH v5 07/10] acpi/nfit: Move acpi_nfit_notify() before acpi_nfit_add()

2023-06-16 Thread Michal Wilczynski
To use new style of installing event handlers acpi_nfit_notify() needs to be known inside acpi_nfit_add(). Move acpi_nfit_notify() upwards in the file, so it can be used inside acpi_nfit_add(). Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 14 +++--- 1 file changed, 7

[PATCH v5 06/10] acpi/hed: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 05/10] acpi/battery: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 04/10] acpi/video: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 03/10] acpi/ac: Move handler installing logic to driver

2023-06-16 Thread Michal Wilczynski
Currently logic for installing notifications from ACPI devices is implemented using notify callback in struct acpi_driver. Preparations are being made to replace acpi_driver with more generic struct platform_driver, which doesn't contain notify callback. Furthermore as of now handlers are being

[PATCH v5 02/10] acpi/bus: Set driver_data to NULL every time .add() fails

2023-06-16 Thread Michal Wilczynski
Most drivers set driver_data during .add() callback, but usually they don't set it back to NULL in case of a failure. Set driver_data to NULL in acpi_device_probe() to avoid code duplication. Signed-off-by: Michal Wilczynski --- drivers/acpi/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v5 01/10] acpi/bus: Introduce wrappers for ACPICA event handler install/remove

2023-06-16 Thread Michal Wilczynski
Introduce new acpi_dev_install_notify_handler() and acpi_dev_remove_notify_handler(). Those functions are replacing old installers, and after all drivers switch to the new model, old installers will be removed. Make acpi_dev_install_notify_handler() and acpi_dev_remove_notify_handler()

[PATCH v5 00/10] Remove .notify callback in acpi_device_ops

2023-06-16 Thread Michal Wilczynski
*** IMPORTANT *** This is part 1 - only drivers in acpi directory to ease up review process. Rest of the drivers will be handled in separate patchsets. Currently drivers support ACPI event handlers by defining .notify callback in acpi_device_ops. This solution is suboptimal as event handler

[PATCH] nvdimm: make nd_class variable static

2023-06-16 Thread Ben Dooks
The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse is generating the following warning. Remove this by making it static: drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. Should it be static? Signed-off-by: Ben Dooks --- drivers/nvdimm/bus.c | 2 +-

[PATCH] nvdimm: make security_show static

2023-06-16 Thread Ben Dooks
The security_show function is not used outsid of drivers/nvdimm/dimm_devs.c and the attribute it is for is also already static. Silence the sparse warning for this not being declared by making it static. Fixes: drivers/nvdimm/dimm_devs.c:352:9: warning: symbol 'security_show' was not declared.

Re: [PATCH] nvdimm: make security_show static

2023-06-16 Thread Dave Jiang
On 6/16/23 09:09, Ben Dooks wrote: The security_show function is not used outsid of drivers/nvdimm/dimm_devs.c s/outsid/outside/ and the attribute it is for is also already static. Silence the sparse warning for this not being declared by making it static. Fixes:

[PATCH] dax: include bus.h for definition of run_dax()

2023-06-16 Thread Ben Dooks
The run_dax() prototype is defined in "bus.h" but drivers/dax/super.c does not include this. Include bus.h to silece the following sparse warning: drivers/dax/super.c:337:6: warning: symbol 'run_dax' was not declared. Should it be static? Signed-off-by: Ben Dooks --- drivers/dax/super.c | 1 +

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-06-16 Thread David Hildenbrand
On 16.06.23 00:00, Vishal Verma wrote: With DAX memory regions originating from CXL memory expanders or NVDIMMs, the kmem driver may be hot-adding huge amounts of system memory on a system without enough 'regular' main memory to support the memmap for it. To avoid this, ensure that all kmem

Re: [PATCH 2/3] mm/memory_hotplug: Export symbol mhp_supports_memmap_on_memory()

2023-06-16 Thread David Hildenbrand
On 16.06.23 00:00, Vishal Verma wrote: In preparation for the dax/kmem driver, which can be built as a module, to use this interface, export it with EXPORT_SYMBOL_GPL(). Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Andrew Morton Cc: David Hildenbrand Cc: Oscar Salvador Cc: Dan Williams Cc:

Re: [PATCH 1/3] mm/memory_hotplug: Allow an override for the memmap_on_memory param

2023-06-16 Thread David Hildenbrand
On 16.06.23 00:00, Vishal Verma wrote: For memory hotplug to consider MHP_MEMMAP_ON_MEMORY behavior, the 'memmap_on_memory' module parameter was a hard requirement. In preparation for the dax/kmem driver to use memmap_on_memory semantics, arrange for the module parameter check to be bypassed

Re: [PATCH 0/3] mm: use memmap_on_memory semantics for dax/kmem

2023-06-16 Thread David Hildenbrand
On 16.06.23 00:00, Vishal Verma wrote: The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There is a chance there isn't enough regular system memory available to fit ythe memmap for this new memory.

Re: [PATCH 3/3] dax/kmem: Always enroll hotplugged memory for memmap_on_memory

2023-06-16 Thread Huang, Ying
Vishal Verma writes: > With DAX memory regions originating from CXL memory expanders or > NVDIMMs, the kmem driver may be hot-adding huge amounts of system memory > on a system without enough 'regular' main memory to support the memmap > for it. To avoid this, ensure that all kmem managed

Re: [PATCH 1/3] mm/memory_hotplug: Allow an override for the memmap_on_memory param

2023-06-16 Thread Huang, Ying
Hi, Vishal, Thanks for your patch! Vishal Verma writes: > For memory hotplug to consider MHP_MEMMAP_ON_MEMORY behavior, the > 'memmap_on_memory' module parameter was a hard requirement. > > In preparation for the dax/kmem driver to use memmap_on_memory > semantics, arrange for the module