-
Notifications
You must be signed in to change notification settings - Fork 6
[WIP] LoongArch: Add ACPI compatibility for ISA I/O space reservation #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: aosc/v6.18.4
Are you sure you want to change the base?
Conversation
|
Eww. This probably calls for a better (even DMI-specific) quirk... |
arch/loongarch/kernel/setup.c
Outdated
| pr_warn("Failed to allocate fwnode for legacy ISA\n"); | ||
| return 0; | ||
| } | ||
| if (add_legacy_isa_io(fwnode, LOONGSON_LIO_BASE, ISA_IOSIZE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this patch can be merged as-is.
Both 7A1000 and 7A2000 manuals state that 0x18000000-0x1800ffff (64K) is for "LPC I/O", but this patch reserves 0x18000000-0x18003fff (16K). The only reference I can find about this 16K range is the 2K1000 ISA controller which is obviously unrelated to any desktop platform. The macro name ("ISA_IOSIZE") also seems something for 2K1000 now.
We need some detailed analysis of the issue and maybe some research on the ACPI specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, a fast search for ISA_IOSIZE shows that this marco was introduced in initial commits for LoongArch support at torvalds@7153c3c
It didn't explain why this marco should be 16K rather than 64K. Additionally, ISA_IOSIZE is also used in loongnix's patch for this issue. I agree that this issue needs more analysis :)
6dc0f59 to
8a0c322
Compare
|
Add a DMI check for my tested board. This list can be extended in the futuer if more boards need this workaround. |
This patch adds essential compatibility support for ACPI-based systems running on older firmware. Many older computers with old firmware still rely on this mechanism and are unlikely to receive futher firmeware updates. This change ensures proper ISA I/O space reservation across for them. Use DMI to judge if the system needs patching. Signed-off-by: Yinan Qin <a.elysia@proton.me>
8a0c322 to
60d943c
Compare
|
If the issue isn't limited to BPI system (i.e. also reproducible with the correct UEFI boot process) we expect to make the quirk upstream. Then don't use I think adding it to arch/loongarch/pci/pci.c as a PCI quirk against some 7A1000/2000 device (which one??1) would be better. Taking twinhead_reserve_killing_zone() in arch/x86/pci/fixup.c as an example. Footnotes
|
Sure, here is the output for that (ssh)elysia@elysia-loong64-pc [ linux@aosc-6.17.7 ] ! lspci -vvv -s "00:17.0"
00:17.0 ISA bridge: Loongson Technology LLC 2K2000 / 7A1000/2000 Chipset LPC Controller (rev 01)
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 255
NUMA node: 0 |
|
P.S. Crash log using unpatched kernel is uploaded here panic.log |
This patch adds essential compatibility support for ACPI-based systems running on older firmware. Some older computers with Kunlun firmware still rely on this mechanism and are unlikely to receive futher firmeware updates. This change ensures proper ISA I/O space reservation across for them.