linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 4.9 10/55] ACPI / bus: Leave modalias empty for devices which are not present
Date: Wed, 24 Jan 2018 04:15:33 +0000	[thread overview]
Message-ID: <20180124041521.32223-10-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180124041521.32223-1-alexander.levin@microsoft.com>

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@microsoft.com>
---
 drivers/acpi/device_sysfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 7b2c48fde4e2..201c7ceb7052 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -146,6 +146,10 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
 	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
-- 
2.11.0

  parent reply	other threads:[~2018-01-24  4:43 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  4:15 [PATCH AUTOSEL for 4.9 01/55] drm/vc4: Account for interrupts in flight Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 02/55] cpupowerutils: bench - Fix cpu online check Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 04/55] KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 03/55] cpupower : Fix cpupower working when cpu0 is offline Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 05/55] KVM: x86: Don't re-execute instruction when not passing CR2 value Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 06/55] KVM: X86: Fix operand/address-size during instruction decoding Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 07/55] KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 09/55] KVM: x86: ioapic: Preserve read-only values in the redirection table Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 08/55] KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered Sasha Levin
2018-01-24  4:15 ` Sasha Levin [this message]
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 11/55] cpufreq: Add Loongson machine dependencies Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 12/55] bcache: check return value of register_shrinker Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 13/55] drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 14/55] drm/amdkfd: Fix SDMA ring buffer size calculation Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 16/55] openvswitch: fix the incorrect flow action alloc size Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 15/55] drm/amdkfd: Fix SDMA oversubsription handling Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 18/55] btrfs: fix deadlock when writing out space cache Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 17/55] mac80211: fix the update of path metric for RANN frame Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 19/55] reiserfs: remove unneeded i_version bump Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 20/55] KVM: X86: Fix softlockup when get the current kvmclock Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 21/55] KVM: VMX: Fix rflags cache during vCPU reset Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 22/55] xfs: always free inline data before resetting inode fork during ifree Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 23/55] xen-netfront: remove warning when unloading module Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 24/55] auxdisplay: img-ascii-lcd: Only build on archs that have IOMEM Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 25/55] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 26/55] nfsd: Ensure we don't recognise lock stateids after freeing them Sasha Levin
2018-01-24 15:47   ` J. Bruce Fields
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 27/55] nfsd: Ensure we check stateid validity in the seqid operation checks Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 28/55] grace: replace BUG_ON by WARN_ONCE in exit_net hook Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 29/55] nfsd: check for use of the closed special stateid Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 30/55] lockd: fix "list_add double add" caused by legacy signal interface Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 31/55] hwmon: (pmbus) Use 64bit math for DIRECT format values Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 32/55] bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()' Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 33/55] xfs: fortify xfs_alloc_buftarg error handling Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 34/55] drm/amdgpu: don't try to move pinned BOs Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 35/55] net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 36/55] quota: Check for register_shrinker() failure Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 37/55] SUNRPC: Allow connect to return EHOSTUNREACH Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 39/55] kmemleak: add scheduling point to kmemleak_scan() Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 38/55] fs/mbcache.c: make count_objects() more robust Sasha Levin
2018-01-24  4:29   ` Eric Biggers
2018-01-24 17:27     ` Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 40/55] drm/bridge: tc358767: do no fail on hi-res displays Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 41/55] drm/bridge: tc358767: filter out too high modes Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 42/55] drm/bridge: tc358767: fix DP0_MISC register set Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 43/55] drm/bridge: tc358767: fix timing calculations Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 44/55] drm/bridge: tc358767: fix AUXDATAn registers access Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 46/55] drm/omap: Fix error handling path in 'omap_dmm_probe()' Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 45/55] drm/bridge: tc358767: fix 1-lane behavior Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 48/55] xfs: Properly retry failed dquot items in case of error during buffer writeback Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 47/55] xfs: ubsan fixes Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 50/55] scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 49/55] scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 51/55] iwlwifi: mvm: fix the TX queue hang timeout for MONITOR vif type Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 52/55] ARM: dts: NSP: Fix PPI interrupt types Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 53/55] media: usbtv: add a new usbid Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 54/55] usb: gadget: don't dereference g until after it has been null checked Sasha Levin
2018-01-24  4:15 ` [PATCH AUTOSEL for 4.9 55/55] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124041521.32223-10-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).