diff mbox series

[v2,15/20] dax/hmem: Move HMAT and Soft reservation probe initcall level

Message ID 167602001107.1924368.11562316181038595611.stgit@dwillia2-xfh.jf.intel.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series CXL RAM and the 'Soft Reserved' => 'System RAM' default | expand

Commit Message

Dan Williams Feb. 10, 2023, 9:06 a.m. UTC
In preparation for moving more filtering of "hmem" ranges into the
dax_hmem.ko module, update the initcall levels. HMAT range registration
moves to subsys_initcall() to be done before Soft Reservation probing,
and Soft Reservation probing is moved to device_initcall() to be done
before dax_hmem.ko initialization if it is built-in.

Tested-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/167564542109.847146.10113972881782419363.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/numa/hmat.c  |    2 +-
 drivers/dax/hmem/Makefile |    3 ++-
 drivers/dax/hmem/device.c |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Dave Jiang Feb. 10, 2023, 9:53 p.m. UTC | #1
On 2/10/23 2:06 AM, Dan Williams wrote:
> In preparation for moving more filtering of "hmem" ranges into the
> dax_hmem.ko module, update the initcall levels. HMAT range registration
> moves to subsys_initcall() to be done before Soft Reservation probing,
> and Soft Reservation probing is moved to device_initcall() to be done
> before dax_hmem.ko initialization if it is built-in.
> 
> Tested-by: Fan Ni <fan.ni@samsung.com>
> Link: https://lore.kernel.org/r/167564542109.847146.10113972881782419363.stgit@dwillia2-xfh.jf.intel.com
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   drivers/acpi/numa/hmat.c  |    2 +-
>   drivers/dax/hmem/Makefile |    3 ++-
>   drivers/dax/hmem/device.c |    2 +-
>   3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
> index 605a0c7053be..ff24282301ab 100644
> --- a/drivers/acpi/numa/hmat.c
> +++ b/drivers/acpi/numa/hmat.c
> @@ -869,4 +869,4 @@ static __init int hmat_init(void)
>   	acpi_put_table(tbl);
>   	return 0;
>   }
> -device_initcall(hmat_init);
> +subsys_initcall(hmat_init);
> diff --git a/drivers/dax/hmem/Makefile b/drivers/dax/hmem/Makefile
> index 57377b4c3d47..d4c4cd6bccd7 100644
> --- a/drivers/dax/hmem/Makefile
> +++ b/drivers/dax/hmem/Makefile
> @@ -1,6 +1,7 @@
>   # SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
> +# device_hmem.o deliberately precedes dax_hmem.o for initcall ordering
>   obj-$(CONFIG_DEV_DAX_HMEM_DEVICES) += device_hmem.o
> +obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
>   
>   device_hmem-y := device.o
>   dax_hmem-y := hmem.o
> diff --git a/drivers/dax/hmem/device.c b/drivers/dax/hmem/device.c
> index 903325aac991..20749c7fab81 100644
> --- a/drivers/dax/hmem/device.c
> +++ b/drivers/dax/hmem/device.c
> @@ -104,4 +104,4 @@ static __init int hmem_init(void)
>    * As this is a fallback for address ranges unclaimed by the ACPI HMAT
>    * parsing it must be at an initcall level greater than hmat_init().
>    */
> -late_initcall(hmem_init);
> +device_initcall(hmem_init);
>
Dave Jiang Feb. 10, 2023, 9:57 p.m. UTC | #2
On 2/10/23 2:53 PM, Dave Jiang wrote:
> 
> 
> On 2/10/23 2:06 AM, Dan Williams wrote:
>> In preparation for moving more filtering of "hmem" ranges into the
>> dax_hmem.ko module, update the initcall levels. HMAT range registration
>> moves to subsys_initcall() to be done before Soft Reservation probing,
>> and Soft Reservation probing is moved to device_initcall() to be done
>> before dax_hmem.ko initialization if it is built-in.
>>
>> Tested-by: Fan Ni <fan.ni@samsung.com>
>> Link: 
>> https://lore.kernel.org/r/167564542109.847146.10113972881782419363.stgit@dwillia2-xfh.jf.intel.com
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> 
>> ---
>>   drivers/acpi/numa/hmat.c  |    2 +-
>>   drivers/dax/hmem/Makefile |    3 ++-
>>   drivers/dax/hmem/device.c |    2 +-
>>   3 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
>> index 605a0c7053be..ff24282301ab 100644
>> --- a/drivers/acpi/numa/hmat.c
>> +++ b/drivers/acpi/numa/hmat.c
>> @@ -869,4 +869,4 @@ static __init int hmat_init(void)
>>       acpi_put_table(tbl);
>>       return 0;
>>   }
>> -device_initcall(hmat_init);
>> +subsys_initcall(hmat_init);
>> diff --git a/drivers/dax/hmem/Makefile b/drivers/dax/hmem/Makefile
>> index 57377b4c3d47..d4c4cd6bccd7 100644
>> --- a/drivers/dax/hmem/Makefile
>> +++ b/drivers/dax/hmem/Makefile
>> @@ -1,6 +1,7 @@
>>   # SPDX-License-Identifier: GPL-2.0
>> -obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
>> +# device_hmem.o deliberately precedes dax_hmem.o for initcall ordering
>>   obj-$(CONFIG_DEV_DAX_HMEM_DEVICES) += device_hmem.o
>> +obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
>>   device_hmem-y := device.o
>>   dax_hmem-y := hmem.o
>> diff --git a/drivers/dax/hmem/device.c b/drivers/dax/hmem/device.c
>> index 903325aac991..20749c7fab81 100644
>> --- a/drivers/dax/hmem/device.c
>> +++ b/drivers/dax/hmem/device.c
>> @@ -104,4 +104,4 @@ static __init int hmem_init(void)
>>    * As this is a fallback for address ranges unclaimed by the ACPI HMAT
>>    * parsing it must be at an initcall level greater than hmat_init().
>>    */
>> -late_initcall(hmem_init);
>> +device_initcall(hmem_init);
>>
Verma, Vishal L Feb. 11, 2023, 12:40 a.m. UTC | #3
On Fri, 2023-02-10 at 01:06 -0800, Dan Williams wrote:
> In preparation for moving more filtering of "hmem" ranges into the
> dax_hmem.ko module, update the initcall levels. HMAT range registration
> moves to subsys_initcall() to be done before Soft Reservation probing,
> and Soft Reservation probing is moved to device_initcall() to be done
> before dax_hmem.ko initialization if it is built-in.
> 
> Tested-by: Fan Ni <fan.ni@samsung.com>
> Link: https://lore.kernel.org/r/167564542109.847146.10113972881782419363.stgit@dwillia2-xfh.jf.intel.com
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/acpi/numa/hmat.c  |    2 +-
>  drivers/dax/hmem/Makefile |    3 ++-
>  drivers/dax/hmem/device.c |    2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)

Looks good,

Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

> 
> diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
> index 605a0c7053be..ff24282301ab 100644
> --- a/drivers/acpi/numa/hmat.c
> +++ b/drivers/acpi/numa/hmat.c
> @@ -869,4 +869,4 @@ static __init int hmat_init(void)
>         acpi_put_table(tbl);
>         return 0;
>  }
> -device_initcall(hmat_init);
> +subsys_initcall(hmat_init);
> diff --git a/drivers/dax/hmem/Makefile b/drivers/dax/hmem/Makefile
> index 57377b4c3d47..d4c4cd6bccd7 100644
> --- a/drivers/dax/hmem/Makefile
> +++ b/drivers/dax/hmem/Makefile
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
> +# device_hmem.o deliberately precedes dax_hmem.o for initcall ordering
>  obj-$(CONFIG_DEV_DAX_HMEM_DEVICES) += device_hmem.o
> +obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
>  
>  device_hmem-y := device.o
>  dax_hmem-y := hmem.o
> diff --git a/drivers/dax/hmem/device.c b/drivers/dax/hmem/device.c
> index 903325aac991..20749c7fab81 100644
> --- a/drivers/dax/hmem/device.c
> +++ b/drivers/dax/hmem/device.c
> @@ -104,4 +104,4 @@ static __init int hmem_init(void)
>   * As this is a fallback for address ranges unclaimed by the ACPI HMAT
>   * parsing it must be at an initcall level greater than hmat_init().
>   */
> -late_initcall(hmem_init);
> +device_initcall(hmem_init);
>
diff mbox series

Patch

diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
index 605a0c7053be..ff24282301ab 100644
--- a/drivers/acpi/numa/hmat.c
+++ b/drivers/acpi/numa/hmat.c
@@ -869,4 +869,4 @@  static __init int hmat_init(void)
 	acpi_put_table(tbl);
 	return 0;
 }
-device_initcall(hmat_init);
+subsys_initcall(hmat_init);
diff --git a/drivers/dax/hmem/Makefile b/drivers/dax/hmem/Makefile
index 57377b4c3d47..d4c4cd6bccd7 100644
--- a/drivers/dax/hmem/Makefile
+++ b/drivers/dax/hmem/Makefile
@@ -1,6 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
+# device_hmem.o deliberately precedes dax_hmem.o for initcall ordering
 obj-$(CONFIG_DEV_DAX_HMEM_DEVICES) += device_hmem.o
+obj-$(CONFIG_DEV_DAX_HMEM) += dax_hmem.o
 
 device_hmem-y := device.o
 dax_hmem-y := hmem.o
diff --git a/drivers/dax/hmem/device.c b/drivers/dax/hmem/device.c
index 903325aac991..20749c7fab81 100644
--- a/drivers/dax/hmem/device.c
+++ b/drivers/dax/hmem/device.c
@@ -104,4 +104,4 @@  static __init int hmem_init(void)
  * As this is a fallback for address ranges unclaimed by the ACPI HMAT
  * parsing it must be at an initcall level greater than hmat_init().
  */
-late_initcall(hmem_init);
+device_initcall(hmem_init);