From: Bjorn Helgaas <helgaas@kernel.org>
To: wuqianhai@loongson.cn, Huacai Chen <chenhuacai@loongson.cn>,
Jianmin Lv <lvjianmin@loongson.cn>
Cc: tzimmermann@suse.de, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Chao Li <lichao@loongson.cn>,
Dongyan Qian <qiandongyan@loongson.cn>
Subject: Re: [PATCH] PCI/VGA: Fix boot device detection after framebuffer relocation
Date: Thu, 29 Oct 2026 15:03:56 -0500 [thread overview]
Message-ID: <20261029200356.GA655242@bhelgaas> (raw)
In-Reply-To: <20261029033914.978276-1-wuqianhai@loongson.cn>
[+ Loongson folks]
On Thu, Oct 29, 2026 at 11:39:14AM +0800, wuqianhai@loongson.cn wrote:
> Hi Bjorn,
>
> Thanks for the detailed analysis.
>
> You're right that screen_info_fixup_lfb()/screen_info_apply_fixups()
> stores a PCI bus address in screen_info_lfb_res_start and compares it
> with the CPU address in pdev->resource[].start, which is broken on
> systems where bus and CPU addresses differ.
>
> On LoongArch, though, bus and CPU addresses are identical: with modern
> firmware, acpi_prepare_root_resources() takes the PCIH path and leaves
> the window offset at 0 (see commit 49f33840dcc9).
This is a tangent from the framebuffer question, but what in the world
is 49f33840dcc9 ("LoongArch: Use per-root-bridge PCIH flag to skip mem
resource fixup") doing? I see that if "PCIH" is non-zero, it skips
some mem resource "fixup" that was added by 57fc7323a8e7 ("LoongArch:
Add PCI controller support").
But I don't understand why that fixup is there in the first place.
Evidently it takes the upper 24 bits of the MCFG address and ORs it
into window addresses from host bridge _CRS? That sounds nuts. It
sounds like the ACPI _CRS is just broken.
The struct resource_entry.offset is the offset between PCI bus
addresses and CPU addresses, so entry->offset being non-zero implies
they are NOT identical, at least on non-PCIH platforms. And if you
have to hack up the offset from the MCFG address, it sounds like the
_CRS entries are missing the _TRA that is supposed to provide the
offset.
next prev parent reply other threads:[~2026-10-29 20:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 9:46 wuqianhai
2026-10-28 23:15 ` Bjorn Helgaas
2026-10-29 3:39 ` wuqianhai
2026-10-29 20:03 ` Bjorn Helgaas [this message]
2026-10-29 7:54 ` Thomas Zimmermann
2026-10-29 3:34 ` [PATCH v2] PCI/VGA: Enable firmware default device detection on LoongArch wuqianhai
2026-10-29 8:10 ` Thomas Zimmermann
2026-10-29 7:00 ` [PATCH] PCI/VGA: Fix boot device detection after framebuffer relocation kernel test robot
2026-10-29 13:30 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029200356.GA655242@bhelgaas \
--to=helgaas@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=lichao@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lvjianmin@loongson.cn \
--cc=qiandongyan@loongson.cn \
--cc=tzimmermann@suse.de \
--cc=wuqianhai@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®