From: Bjorn Helgaas <helgaas@kernel.org>
To: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: Pan Xinhui <Xinhui.Pan@amd.com>,
kvm@vger.kernel.org, nouveau@lists.freedesktop.org,
dri-devel@lists.freedesktop.org,
YiPeng Chai <YiPeng.Chai@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
David Airlie <airlied@gmail.com>, Yi Liu <yi.l.liu@intel.com>,
Karol Herbst <kherbst@redhat.com>,
amd-gfx@lists.freedesktop.org, Sui Jingfeng <15330273260@189.cn>,
Jason Gunthorpe <jgg@ziepe.ca>, Ben Skeggs <bskeggs@redhat.com>,
linux-pci@vger.kernel.org,
Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
Kevin Tian <kevin.tian@intel.com>,
Lijo Lazar <lijo.lazar@amd.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Bokun Zhang <Bokun.Zhang@amd.com>,
intel-gfx@lists.freedesktop.org,
Maxime Ripard <mripard@kernel.org>,
loongson-kernel@lists.loongnix.cn,
Abhishek Sahu <abhsahu@nvidia.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Yishai Hadas <yishaih@nvidia.com>, Li Yi <liyi@loongson.cn>,
Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>,
linux-kernel@vger.kernel.org, Daniel Vetter <daniel@ffwll.ch>,
Cornelia Huck <cohuck@redhat.com>,
Alex Deucher <alexander.deucher@amd.com>,
Christian Konig <christian.koenig@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [Intel-gfx] [PATCH v3 4/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register
Date: Fri, 9 Jun 2023 11:48:50 -0500 [thread overview]
Message-ID: <20230609164850.GA1251187@bhelgaas> (raw)
In-Reply-To: <0d2ba099-9817-13be-c85b-997211443119@loongson.cn>
On Fri, Jun 09, 2023 at 10:27:39AM +0800, Sui Jingfeng wrote:
> On 2023/6/9 03:19, Bjorn Helgaas wrote:
> > On Thu, Jun 08, 2023 at 07:43:22PM +0800, Sui Jingfeng wrote:
> > > From: Sui Jingfeng <suijingfeng@loongson.cn>
> > >
> > > The vga_is_firmware_default() function is arch-dependent, which doesn't
> > > sound right. At least, it also works on the Mips and LoongArch platforms.
> > > Tested with the drm/amdgpu and drm/radeon drivers. However, it's difficult
> > > to enumerate all arch-driver combinations. I'm wrong if there is only one
> > > exception.
> > >
> > > With the observation that device drivers typically have better knowledge
> > > about which PCI bar contains the firmware framebuffer, which could avoid
> > > the need to iterate all of the PCI BARs.
> > >
> > > But as a PCI function at pci/vgaarb.c, vga_is_firmware_default() is
> > > probably not suitable to make such an optimization for a specific device.
> > >
> > > There are PCI display controllers that don't have a dedicated VRAM bar,
> > > this function will lose its effectiveness in such a case. Luckily, the
> > > device driver can provide an accurate workaround.
> > >
> > > Therefore, this patch introduces a callback that allows the device driver
> > > to tell the VGAARB if the device is the default boot device. This patch
> > > only intends to introduce the mechanism, while the implementation is left
> > > to the device driver authors. Also honor the comment: "Clients have two
> > > callback mechanisms they can use"
> > s/bar/BAR/ (several)
> >
> > Nothing here uses the callback. I don't want to merge this until we
> > have a user.
>
> This is chicken and egg question.
>
> If you could help get this merge first, I will show you the first user.
>
> > I'm not sure why the device driver should know whether its device is
> > the default boot device.
>
> It's not that the device driver should know,
>
> but it's about that the device driver has the right to override.
>
> Device driver may have better approach to identify the default boot
> device.
The way we usually handle this is to include the new callback in the
same series as the first user of it. That has two benefits:
(1) everybody can review the whole picture and possibly suggest
different approaches, and (2) when we merge the infrastructure,
we also merge a user of it at the same time, so the whole thing can be
tested and we don't end up with unused code.
Bjorn
next prev parent reply other threads:[~2023-06-09 16:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 11:43 [Intel-gfx] [PATCH v3 0/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-08 11:43 ` [Intel-gfx] [PATCH v3 1/4] PCI/VGA: tidy up the code and comment format Sui Jingfeng
2023-06-08 19:07 ` Bjorn Helgaas
2023-06-09 1:54 ` Sui Jingfeng
2023-06-08 11:43 ` [Intel-gfx] [PATCH v3 2/4] PCI/VGA: Use unsigned type for the io_state variable Sui Jingfeng
2023-06-08 11:43 ` [Intel-gfx] [PATCH v3 3/4] PCI/VGA: only deal with VGA class devices Sui Jingfeng
2023-06-08 19:12 ` Bjorn Helgaas
2023-06-09 2:11 ` Sui Jingfeng
2023-06-09 12:22 ` Sui Jingfeng
2023-06-08 11:43 ` [Intel-gfx] [PATCH v3 4/4] PCI/VGA: introduce is_boot_device function callback to vga_client_register Sui Jingfeng
2023-06-08 19:19 ` Bjorn Helgaas
2023-06-09 2:27 ` Sui Jingfeng
2023-06-09 16:48 ` Bjorn Helgaas [this message]
2023-06-09 17:43 ` Sui Jingfeng
2023-06-08 15:57 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
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=20230609164850.GA1251187@bhelgaas \
--to=helgaas@kernel.org \
--cc=15330273260@189.cn \
--cc=Amaranath.Somalapuram@amd.com \
--cc=Bokun.Zhang@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=abhsahu@nvidia.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrey.grodzovsky@amd.com \
--cc=bhelgaas@google.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=cohuck@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kherbst@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liyi@loongson.cn \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=mario.limonciello@amd.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=suijingfeng@loongson.cn \
--cc=tzimmermann@suse.de \
--cc=yi.l.liu@intel.com \
--cc=yishaih@nvidia.com \
/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