]>
Commit | Line | Data |
---|---|---|
704fbcc2 GKH |
1 | From 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa Mon Sep 17 00:00:00 2001 |
2 | From: Hans de Goede <hdegoede@redhat.com> | |
3 | Date: Mon, 19 Nov 2018 19:06:01 +0100 | |
4 | Subject: ACPI / platform: Add SMB0001 HID to forbidden_id_list | |
5 | ||
6 | From: Hans de Goede <hdegoede@redhat.com> | |
7 | ||
8 | commit 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa upstream. | |
9 | ||
10 | Many HP AMD based laptops contain an SMB0001 device like this: | |
11 | ||
12 | Device (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 | ||
28 | The legacy style IRQ resource here causes acpi_dev_get_irqresource() to | |
29 | be called with legacy=true and this message to show in dmesg: | |
30 | ACPI: IRQ 7 override to edge, high | |
31 | ||
32 | This causes issues when later on the AMD0030 GPIO device gets enumerated: | |
33 | ||
34 | Device (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 | ||
56 | Now acpi_dev_get_irqresource() gets called with legacy=false, but because | |
57 | of the earlier override of the trigger-type acpi_register_gsi() returns | |
58 | -EBUSY (because we try to register the same interrupt with a different | |
59 | trigger-type) and we end up setting IORESOURCE_DISABLED in the flags. | |
60 | ||
61 | The setting of IORESOURCE_DISABLED causes platform_get_irq() to call | |
62 | acpi_irq_get() which is not implemented on x86 and returns -EINVAL. | |
63 | resulting in the following in dmesg: | |
64 | ||
65 | amd_gpio AMDI0030:00: Failed to get gpio IRQ: -22 | |
66 | amd_gpio: probe of AMDI0030:00 failed with error -22 | |
67 | ||
68 | The SMB0001 is a "virtual" device in the sense that the only way the OS | |
69 | interacts with it is through calling a couple of methods to do SMBus | |
70 | transfers. As such it is weird that it has IO and IRQ resources at all, | |
71 | because the driver for it is not expected to ever access the hardware | |
72 | directly. | |
73 | ||
74 | The Linux driver for the SMB0001 device directly binds to the acpi_device | |
75 | through the acpi_bus, so we do not need to instantiate a platform_device | |
76 | for this ACPI device. This commit adds the SMB0001 HID to the | |
77 | forbidden_id_list, avoiding the instantiating of a platform_device for it. | |
78 | Not instantiating a platform_device means we will no longer call | |
79 | acpi_dev_get_irqresource() for the legacy IRQ resource fixing the probe of | |
80 | the AMDI0030 device failing. | |
81 | ||
82 | BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1644013 | |
83 | BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198715 | |
84 | BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199523 | |
85 | Reported-by: Lukas Kahnert <openproggerfreak@gmail.com> | |
86 | Tested-by: Marc <suaefar@googlemail.com> | |
87 | Cc: All applicable <stable@vger.kernel.org> | |
88 | Signed-off-by: Hans de Goede <hdegoede@redhat.com> | |
89 | Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | |
90 | Signed-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 |