* [PATCH v2] ACPI: glue: Reduce debug noise from acpi_device_notify()
@ 2026-09-04 15:44 Rafael J. Wysocki
2026-09-05 7:00 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-09-04 15:44 UTC (permalink / raw)
To: Linux ACPI; +Cc: LKML, Andy Shevchenko
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
When debug is enabled in the ACPI glue code that handles binding
devices to ACPI companions, acpi_device_notify() produces a lot of
message noise related to devices that have no ACPI companions.
Reduce that noise by checking the most obvious case, ACPI device
objects, directly and returning from acpi_device_notify() in that
case without printing any debug messages. Also avoid printing a
debug message when there is no matching ACPI bus type definition for
the given device, which is the case for the vast majority of devices.
Additionally, make the debug messages that get printed more informative
and change the format prefix to "ACPI/glue", so it is easier to filter
these messages.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
v1 -> v2:
* Do not return early from acpi_device_notify() for devices
without a bus type (Sashiko)
* Do not print messages for devices without matching ACPI bus
type definition (the vast majority)
* Update changelog
---
drivers/acpi/glue.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -6,7 +6,7 @@
* Copyright (c) 2005 Intel Corp.
*/
-#define pr_fmt(fmt) "ACPI: " fmt
+#define pr_fmt(fmt) "ACPI/glue: " fmt
#include <linux/acpi_iort.h>
#include <linux/export.h>
@@ -354,22 +354,27 @@ void acpi_device_notify(struct device *d
struct acpi_device *adev;
int ret;
+ /* ACPI devices have no ACPI companions. */
+ if (dev->bus == &acpi_bus_type)
+ return;
+
ret = acpi_bind_one(dev, NULL);
if (ret) {
struct acpi_bus_type *type = acpi_get_bus_type(dev);
if (!type)
- goto err;
+ return;
adev = type->find_companion(dev);
if (!adev) {
dev_dbg(dev, "ACPI companion not found\n");
- goto err;
+ return;
}
ret = acpi_bind_one(dev, adev);
- if (ret)
- goto err;
-
+ if (ret) {
+ dev_dbg(dev, "Binding to ACPI companion failed\n");
+ return;
+ }
if (type->setup) {
type->setup(dev);
goto done;
@@ -391,11 +396,6 @@ void acpi_device_notify(struct device *d
done:
acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n",
dev_name(dev));
-
- return;
-
-err:
- dev_dbg(dev, "No ACPI support\n");
}
void acpi_device_notify_remove(struct device *dev)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ACPI: glue: Reduce debug noise from acpi_device_notify()
2026-09-04 15:44 [PATCH v2] ACPI: glue: Reduce debug noise from acpi_device_notify() Rafael J. Wysocki
@ 2026-09-05 7:00 ` Andy Shevchenko
2026-09-05 10:36 ` Rafael J. Wysocki (Intel)
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-09-05 7:00 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux ACPI, LKML
On Fri, Sep 04, 2026 at 05:44:55PM +0200, Rafael J. Wysocki wrote:
> When debug is enabled in the ACPI glue code that handles binding
> devices to ACPI companions, acpi_device_notify() produces a lot of
> message noise related to devices that have no ACPI companions.
>
> Reduce that noise by checking the most obvious case, ACPI device
> objects, directly and returning from acpi_device_notify() in that
> case without printing any debug messages. Also avoid printing a
> debug message when there is no matching ACPI bus type definition for
> the given device, which is the case for the vast majority of devices.
>
> Additionally, make the debug messages that get printed more informative
> and change the format prefix to "ACPI/glue", so it is easier to filter
> these messages.
You are quick :-) But the comment I gave against v1 still stays here.
(TL;DR: I expect to see "ACPI: glue: " in pr_fmt().)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ACPI: glue: Reduce debug noise from acpi_device_notify()
2026-09-05 7:00 ` Andy Shevchenko
@ 2026-09-05 10:36 ` Rafael J. Wysocki (Intel)
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-09-05 10:36 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Rafael J. Wysocki, Linux ACPI, LKML
On Sat, Sep 5, 2026 at 9:00 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Sep 04, 2026 at 05:44:55PM +0200, Rafael J. Wysocki wrote:
>
> > When debug is enabled in the ACPI glue code that handles binding
> > devices to ACPI companions, acpi_device_notify() produces a lot of
> > message noise related to devices that have no ACPI companions.
> >
> > Reduce that noise by checking the most obvious case, ACPI device
> > objects, directly and returning from acpi_device_notify() in that
> > case without printing any debug messages. Also avoid printing a
> > debug message when there is no matching ACPI bus type definition for
> > the given device, which is the case for the vast majority of devices.
> >
> > Additionally, make the debug messages that get printed more informative
> > and change the format prefix to "ACPI/glue", so it is easier to filter
> > these messages.
>
> You are quick :-) But the comment I gave against v1 still stays here.
> (TL;DR: I expect to see "ACPI: glue: " in pr_fmt().)
Well, there's a v3 already in which I don't change pr_fmt() any more:
https://lore.kernel.org/linux-acpi/6048536.DvuYhMxLoT@rafael.j.wysocki/
because acpi_handle_debug() uses it like dev_fmt() (and only if
dynamic debug is compiled in) and it looks odd when printed after the
device name (or ACPI object path).
I have a patch to clean up the acpi_handle_*() mess which will be posted later.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-05 10:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 15:44 [PATCH v2] ACPI: glue: Reduce debug noise from acpi_device_notify() Rafael J. Wysocki
2026-09-05 7:00 ` Andy Shevchenko
2026-09-05 10:36 ` Rafael J. Wysocki (Intel)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®