]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.165/acpi-platform-add-smb0001-hid-to-forbidden_id_list.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.165 / acpi-platform-add-smb0001-hid-to-forbidden_id_list.patch
CommitLineData
704fbcc2
GKH
1From 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa Mon Sep 17 00:00:00 2001
2From: Hans de Goede <hdegoede@redhat.com>
3Date: Mon, 19 Nov 2018 19:06:01 +0100
4Subject: ACPI / platform: Add SMB0001 HID to forbidden_id_list
5
6From: Hans de Goede <hdegoede@redhat.com>
7
8commit 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa upstream.
9
10Many HP AMD based laptops contain an SMB0001 device like this:
11
12Device (SMBD)
13{
14 Name (_HID, "SMB0001") // _HID: Hardware ID
15 Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
16 {
17 IO (Decode16,
18 0x0B20, // Range Minimum
19 0x0B20, // Range Maximum
20 0x20, // Alignment
21 0x20, // Length
22 )
23 IRQ (Level, ActiveLow, Shared, )
24 {7}
25 })
26}
27
28The legacy style IRQ resource here causes acpi_dev_get_irqresource() to
29be called with legacy=true and this message to show in dmesg:
30ACPI: IRQ 7 override to edge, high
31
32This causes issues when later on the AMD0030 GPIO device gets enumerated:
33
34Device (GPIO)
35{
36 Name (_HID, "AMDI0030") // _HID: Hardware ID
37 Name (_CID, "AMDI0030") // _CID: Compatible ID
38 Name (_UID, Zero) // _UID: Unique ID
39 Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
40 {
41 Name (RBUF, ResourceTemplate ()
42 {
43 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
44 {
45 0x00000007,
46 }
47 Memory32Fixed (ReadWrite,
48 0xFED81500, // Address Base
49 0x00000400, // Address Length
50 )
51 })
52 Return (RBUF) /* \_SB_.GPIO._CRS.RBUF */
53 }
54}
55
56Now acpi_dev_get_irqresource() gets called with legacy=false, but because
57of the earlier override of the trigger-type acpi_register_gsi() returns
58-EBUSY (because we try to register the same interrupt with a different
59trigger-type) and we end up setting IORESOURCE_DISABLED in the flags.
60
61The setting of IORESOURCE_DISABLED causes platform_get_irq() to call
62acpi_irq_get() which is not implemented on x86 and returns -EINVAL.
63resulting in the following in dmesg:
64
65amd_gpio AMDI0030:00: Failed to get gpio IRQ: -22
66amd_gpio: probe of AMDI0030:00 failed with error -22
67
68The SMB0001 is a "virtual" device in the sense that the only way the OS
69interacts with it is through calling a couple of methods to do SMBus
70transfers. As such it is weird that it has IO and IRQ resources at all,
71because the driver for it is not expected to ever access the hardware
72directly.
73
74The Linux driver for the SMB0001 device directly binds to the acpi_device
75through the acpi_bus, so we do not need to instantiate a platform_device
76for this ACPI device. This commit adds the SMB0001 HID to the
77forbidden_id_list, avoiding the instantiating of a platform_device for it.
78Not instantiating a platform_device means we will no longer call
79acpi_dev_get_irqresource() for the legacy IRQ resource fixing the probe of
80the AMDI0030 device failing.
81
82BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1644013
83BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198715
84BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199523
85Reported-by: Lukas Kahnert <openproggerfreak@gmail.com>
86Tested-by: Marc <suaefar@googlemail.com>
87Cc: All applicable <stable@vger.kernel.org>
88Signed-off-by: Hans de Goede <hdegoede@redhat.com>
89Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
90Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
91
92---
93 drivers/acpi/acpi_platform.c | 1 +
94 1 file changed, 1 insertion(+)
95
96--- a/drivers/acpi/acpi_platform.c
97+++ b/drivers/acpi/acpi_platform.c
98@@ -29,6 +29,7 @@ static const struct acpi_device_id forbi
99 {"PNP0200", 0}, /* AT DMA Controller */
100 {"ACPI0009", 0}, /* IOxAPIC */
101 {"ACPI000A", 0}, /* IOAPIC */
102+ {"SMB0001", 0}, /* ACPI SMBUS virtual device */
103 {"", 0},
104 };
105