Re: [PATCH] x86/i8259: Work around buggy legacy PIC

From: Maximilian Luz
Date: Thu May 13 2021 - 06:12:01 EST


On 5/13/21 10:10 AM, David Laight wrote:
From: Maximilian Luz
Sent: 12 May 2021 22:05

The legacy PIC on the AMD variant of the Microsoft Surface Laptop 4 has
some problems on boot. For some reason it consistently does not respond
on the first try, requiring a couple more tries before it finally
responds.

That seems very strange, something else must be going on that causes the grief.
The 8259 will be built into to the one of the cpu support chips.
I can't imagine that requires anything special.

Right, it's definitely strange. Both Sachi (I imagine) and I don't know
much about these devices, so we're open for suggestions.

For reference: [1] and following comments are the discussion where we
(mostly Sachi) discovered the issue, tracking this from
platform_get_irq() returning -EINVAL to the PIC not probing. It also has
a dmesg log [2] attached, but as far as we can tell

[ 0.105820] Using NULL legacy PIC

is the only relevant line to that in there.

And lastly, if that's any help at all: The PIC device is described in
ACPI in [3]. The Surface Laptop 3 also has an AMD CPU (although a prior
generation) and has the PIC described in the exact same way (can also be
found in that repository), but doesn't exhibit that behavior (and
doesn't show the "Using NULL legacy PIC" line). I expect there's not
much you can change to that definition so that's probably irrelevant
here.

Again, I don't really know anything about these devices, so my guess
would be bad hardware revision or bad firmware revision. All I know is
that retrying seems to "fix" it.

It's not as though you have a real 8259 - which even a 286 can
break the inter-cycle recovery on (with the circuit from the
application note).

Right, I imagine that's some emulation for legacy reasons?

Regards,
Max

[1]: https://github.com/linux-surface/linux-surface/issues/425#issuecomment-831921098
[2]: https://github.com/linux-surface/linux-surface/files/6421166/dmesg-2021-05-04_22-11.txt
[3]: https://github.com/linux-surface/acpidumps/blob/69d5ecc1954ea5e90829b8e33541308e7451e951/surface_laptop_4_amd/dsdt.dsl#L1201-L1221