Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1704284

[PATCH 4.9 077/105] ACPI / scan: Prefer devices without _HID/_CID for _ADR matching

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.9 077/105] ACPI / scan: Prefer devices without _HID/_CID for _ADR matching
Date 2017-08-05 01:20 +0200
Message-ID <uaU2S-560-31@gated-at.bofh.it> (permalink)
References <uaU2R-560-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>


[ Upstream commit c2a6bbaf0c5f90463a7011a295bbdb7e33c80b51 ]

The way acpi_find_child_device() works currently is that, if there
are two (or more) devices with the same _ADR value in the same
namespace scope (which is not specifically allowed by the spec and
the OS behavior in that case is not defined), the first one of them
found to be present (with the help of _STA) will be returned.

This covers the majority of cases, but is not sufficient if some of
the devices in question have a _HID (or _CID) returning some valid
ACPI/PNP device IDs (which is disallowed by the spec) and the
ASL writers' expectation appears to be that the OS will match
devices without a valid ACPI/PNP device ID against a given bus
address first.

To cover this special case as well, modify find_child_checks()
to prefer devices without ACPI/PNP device IDs over devices that
have them.

Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/acpi/glue.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -98,7 +98,15 @@ static int find_child_checks(struct acpi
 	if (check_children && list_empty(&adev->children))
 		return -ENODEV;
 
-	return sta_present ? FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
+	/*
+	 * If the device has a _HID (or _CID) returning a valid ACPI/PNP
+	 * device ID, it is better to make it look less attractive here, so that
+	 * the other device with the same _ADR value (that may not have a valid
+	 * device ID) can be matched going forward.  [This means a second spec
+	 * violation in a row, so whatever we do here is best effort anyway.]
+	 */
+	return sta_present && list_empty(&adev->pnp.ids) ?
+			FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
 }
 
 struct acpi_device *acpi_find_child_device(struct acpi_device *parent,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.9 000/105] 4.9.41-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 104/105] ASoC: Intel: Skylake: Release FW ctx in cleanup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 047/105] r8169: add support for RTL8168 series add-on card. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 025/105] smp/hotplug: Replace BUG_ON and react useful Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 087/105] perf symbols: Robustify reading of build-id from sysfs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 054/105] ipv6: Should use consistent conditional judgement for ip6 fragment between __ip6_append_data and ip6_finish_output Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 030/105] isdn/i4l: fix buffer overflow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 105/105] ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 077/105] ACPI / scan: Prefer devices without _HID/_CID for _ADR matching Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 003/105] net: reduce skb_warn_bad_offload() noise Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 004/105] jfs: Dont clear SGID when inheriting ACLs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 085/105] xfrm: Dont use sk_family for socket policy lookups Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 002/105] pstore: Make spinlock per zone instead of global Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 040/105] [media] v4l: s5c73m3: fix negation operator Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:20 +0200
  [PATCH 4.9 082/105] Btrfs: adjust outstanding_extents counter properly when dio write is split Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 076/105] ARM: s3c2410_defconfig: Fix invalid values for NF_CT_PROTO_* Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 089/105] vfio-pci: Handle error from pci_iomap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 092/105] net: usb: asix_devices: add .reset_resume for USB PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 095/105] ARCv2: IRQ: Call entry/exit functions for chained handlers in MCIP Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 073/105] ARM64: zynqmp: Fix W=1 dtc 1.4 warnings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 078/105] usb: gadget: Fix copy/pasted error message Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 102/105] scsi: snic: Return error code on memory allocation failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 098/105] perf/x86: Set pmu->module in Intel PMU modules Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 103/105] scsi: bfa: Increase requested firmware version to 3.2.5.1 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 072/105] usb: dwc3: omap: fix race of pm runtime with irq handler in probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 091/105] nvmem: imx-ocotp: Fix wrong register size Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 083/105] Xen: ARM: Zero reserved fields of xatp before making hypervisor call Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 097/105] x86/platform/intel-mid: Rename spidev to mrfld_spidev Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 086/105] perf tools: Install tools/lib/traceevent plugins with install-bin Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 101/105] scsi: fnic: Avoid sending reset to firmware when another reset is in progress Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 079/105] Btrfs: use down_read_nested to make lockdep silent Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 075/105] perf probe: Fix to get correct modname from elf header Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 093/105] ASoC: fsl_ssi: set fifo watermark to more reliable value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 090/105] arm64: mm: fix show_pte KERN_CONT fallout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 099/105] ASoC: Intel: bytcr-rt5640: fix settings in internal clock mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 094/105] sh_eth: enable RX descriptor word 0 shift on SH7734 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 045/105] device-dax: fix sysfs duplicate warnings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 096/105] ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 084/105] tools lib traceevent: Fix prev/next_prio for deadline tasks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 088/105] video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 100/105] HID: ignore Petzl USB headlamp Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 01:30 +0200
  [PATCH 4.9 013/105] crypto: authencesn - Fix digest_null crash Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 059/105] drm/msm: Put back the vaddr in submit_reloc() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 053/105] net/mlx5: Disable RoCE on the e-switch management port under switchdev mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 060/105] drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 062/105] irqchip/keystone: Fix "scheduling while atomic" on rt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 066/105] irqchip/mxs: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 049/105] dt-bindings: power/supply: Update TPS65217 properties Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 065/105] ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 081/105] benet: stricter vxlan offloading check in be_features_check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 064/105] spi: dw: Make debugfs name unique between instances Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 058/105] drm/msm: Ensure that the hardware write pointer is valid Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 046/105] x86/mce/AMD: Make the init code more robust Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 057/105] net/mlx4_core: Fix raw qp flow steering rules under SRIOV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 007/105] parisc: Prevent TLB speculation on flushed pages on CPUs that only support equivalent aliases Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 051/105] ARM: dts: am57xx-idk: Put USB2 port in peripheral mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 044/105] net: skb_needs_check() accepts CHECKSUM_NONE for tx Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 061/105] vfio-pci: use 32-bit comparisons for register address for gcc-4.5 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 011/105] NFS: invalidate file size when taking a lock. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 070/105] l2tp: consider :: as wildcard address in l2tp_ip6 socket lookup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 071/105] dmaengine: ti-dma-crossbar: Add some of_node_put() in error path. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 080/105] Btrfs: fix lockdep warning about log_mutex Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 041/105] pstore: Allow prz to control need for locking Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 056/105] net/mlx4: Remove BUG_ON from ICM allocation routine Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 069/105] dmaengine: ioatdma: workaround SKX ioatdma version Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 042/105] pstore: Correctly initialize spinlock and flags Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 043/105] pstore: Use dynamic spinlock initializer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 063/105] ASoC: tlv320aic3x: Mark the RESET register as volatile Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 055/105] net/mlx4_core: Use-after-free causes a resource leak in flow-steering detach Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 067/105] openrisc: Add _text symbol to fix ksym build error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 050/105] dt-bindings: input: Specify the interrupt number of TPS65217 power button Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 048/105] ARM: omap2+: fixing wrong strcat for Non-NULL terminated string Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:10 +0200
  [PATCH 4.9 037/105] RDMA/uverbs: Fix the check for port number Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 009/105] parisc: Suspend lockup detectors before system halt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 017/105] drm/nouveau/disp/nv50-: bump max chans to 21 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 032/105] wil6210: fix deadlock when using fw_no_recovery option Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 024/105] smp/hotplug: Move unparking of percpu threads to the control CPU Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 035/105] mailbox: handle empty message in tx_tick Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 018/105] drm/nouveau/bar/gf100: fix access to upper half of BAR2 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 016/105] drm/vmwgfx: Fix gcc-7.1.1 warning Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 008/105] parisc: Extend disabled preemption in copy_user_page Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 039/105] dentry name snapshots Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 029/105] isdn: Fix a sleep-in-atomic bug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 020/105] KVM: PPC: Book3S HV: Save/restore host values of debug registers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 015/105] md/raid5: add thread_group worker async_tx_issue_pending_all Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 027/105] nfc: fdp: fix NULL pointer dereference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 014/105] KVM: PPC: Book3S HV: Enable TM before accessing TM registers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 001/105] af_key: Add lock to key dump Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 033/105] mailbox: always wait in mbox_send_message for blocking Tx mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 028/105] net: phy: Do not perform software reset for Generic PHY Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 019/105] KVM: PPC: Book3S HV: Restore critical SPRs to host values on guest exit Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 012/105] NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 026/105] nfc: Fix hangup of RC-S380* in port100_send_ack() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 036/105] sched/cgroup: Move sched_online_group() back into css_online() to fix crash Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 038/105] ipmi/watchdog: fix watchdog timeout set on reboot Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 022/105] Staging: comedi: comedi_fops: Avoid orphaned proc entry Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 010/105] powerpc/pseries: Fix of_node_put() underflow during reconfig remove Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 021/105] Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 034/105] mailbox: skip complete wait event if timer expired Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  [PATCH 4.9 031/105] ath10k: fix null deref on wmi-tlv when trying spectral scan Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 02:20 +0200
  Re: [PATCH 4.9 000/105] 4.9.41-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-05 04:00 +0200
    Re: [PATCH 4.9 000/105] 4.9.41-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 04:50 +0200
  Re: [PATCH 4.9 000/105] 4.9.41-stable review Randy Dunlap <rdunlap@infradead.org> - 2017-08-05 05:00 +0200
    Re: [PATCH 4.9 000/105] 4.9.41-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 05:10 +0200
  Re: [PATCH 4.9 000/105] 4.9.41-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-05 08:20 +0200
    Re: [PATCH 4.9 000/105] 4.9.41-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-05 16:50 +0200

csiph-web