Re: [PATCH v2 14/16] x86/amd_node, platform/x86/amd/hsmp: Have HSMP use SMN through AMD_NODE

Yazen Ghannam
2024-12-11T16:14:04Z

On Mon, Dec 09, 2024 at 03:32:02PM +0200, Ilpo Järvinen wrote:
> On Fri, 6 Dec 2024, Yazen Ghannam wrote:

[...]

> > --- a/drivers/platform/x86/amd/hsmp/acpi.c
> > +++ b/drivers/platform/x86/amd/hsmp/acpi.c
> > @@ -10,7 +10,6 @@
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >
> > #include <asm/amd_hsmp.h>
> > -#include <asm/amd_nb.h>
> >
> > #include <linux/acpi.h>
> > #include <linux/device.h>
> > @@ -24,6 +23,8 @@
> >
> > #include <uapi/asm-generic/errno-base.h>
> >
> > +#include <asm/amd_node.h>
> > +
> > #include "hsmp.h"
> >
> > #define DRIVER_NAME "amd_hsmp"
> > @@ -321,8 +322,8 @@ static int hsmp_acpi_probe(struct platform_device *pdev)
> > return -ENOMEM;
> >
> > if (!hsmp_pdev->is_probed) {
> > - hsmp_pdev->num_sockets = amd_nb_num();
> > - if (hsmp_pdev->num_sockets == 0 || hsmp_pdev->num_sockets > MAX_AMD_SOCKETS)
> > + hsmp_pdev->num_sockets = amd_num_nodes();
> > + if (hsmp_pdev->num_sockets == 0 || hsmp_pdev->num_sockets > MAX_AMD_NUM_NODES)
>
> Hi,
>
> Now that this define moves outside of hsmp files, it would be useful to
> add static_assert() and a comment next to the attributes which are always
> created for 0-7 sockets. That way, it can be detected on the build time if
> the define changes and more entires would need to be added there.
>
> Other than that, this seemed okay.
>

Okay, will do.

Thanks,
Yazen