* Patch "ACPI / bus: Leave modalias empty for devices which are not present" has been added to the 4.14-stable tree
@ 2018-02-01 13:11 gregkh
2018-02-01 13:13 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2018-02-01 13:11 UTC (permalink / raw)
To: hdegoede, alexander.levin, gregkh, rafael.j.wysocki
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
ACPI / bus: Leave modalias empty for devices which are not present
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
acpi-bus-leave-modalias-empty-for-devices-which-are-not-present.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Thu Feb 1 13:45:42 CET 2018
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 15 Oct 2017 21:24:49 +0200
Subject: ACPI / bus: Leave modalias empty for devices which are not present
From: Hans de Goede <hdegoede@redhat.com>
[ Upstream commit 10809bb976648ac58194a629e3d7af99e7400297 ]
Most Bay and Cherry Trail devices use a generic DSDT with all possible
peripheral devices present in the DSDT, with their _STA returning 0x00 or
0x0f based on AML variables which describe what is actually present on
the board.
Since ACPI device objects with a 0x00 status (not present) still get an
entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID
modalias, userspace would end up loading modules for non present hardware.
This commit fixes this by leaving the modalias empty for non present
devices. This results in 10 modules less being loaded with a generic
distro kernel config on my Cherry Trail test-device (a GPD pocket).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/device_sysfs.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -146,6 +146,10 @@ static int create_pnp_modalias(struct ac
int count;
struct acpi_hardware_id *id;
+ /* Avoid unnecessarily loading modules for non present devices. */
+ if (!acpi_device_is_present(acpi_dev))
+ return 0;
+
/*
* Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should
* be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the
Patches currently in stable-queue which might be from hdegoede@redhat.com are
queue-4.14/acpi-bus-leave-modalias-empty-for-devices-which-are-not-present.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch "ACPI / bus: Leave modalias empty for devices which are not present" has been added to the 4.14-stable tree
2018-02-01 13:11 Patch "ACPI / bus: Leave modalias empty for devices which are not present" has been added to the 4.14-stable tree gregkh
@ 2018-02-01 13:13 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2018-02-01 13:13 UTC (permalink / raw)
To: gregkh, alexander.levin, rafael.j.wysocki; +Cc: stable, stable-commits
Hi,
On 01-02-18 14:11, gregkh@linuxfoundation.org wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> ACPI / bus: Leave modalias empty for devices which are not present
>
> to the 4.14-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> acpi-bus-leave-modalias-empty-for-devices-which-are-not-present.patch
> and it can be found in the queue-4.14 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
Interesting ... I was not directly expecting this to go to stable, I guess
it cannot hurt, but since there where some doubts about this patch during review
I do find this a bit surprising...
Rafael?
Regards,
Hans
>
>
> From foo@baz Thu Feb 1 13:45:42 CET 2018
> From: Hans de Goede <hdegoede@redhat.com>
> Date: Sun, 15 Oct 2017 21:24:49 +0200
> Subject: ACPI / bus: Leave modalias empty for devices which are not present
>
> From: Hans de Goede <hdegoede@redhat.com>
>
>
> [ Upstream commit 10809bb976648ac58194a629e3d7af99e7400297 ]
>
> Most Bay and Cherry Trail devices use a generic DSDT with all possible
> peripheral devices present in the DSDT, with their _STA returning 0x00 or
> 0x0f based on AML variables which describe what is actually present on
> the board.
>
> Since ACPI device objects with a 0x00 status (not present) still get an
> entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID
> modalias, userspace would end up loading modules for non present hardware.
>
> This commit fixes this by leaving the modalias empty for non present
> devices. This results in 10 modules less being loaded with a generic
> distro kernel config on my Cherry Trail test-device (a GPD pocket).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/acpi/device_sysfs.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> --- a/drivers/acpi/device_sysfs.c
> +++ b/drivers/acpi/device_sysfs.c
> @@ -146,6 +146,10 @@ static int create_pnp_modalias(struct ac
> int count;
> struct acpi_hardware_id *id;
>
> + /* Avoid unnecessarily loading modules for non present devices. */
> + if (!acpi_device_is_present(acpi_dev))
> + return 0;
> +
> /*
> * Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should
> * be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the
>
>
> Patches currently in stable-queue which might be from hdegoede@redhat.com are
>
> queue-4.14/acpi-bus-leave-modalias-empty-for-devices-which-are-not-present.patch
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-01 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 13:11 Patch "ACPI / bus: Leave modalias empty for devices which are not present" has been added to the 4.14-stable tree gregkh
2018-02-01 13:13 ` Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.