2023-10-24 06:21:26

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v3 0/6] Refine _UID references across kernel

This series refines _UID references across kernel by:

- Extracting _UID matching functionality from acpi_dev_hid_uid_match()
helper and introducing it as a separate acpi_dev_uid_match() helper.

- Converting manual _UID references to use the standard ACPI helpers.

Changes since v2:
- Drop review tags as suggested by Andy.

Changes since v1:
- Change acpi_dev_uid_match() to return false in case of NULL argument.
- Drop accepted patches.

Raag Jadav (6):
ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
pinctrl: intel: use acpi_dev_uid_match() for matching _UID
ACPI: utils: use acpi_dev_uid_match() for matching _UID
ACPI: x86: use acpi_dev_uid_match() for matching _UID
hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and
_UID
perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and
_UID

drivers/acpi/utils.c | 34 ++++++++++++++++++++++-----
drivers/acpi/x86/utils.c | 3 +--
drivers/hwmon/nct6775-platform.c | 4 +---
drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++----
drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
include/acpi/acpi_bus.h | 1 +
include/linux/acpi.h | 5 ++++
7 files changed, 40 insertions(+), 17 deletions(-)


base-commit: a4ed5bffbeb19cfb7e21ac3b3f09d7bfe39a849b
--
2.17.1


2023-10-24 06:21:29

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v3 4/6] ACPI: x86: use acpi_dev_uid_match() for matching _UID

Convert manual _UID references to use the standard ACPI helper.

Signed-off-by: Raag Jadav <[email protected]>
---
drivers/acpi/x86/utils.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 63d834dd3811..bc65ebfcdf76 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -184,8 +184,7 @@ bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *s
if (acpi_match_device_ids(adev, override_status_ids[i].hid))
continue;

- if (!adev->pnp.unique_id ||
- strcmp(adev->pnp.unique_id, override_status_ids[i].uid))
+ if (!acpi_dev_uid_match(adev, override_status_ids[i].uid))
continue;
}

--
2.17.1

2023-10-24 06:21:43

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v3 5/6] hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and _UID

Convert manual _UID references to use the standard ACPI helper.

Signed-off-by: Raag Jadav <[email protected]>
---
drivers/hwmon/nct6775-platform.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index 81bf03dad6bb..0adeeab7ee03 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -1465,10 +1465,8 @@ static const char * const asus_msi_boards[] = {
static int nct6775_asuswmi_device_match(struct device *dev, void *data)
{
struct acpi_device *adev = to_acpi_device(dev);
- const char *uid = acpi_device_uid(adev);
- const char *hid = acpi_device_hid(adev);

- if (hid && !strcmp(hid, ASUSWMI_DEVICE_HID) && uid && !strcmp(uid, data)) {
+ if (acpi_dev_hid_uid_match(adev, ASUSWMI_DEVICE_HID, data)) {
asus_acpi_dev = adev;
return 1;
}
--
2.17.1

2023-10-24 06:21:55

by Raag Jadav

[permalink] [raw]
Subject: [PATCH v3 6/6] perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID

Convert manual _UID references to use the standard ACPI helpers.

Signed-off-by: Raag Jadav <[email protected]>
---
drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
index e2b7827c4563..f0e6d14281d6 100644
--- a/drivers/perf/arm_cspmu/arm_cspmu.c
+++ b/drivers/perf/arm_cspmu/arm_cspmu.c
@@ -1061,7 +1061,7 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu)

static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)
{
- u32 acpi_uid;
+ u64 acpi_uid;
struct device *cpu_dev;
struct acpi_device *acpi_dev;

@@ -1071,10 +1071,8 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)

acpi_dev = ACPI_COMPANION(cpu_dev);
while (acpi_dev) {
- if (!strcmp(acpi_device_hid(acpi_dev),
- ACPI_PROCESSOR_CONTAINER_HID) &&
- !kstrtouint(acpi_device_uid(acpi_dev), 0, &acpi_uid) &&
- acpi_uid == container_uid)
+ if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, NULL) &&
+ !acpi_dev_uid_to_integer(acpi_dev, &acpi_uid) && acpi_uid == container_uid)
return 0;

acpi_dev = acpi_dev_parent(acpi_dev);
--
2.17.1

2023-10-24 09:41:12

by Mika Westerberg

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] Refine _UID references across kernel

On Tue, Oct 24, 2023 at 11:50:12AM +0530, Raag Jadav wrote:
> This series refines _UID references across kernel by:
>
> - Extracting _UID matching functionality from acpi_dev_hid_uid_match()
> helper and introducing it as a separate acpi_dev_uid_match() helper.
>
> - Converting manual _UID references to use the standard ACPI helpers.
>
> Changes since v2:
> - Drop review tags as suggested by Andy.
>
> Changes since v1:
> - Change acpi_dev_uid_match() to return false in case of NULL argument.
> - Drop accepted patches.
>
> Raag Jadav (6):
> ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
> pinctrl: intel: use acpi_dev_uid_match() for matching _UID
> ACPI: utils: use acpi_dev_uid_match() for matching _UID
> ACPI: x86: use acpi_dev_uid_match() for matching _UID
> hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and
> _UID
> perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and
> _UID

For the series,

Reviewed-by: Mika Westerberg <[email protected]>

> drivers/acpi/utils.c | 34 ++++++++++++++++++++++-----
> drivers/acpi/x86/utils.c | 3 +--
> drivers/hwmon/nct6775-platform.c | 4 +---
> drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++----
> drivers/pinctrl/intel/pinctrl-intel.c | 2 +-

This pinctrl one is also fine by me so if Andy does not have objections,
feel free to add my,

Acked-by: Mika Westerberg <[email protected]>

> include/acpi/acpi_bus.h | 1 +
> include/linux/acpi.h | 5 ++++
> 7 files changed, 40 insertions(+), 17 deletions(-)
>
>
> base-commit: a4ed5bffbeb19cfb7e21ac3b3f09d7bfe39a849b
> --
> 2.17.1

2023-10-24 11:01:29

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] Refine _UID references across kernel

On Tue, Oct 24, 2023 at 12:30:10PM +0300, Mika Westerberg wrote:
> On Tue, Oct 24, 2023 at 11:50:12AM +0530, Raag Jadav wrote:
> > This series refines _UID references across kernel by:

...

> > drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
>
> This pinctrl one is also fine by me so if Andy does not have objections,
> feel free to add my,

TL;DR: I had, but Rafael seems wanted your opinion. Whatever, I'm not
preventing this from happening, but I still consider that the uid check
for NULL in the helper should mimic the same logic as in
acpi_dev_hid_uid_match(). That's why I asked to drop my tags from this
series.

--
With Best Regards,
Andy Shevchenko


2023-10-24 19:51:41

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] Refine _UID references across kernel

On Tue, Oct 24, 2023 at 11:30 AM Mika Westerberg
<[email protected]> wrote:
>
> On Tue, Oct 24, 2023 at 11:50:12AM +0530, Raag Jadav wrote:
> > This series refines _UID references across kernel by:
> >
> > - Extracting _UID matching functionality from acpi_dev_hid_uid_match()
> > helper and introducing it as a separate acpi_dev_uid_match() helper.
> >
> > - Converting manual _UID references to use the standard ACPI helpers.
> >
> > Changes since v2:
> > - Drop review tags as suggested by Andy.
> >
> > Changes since v1:
> > - Change acpi_dev_uid_match() to return false in case of NULL argument.
> > - Drop accepted patches.
> >
> > Raag Jadav (6):
> > ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
> > pinctrl: intel: use acpi_dev_uid_match() for matching _UID
> > ACPI: utils: use acpi_dev_uid_match() for matching _UID
> > ACPI: x86: use acpi_dev_uid_match() for matching _UID
> > hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and
> > _UID
> > perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and
> > _UID
>
> For the series,
>
> Reviewed-by: Mika Westerberg <[email protected]>
>
> > drivers/acpi/utils.c | 34 ++++++++++++++++++++++-----
> > drivers/acpi/x86/utils.c | 3 +--
> > drivers/hwmon/nct6775-platform.c | 4 +---
> > drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++----
> > drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
>
> This pinctrl one is also fine by me so if Andy does not have objections,
> feel free to add my,
>
> Acked-by: Mika Westerberg <[email protected]>

Whole series applied as 6.7 material with tags as per the above, thanks!

2023-10-25 02:06:31

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] Refine _UID references across kernel

On Tue, Oct 24, 2023 at 09:51:08PM +0200, Rafael J. Wysocki wrote:
> On Tue, Oct 24, 2023 at 11:30 AM Mika Westerberg
> <[email protected]> wrote:
> >
> > On Tue, Oct 24, 2023 at 11:50:12AM +0530, Raag Jadav wrote:
> > > This series refines _UID references across kernel by:
> > >
> > > - Extracting _UID matching functionality from acpi_dev_hid_uid_match()
> > > helper and introducing it as a separate acpi_dev_uid_match() helper.
> > >
> > > - Converting manual _UID references to use the standard ACPI helpers.
> > >
> > > Changes since v2:
> > > - Drop review tags as suggested by Andy.
> > >
> > > Changes since v1:
> > > - Change acpi_dev_uid_match() to return false in case of NULL argument.
> > > - Drop accepted patches.
> > >
> > > Raag Jadav (6):
> > > ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
> > > pinctrl: intel: use acpi_dev_uid_match() for matching _UID
> > > ACPI: utils: use acpi_dev_uid_match() for matching _UID
> > > ACPI: x86: use acpi_dev_uid_match() for matching _UID
> > > hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and
> > > _UID
> > > perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and
> > > _UID
> >
> > For the series,
> >
> > Reviewed-by: Mika Westerberg <[email protected]>
> >
> > > drivers/acpi/utils.c | 34 ++++++++++++++++++++++-----
> > > drivers/acpi/x86/utils.c | 3 +--
> > > drivers/hwmon/nct6775-platform.c | 4 +---
> > > drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++----
> > > drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
> >
> > This pinctrl one is also fine by me so if Andy does not have objections,
> > feel free to add my,
> >
> > Acked-by: Mika Westerberg <[email protected]>
>
> Whole series applied as 6.7 material with tags as per the above, thanks!

Ok, that means I will _not_ apply the hwmon patch through
the hwmon tree.

FWIW, please note that I would have very much preferred applying
it through the hwmon tree, and I did _not_ Ack it.

Guenter

2023-10-25 11:32:50

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] Refine _UID references across kernel

On Wed, Oct 25, 2023 at 4:05 AM Guenter Roeck <[email protected]> wrote:
>
> On Tue, Oct 24, 2023 at 09:51:08PM +0200, Rafael J. Wysocki wrote:
> > On Tue, Oct 24, 2023 at 11:30 AM Mika Westerberg
> > <[email protected]> wrote:
> > >
> > > On Tue, Oct 24, 2023 at 11:50:12AM +0530, Raag Jadav wrote:
> > > > This series refines _UID references across kernel by:
> > > >
> > > > - Extracting _UID matching functionality from acpi_dev_hid_uid_match()
> > > > helper and introducing it as a separate acpi_dev_uid_match() helper.
> > > >
> > > > - Converting manual _UID references to use the standard ACPI helpers.
> > > >
> > > > Changes since v2:
> > > > - Drop review tags as suggested by Andy.
> > > >
> > > > Changes since v1:
> > > > - Change acpi_dev_uid_match() to return false in case of NULL argument.
> > > > - Drop accepted patches.
> > > >
> > > > Raag Jadav (6):
> > > > ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
> > > > pinctrl: intel: use acpi_dev_uid_match() for matching _UID
> > > > ACPI: utils: use acpi_dev_uid_match() for matching _UID
> > > > ACPI: x86: use acpi_dev_uid_match() for matching _UID
> > > > hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and
> > > > _UID
> > > > perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and
> > > > _UID
> > >
> > > For the series,
> > >
> > > Reviewed-by: Mika Westerberg <[email protected]>
> > >
> > > > drivers/acpi/utils.c | 34 ++++++++++++++++++++++-----
> > > > drivers/acpi/x86/utils.c | 3 +--
> > > > drivers/hwmon/nct6775-platform.c | 4 +---
> > > > drivers/perf/arm_cspmu/arm_cspmu.c | 8 +++----
> > > > drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
> > >
> > > This pinctrl one is also fine by me so if Andy does not have objections,
> > > feel free to add my,
> > >
> > > Acked-by: Mika Westerberg <[email protected]>
> >
> > Whole series applied as 6.7 material with tags as per the above, thanks!
>
> Ok, that means I will _not_ apply the hwmon patch through
> the hwmon tree.
>
> FWIW, please note that I would have very much preferred applying
> it through the hwmon tree, and I did _not_ Ack it.

OK, I'll drop it now and please feel free to pick it up (whenever it
is convenient to do so), or if you'd rather let me carry it, please
let me know.

It's only been in my bleeding-edge branch so far.

2023-10-25 18:59:47

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v3 5/6] hwmon: nct6775: use acpi_dev_hid_uid_match() for matching _HID and _UID

On Tue, Oct 24, 2023 at 11:50:17AM +0530, Raag Jadav wrote:
> Convert manual _UID references to use the standard ACPI helper.
>
> Signed-off-by: Raag Jadav <[email protected]>

Applied.

Guenter