Re: [PATCH] vgaarb: Rework default VGA device selection

2021-07-20 Thread Bjorn Helgaas
cannot handle the > cases that a VGA card is hot-plugged, or the gpu driver is compiled as a > module. > > So, as suggested by Bjorn Helgaas, this patch rework the selection: > 1, Remove direct vga_arb_select_default_device() calls in vga_arb_ >device_init(). > 2, Rename vg

[PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-07-22 Thread Bjorn Helgaas
From: Bjorn Helgaas This is a little bit of rework and extension of Huacai's nice work at [1]. It moves the VGA arbiter to the PCI subsystem, fixes a few nits, and breaks a few pieces off Huacai's patch to make the main patch a little smaller. That last patch is still not very sma

[PATCH v2 1/9] PCI/VGA: Move vgaarb to drivers/pci

2021-07-22 Thread Bjorn Helgaas
From: Bjorn Helgaas The VGA arbiter is really PCI-specific and doesn't depend on any GPU things. Move it to the PCI subsystem. Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/Kconfig | 19 --- drivers/gpu/vga/Makefile | 1 - drivers/pci/Kc

[PATCH v2 2/9] PCI/VGA: Replace full MIT license text with SPDX identifier

2021-07-22 Thread Bjorn Helgaas
From: Bjorn Helgaas Per Documentation/process/license-rules.rst, the SPDX MIT identifier is equivalent to including the entire MIT license text from LICENSES/preferred/MIT. Replace the MIT license text with the equivalent SPDX identifier. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c

[PATCH v2 3/9] PCI/VGA: Use unsigned format string to print lock counts

2021-07-22 Thread Bjorn Helgaas
From: Bjorn Helgaas In struct vga_device, io_lock_cnt and mem_lock_cnt are unsigned, but we previously printed them with "%d", the signed decimal format. Print them with the unsigned format "%u" instead. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 2 +

[PATCH v2 5/9] PCI/VGA: Move vga_arb_integrated_gpu() earlier in file

2021-07-22 Thread Bjorn Helgaas
From: Huacai Chen Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: split to separate patch] Link: https://lore.kernel.org/r/20210705100503.1120643-1-chenhua...@loongson.cn Signed-off-by: Huacai Chen Signed-off-by: Bjorn

[PATCH v2 4/9] PCI/VGA: Remove empty vga_arb_device_card_gone()

2021-07-22 Thread Bjorn Helgaas
From: Bjorn Helgaas vga_arb_device_card_gone() has always been empty. Remove it. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index e4153ab70481

[PATCH v2 7/9] PCI/VGA: Split out vga_arb_update_default_device()

2021-07-22 Thread Bjorn Helgaas
ce to separate patch] Link: https://lore.kernel.org/r/20210705100503.1120643-1-chenhua...@loongson.cn Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/pci/vgaarb.c b/dr

[PATCH v2 9/9] PCI/VGA: Rework default VGA device selection

2021-07-22 Thread Bjorn Helgaas
From: Huacai Chen Needs a better subject and a commit log. Link: https://lore.kernel.org/r/20210705100503.1120643-1-chenhua...@loongson.cn --- drivers/pci/vgaarb.c | 158 ++- 1 file changed, 66 insertions(+), 92 deletions(-) diff --git a/drivers/pci/vgaa

[PATCH v2 8/9] PCI/VGA: Log bridge control messages when adding devices

2021-07-22 Thread Bjorn Helgaas
://lore.kernel.org/r/20210705100503.1120643-1-chenhua...@loongson.cn Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index

[PATCH v2 6/9] PCI/VGA: Prefer vga_default_device()

2021-07-22 Thread Bjorn Helgaas
Chen Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 1f8fb37be5fa..a6a5864ff538 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -173,7 +173,7 @@ int

Re: [PATCH v2 1/9] PCI/VGA: Move vgaarb to drivers/pci

2021-07-22 Thread Bjorn Helgaas
On Thu, Jul 22, 2021 at 02:38:43PM -0700, Randy Dunlap wrote: > On 7/22/21 2:29 PM, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > The VGA arbiter is really PCI-specific and doesn't depend on any GPU > > things. Move it to the PCI subsystem. >

Re: [PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-07-23 Thread Bjorn Helgaas
On Fri, Jul 23, 2021 at 10:27:08AM +0200, Daniel Vetter wrote: > On Fri, Jul 23, 2021 at 06:51:59AM +0100, Christoph Hellwig wrote: > > On Thu, Jul 22, 2021 at 04:29:11PM -0500, Bjorn Helgaas wrote: > > > From: Bjorn Helgaas > > > > > > This is a little bit

Re: [PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-07-23 Thread Bjorn Helgaas
On Fri, Jul 23, 2021 at 05:53:36PM +0800, Huacai Chen wrote: > Hi, Bjorn, > > On Fri, Jul 23, 2021 at 5:29 AM Bjorn Helgaas wrote: > > > > From: Bjorn Helgaas > > > > This is a little bit of rework and extension of Huacai's nice work at [1]. > > >

Re: [PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-08-03 Thread Bjorn Helgaas
On Sat, Jul 24, 2021 at 05:30:02PM +0800, Huacai Chen wrote: > Hi, Bjorn, > > On Sat, Jul 24, 2021 at 8:10 AM Bjorn Helgaas wrote: > > > > On Fri, Jul 23, 2021 at 05:53:36PM +0800, Huacai Chen wrote: > > > Hi, Bjorn, > > > > > > On F

Re: [PATCH v5 08/27] PCI: add support for dev_groups to struct pci_device_driver

2021-04-28 Thread Bjorn Helgaas
In subject: s/PCI: add support/PCI: Add support/ to match convention ("git log --oneline drivers/pci/pci-driver.c" to learn this). On Wed, Apr 28, 2021 at 11:11:48AM -0400, Andrey Grodzovsky wrote: > This is exact copy of 'USB: add support for dev_groups to > struct usb_device_driver' patch by G

Re: [PATCH v5 00/27] RFC Support hot device unplug in amdgpu

2021-04-28 Thread Bjorn Helgaas
On Wed, Apr 28, 2021 at 11:11:40AM -0400, Andrey Grodzovsky wrote: > Until now extracting a card either by physical extraction (e.g. eGPU with > thunderbolt connection or by emulation through syfs -> > /sys/bus/pci/devices/device_id/remove) > would cause random crashes in user apps. The random

Re: [PATCH v5 09/27] dmr/amdgpu: Move some sysfs attrs creation to default_attr

2021-04-28 Thread Bjorn Helgaas
In subject, s/dmr/drm/ s/Move some/Move/ ("some" consumes space without adding meaning) Or maybe something like: drm/amdgpu: Convert driver sysfs attributes to static attributes On Wed, Apr 28, 2021 at 11:11:49AM -0400, Andrey Grodzovsky wrote: > This allows to remove explicit creation and d

Re: [PATCH v5 08/27] PCI: add support for dev_groups to struct pci_device_driver

2021-04-29 Thread Bjorn Helgaas
On Thu, Apr 29, 2021 at 12:53:15PM -0400, Andrey Grodzovsky wrote: > On 2021-04-28 12:53 p.m., Bjorn Helgaas wrote: > > On Wed, Apr 28, 2021 at 11:11:48AM -0400, Andrey Grodzovsky wrote: > > > This is exact copy of 'USB: add support for dev_groups to > > > struct

Re: [PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-08-09 Thread Bjorn Helgaas
On Tue, Aug 03, 2021 at 12:06:44PM -0500, Bjorn Helgaas wrote: > On Sat, Jul 24, 2021 at 05:30:02PM +0800, Huacai Chen wrote: > > Hi, Bjorn, > > > > On Sat, Jul 24, 2021 at 8:10 AM Bjorn Helgaas wrote: > > > > > > On Fri, Jul 23, 2021 at 05:53:36PM +080

Re: [PATCH v2 0/9] PCI/VGA: Rework default VGA device selection

2021-08-19 Thread Bjorn Helgaas
On Mon, Aug 09, 2021 at 01:59:01PM -0500, Bjorn Helgaas wrote: > On Tue, Aug 03, 2021 at 12:06:44PM -0500, Bjorn Helgaas wrote: > > On Sat, Jul 24, 2021 at 05:30:02PM +0800, Huacai Chen wrote: > > > On Sat, Jul 24, 2021 at 8:10 AM Bjorn Helgaas wrote: > > > >

Re: [PATCH V3 0/9] PCI/VGA: Rework default VGA device selection

2021-08-25 Thread Bjorn Helgaas
V3 rewrite the commit log of the last patch (which is also summarized > by Bjorn). > > All comments welcome! > > [1] > https://lore.kernel.org/dri-devel/20210705100503.1120643-1-chenhua...@loongson.cn/ > > Bjorn Helgaas (4): > PCI/VGA: Move vgaarb to drivers/pci >

Re: [PATCH 2/2] PCI: Revoke mappings like devmem

2021-03-13 Thread Bjorn Helgaas
the single > architecture hand-rolling. Both approach support ioport mmap through a > special pfn range and not through magic pte attributes. Aliasing is > therefore not a problem. > > The only difference in access checks left is that sysfs PCI mmap does > not check for CAP_RAWIO.

Re: [Bug 211189] New: vgaarb overrides boot device unexpectedly with Intel and discrete AMDGPU

2021-01-14 Thread Bjorn Helgaas
[cc'd efifb and vgaarb maintainers on bugzilla, but not sure whether people pay attention to that] On Thu, Jan 14, 2021 at 10:42:53AM +, bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=211189 > > Bug ID: 211189 >Summary: vgaarb

Re: [PATCH 1/2] PCI: also set up legacy files only after sysfs init

2021-02-04 Thread Bjorn Helgaas
gt; Cc: John Hubbard > Cc: Jérôme Glisse > Cc: Jan Kara > Cc: Dan Williams > Cc: Greg Kroah-Hartman > Cc: linux...@kvack.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-samsung-...@vger.kernel.org > Cc: linux-me...@vger.kernel.org > Cc: Bjorn Helgaas > Cc

Re: [PATCH] PCI: Also set up legacy files only after sysfs init

2021-02-10 Thread Bjorn Helgaas
ially. > > v2: Improve commit message (Bjorn) > > Signed-off-by: Daniel Vetter Acked-by: Bjorn Helgaas I wish we weren't extending a known-racy mechanism to do this, but at least we're not *adding* a brand new race. > Cc: Stephen Rothwell > Cc: Jason Gunthorpe >

Re: [PATCH 2/2] PCI: Revoke mappings like devmem

2021-02-10 Thread Bjorn Helgaas
o/ s/pci mmap/PCI mmap/ s/Both approach/Both approaches/ s/pfn/PFN/ s/pte/PTE/ > The only difference in access checks left is that sysfs PCI mmap does > not check for CAP_RAWIO. I'm not really sure whether that should be > added or not. > > Acked-by: Bjorn Helgaas > Re

Re: [PATCH v6 08/16] PCI: Add support for dev_groups to struct pci_device_driver

2021-05-10 Thread Bjorn Helgaas
283e3d6d ("USB: add support for dev_groups to > struct usb_driver") > > Signed-off-by: Andrey Grodzovsky > Suggested-by: Greg Kroah-Hartman With the subject change above, Acked-by: Bjorn Helgaas > --- > drivers/pci/pci-driver.c | 1 + > include/linux/p

Re: [PATCH] vgaarb: Rework default VGA device selection

2021-07-07 Thread Bjorn Helgaas
as drawbacks, it cannot handle the > cases that a VGA card is hot-plugged, or the gpu driver is compiled as a > module. > > So, as suggested by Bjorn Helgaas, this patch rework the selection: > 1, Remove direct vga_arb_select_default_device() calls in vga_arb_ >device_init(). > 2,

Re: [PATCH v5 11/15] PCI: Obey iomem restrictions for procfs mmap

2020-11-03 Thread Bjorn Helgaas
us_allocate_mmio() calls request_mem_region_exclusive() which raises the question of whether it's worth keeping IORESOURCE_EXCLUSIVE at all. I'm totally fine with removing it completely. But if you want it, Acked-by: Bjorn Helgaas > Cc: Jason Gunthorpe > Cc: Kees Cook >

Re: [PATCH v5 15/15] PCI: Revoke mappings like devmem

2020-11-03 Thread Bjorn Helgaas
rpe > Cc: Kees Cook > Cc: Dan Williams > Cc: Andrew Morton > Cc: John Hubbard > Cc: Jérôme Glisse > Cc: Jan Kara > Cc: Dan Williams > Cc: Greg Kroah-Hartman > Cc: linux...@kvack.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-samsung-...@vger.kernel.org >

Re: [PATCH v5 11/15] PCI: Obey iomem restrictions for procfs mmap

2020-11-04 Thread Bjorn Helgaas
On Wed, Nov 04, 2020 at 09:44:04AM +0100, Daniel Vetter wrote: > On Tue, Nov 3, 2020 at 11:09 PM Dan Williams wrote: > > On Tue, Nov 3, 2020 at 1:28 PM Bjorn Helgaas wrote: > > > On Fri, Oct 30, 2020 at 11:08:11AM +0100, Daniel Vetter wrote: > > > > There's

Re: [PATCH v9 00/11] vgaarb: Rework default VGA device selection

2022-03-09 Thread Bjorn Helgaas
On Fri, Feb 25, 2022 at 04:15:23PM -0600, Bjorn Helgaas wrote: > On Thu, Feb 24, 2022 at 04:47:42PM -0600, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > Current default VGA device selection fails in some cases because part of it > > is done in the vga_arb_de

RX 5500 XT: PCIe link speed stuck at Gen1 2.5GT/s by default

2022-03-30 Thread Bjorn Helgaas
See https://gitlab.freedesktop.org/drm/amd/-/issues/1447 This report was against DRM, but I'm mentioning it here because we've been talking about some link speed init issues lately, and AFAICT the gitlab reports don't show up anywhere in lore. Robert Hancock reported: > I'm using a RX 5500 XT ca

[PATCH v9 00/11] vgaarb: Rework default VGA device selection

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas Current default VGA device selection fails in some cases because part of it is done in the vga_arb_device_init() subsys_initcall, and some arches enumerate PCI devices in pcibios_init(), which runs *after* that. The big change from the v8 posting is that this moves vgaarb.c

[PATCH v9 01/11] PCI/VGA: Move vgaarb to drivers/pci

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas The VGA arbiter is really PCI-specific and doesn't depend on any GPU things. Move it to the PCI subsystem. Note that misc_init() must be called before vga_arb_device_init(). These are both subsys_initcalls, so this ordering depends on the link order, which is determin

[PATCH v9 03/11] PCI/VGA: Factor out vga_select_framebuffer_device()

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas On x86 and ia64, if a VGA device BARs include a framebuffer reported by platform firmware, we select the device as the default VGA device. Factor this code to a separate function. No functional change intended. Signed-off-by: Bjorn Helgaas Cc: Bruno Prémont --- drivers

[PATCH v9 06/11] PCI/VGA: Move non-legacy VGA detection to ADD_DEVICE path

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so it could select a non-legacy VGA device as the default. That failed to consider that PCI devices may be enumerated after vga_arb_device_init(

[PATCH v9 05/11] PCI/VGA: Move firmware default device detection to ADD_DEVICE path

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen Previously we selected the firmware default device, i.e., one that owns the boot framebuffer, as the default device in vga_arb_select_default_device(). This was only done in the vga_arb_device_init() subsys_initcall, so devices enumerated later, e.g., by pcibios_init(), were not

[PATCH v9 04/11] PCI/VGA: Factor out default VGA device selection

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen Default VGA device selection fails when PCI devices are enumerated after the vga_arb_device_init() subsys_initcall. vga_arbiter_add_pci_device() selects the first fully enabled device to which legacy VGA resources are routed as the default VGA device. This is an ADD_DEVICE not

[PATCH v9 07/11] PCI/VGA: Move disabled VGA device detection to ADD_DEVICE path

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so that if there are no other eligible devices, it could select a disabled VGA device as the default. Move this detection from vga_arb_select_de

[PATCH v9 08/11] PCI/VGA: Remove empty vga_arb_device_card_gone()

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas vga_arb_device_card_gone() has always been empty. Remove it. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index e8d5efd85ba6

[PATCH v9 09/11] PCI/VGA: Log bridge control messages when adding devices

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen Previously vga_arb_device_init() iterated through all VGA devices and indicated whether legacy VGA routing to each could be controlled by an upstream bridge. But we determine that information in vga_arbiter_add_pci_device(), which we call for every device, so we can log it ther

[PATCH v9 02/11] PCI/VGA: Move vga_arb_integrated_gpu() earlier in file

2022-02-24 Thread Bjorn Helgaas
From: Huacai Chen Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: pull #ifdefs inside function] Link: https://lore.kernel.org/r/20211015061512.2941859-3-chenhua...@loongson.cn Signed-off-by: Huacai Chen --- drivers/pci/vgaarb

[PATCH v9 11/11] PCI/VGA: Replace full MIT license text with SPDX identifier

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas Per Documentation/process/license-rules.rst, the SPDX MIT identifier is equivalent to including the entire MIT license text from LICENSES/preferred/MIT. Replace the MIT license text with the equivalent SPDX identifier. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c

[PATCH v9 10/11] PCI/VGA: Use unsigned format string to print lock counts

2022-02-24 Thread Bjorn Helgaas
From: Bjorn Helgaas In struct vga_device, io_lock_cnt and mem_lock_cnt are unsigned, but we previously printed them with "%d", the signed decimal format. Print them with the unsigned format "%u" instead. Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 2 +

Re: [PATCH v5 3/7] PCI: Drop the `is_thunderbolt` attribute from PCI core

2022-02-24 Thread Bjorn Helgaas
On Thu, Feb 24, 2022 at 03:51:12PM -0600, Mario Limonciello wrote: > The `is_thunderbolt` attribute originally had a well defined list of > quirks that it existed for, but it has been overloaded with more > meaning. > > Instead use the driver core removable attribute to indicate the > detail a dev

Re: [PATCH v5 3/7] PCI: Drop the `is_thunderbolt` attribute from PCI core

2022-02-24 Thread Bjorn Helgaas
On Thu, Feb 24, 2022 at 07:23:49PM -0600, Bjorn Helgaas wrote: > On Thu, Feb 24, 2022 at 03:51:12PM -0600, Mario Limonciello wrote: > > The `is_thunderbolt` attribute originally had a well defined list of > > quirks that it existed for, but it has been overloaded with m

Re: [PATCH v5 3/7] PCI: Drop the `is_thunderbolt` attribute from PCI core

2022-02-25 Thread Bjorn Helgaas
On Thu, Feb 24, 2022 at 03:51:12PM -0600, Mario Limonciello wrote: > The `is_thunderbolt` attribute originally had a well defined list of > quirks that it existed for, but it has been overloaded with more > meaning. > > Instead use the driver core removable attribute to indicate the > detail a dev

Re: [PATCH v9 00/11] vgaarb: Rework default VGA device selection

2022-02-25 Thread Bjorn Helgaas
On Thu, Feb 24, 2022 at 04:47:42PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > Current default VGA device selection fails in some cases because part of it > is done in the vga_arb_device_init() subsys_initcall, and some arches > enumerate PCI devices in pcibios_ini

Re: [PATCH] docs: fix 'make htmldocs' error in vgaarbiter.rst

2022-02-28 Thread Bjorn Helgaas
On Mon, Feb 28, 2022 at 10:30:02AM +0800, Wan Jiabing wrote: > Fix following 'make htmldocs' error: > Error: Cannot open file ./drivers/gpu/vga/vgaarb.c > Error: Cannot open file ./drivers/gpu/vga/vgaarb.c > WARNING: kernel-doc './scripts/kernel-doc -rst -enable-lineno -sphinx-version > 2.4.4 -expo

Re: [PATCH v5 3/7] PCI: Drop the `is_thunderbolt` attribute from PCI core

2022-02-28 Thread Bjorn Helgaas
On Mon, Feb 28, 2022 at 03:33:13PM +, Limonciello, Mario wrote: > [AMD Official Use Only] > > > > > On Fri, Feb 25, 2022 at 11:42:24AM -0600, Bjorn Helgaas wrote: > > > That would just leave the "PCI_VSEC_ID_INTEL_TBT implies external- > > facing&

Re: [PATCH] vgaarbiter: fix vgaarbiter doc build break

2022-03-01 Thread Bjorn Helgaas
On Tue, Mar 01, 2022 at 11:29:09AM -0800, t...@redhat.com wrote: > From: Tom Rix > > make htmldocs fails with > Error: Cannot open file ./drivers/gpu/vga/vgaarb.c > > The location of the file changed > drivers/gpu/vga/vgaarb.c -> drivers/pci/vgaarb.c > So update the docs with the new location. >

Re: [PATCH V4 00/10] PCI/VGA: Rework default VGA device selection

2021-09-09 Thread Bjorn Helgaas
ore.kernel.org/dri-devel/20210705100503.1120643-1-chenhua...@loongson.cn/ > > Bjorn Helgaas (4): > PCI/VGA: Move vgaarb to drivers/pci > PCI/VGA: Replace full MIT license text with SPDX identifier > PCI/VGA: Use unsigned format string to print lock counts > PCI/VGA: Remo

Re: [PATCH V5 00/11] PCI/VGA: Rework default VGA device selection

2021-09-14 Thread Bjorn Helgaas
date_default_device() that actually fixes your problem. That doesn't seem to be what we have here. > All comments welcome! > > [1] > https://lore.kernel.org/dri-devel/20210705100503.1120643-1-chenhua...@loongson.cn/ > > Bjorn Helgaas (4): > PCI/VGA: Move vgaarb to drivers/pci

Re: [PATCH] vgaarb: Use ACPI HID name to find integrated GPU

2021-09-16 Thread Bjorn Helgaas
[+cc Huacai, linux-pci] On Wed, May 19, 2021 at 09:57:23PM +0800, Kai-Heng Feng wrote: > Commit 3d42f1ddc47a ("vgaarb: Keep adding VGA device in queue") assumes > the first device is an integrated GPU. However, on AMD platforms an > integrated GPU can have higher PCI device number than a discrete

Re: [PATCH] vgaarb: Use ACPI HID name to find integrated GPU

2021-09-17 Thread Bjorn Helgaas
On Fri, Sep 17, 2021 at 11:49:45AM +0800, Kai-Heng Feng wrote: > On Fri, Sep 17, 2021 at 12:38 AM Bjorn Helgaas wrote: > > > > [+cc Huacai, linux-pci] > > > > On Wed, May 19, 2021 at 09:57:23PM +0800, Kai-Heng Feng wrote: > > > Commit 3d42f1ddc47a (&quo

Re: [PATCH v8 04/10] vgaarb: Move framebuffer detection to ADD_DEVICE path

2022-01-25 Thread Bjorn Helgaas
/linux-pci/caahv-h7fhajm-ha42z1dlre4pvc9frfyeu27khwcywkkmft...@mail.gmail.com/ > On Fri, Jan 7, 2022 at 12:21 AM Bjorn Helgaas wrote: > > > > On Thu, Jan 06, 2022 at 02:44:42PM +0800, Huacai Chen wrote: > > > On Thu, Jan 6, 2022 at 8:07 AM Bjorn Helgaas wrote: > > > > Previousl

Re: [PATCH v8 00/10] vgaarb: Rework default VGA device selection

2022-01-31 Thread Bjorn Helgaas
[+to Maarten, Maxime, Thomas; beginning of thread: https://lore.kernel.org/r/20220106000658.243509-1-helg...@kernel.org] On Wed, Jan 05, 2022 at 06:06:48PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > Current default VGA device selection fails in some cases because part of it

Re: A PCI quirk for resizeable BAR 0 on Navi10

2021-01-05 Thread Bjorn Helgaas
On Tue, Jan 05, 2021 at 02:44:00PM +0100, Christian König wrote: > Hi Bjorn, > > Darren stumbled over an AMD GPU with nonsense in it's resizeable BAR > capability dword. > > This is most likely fixable with a VBIOS update, but we already sold quite a > bunch of those boards with the problem. >

Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Bjorn Helgaas
Christian König > Signed-off-by: Nirmoy Das Acked-by: Bjorn Helgaas > --- > drivers/pci/pci.c | 2 +- > include/linux/pci.h | 6 ++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index ef80ed451415..

Re: [PATCH 1/4] PCI: Export pci_rebar_get_possible_sizes()

2021-01-07 Thread Bjorn Helgaas
On Thu, Jan 07, 2021 at 06:50:14PM +0100, Nirmoy Das wrote: > From: Darren Salt > > Export pci_rebar_get_possible_sizes() for use by modular drivers. > > Signed-off-by: Darren Salt > Signed-off-by: Nirmoy Das Acked-by: Bjorn Helgaas > --- > drivers/pci/pci.c |

Re: [PATCH 4/4] PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse

2021-01-07 Thread Bjorn Helgaas
he link is different for each patch and will change if you repost the series. I'm not sure why you put the amd patch in the middle of the series. Seems like it would be slightly prettier and just as safe to put it at the end. > Signed-off-by: Nirmoy Das Acked-by: Bjorn Helgaas Let me kn

Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Bjorn Helgaas
On Thu, Jan 07, 2021 at 11:31:36PM +, Darren Salt wrote: > I demand that Bjorn Helgaas may or may not have written... ? > >> +static inline int pci_rebar_bytes_to_size(u64 bytes) > >> +{ > >> + bytes = roundup_pow_of_two(bytes); > >> + return max(il

Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI

2021-12-29 Thread Bjorn Helgaas
On Wed, Dec 29, 2021 at 01:12:07PM +0100, Mauro Carvalho Chehab wrote: > Em Wed, 29 Dec 2021 12:45:38 +0100 > Niklas Schnelle escreveu: > > ... > > I do think we agree that once done correctly there is value in > > such an option independent of HAS_IOPORT only gating inb() etc uses. I'm not sure

Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI

2022-01-05 Thread Bjorn Helgaas
On Wed, Jan 05, 2022 at 05:42:16PM +, John Garry wrote: > On 29/12/2021 16:55, Niklas Schnelle wrote: > > On Wed, 2021-12-29 at 10:03 -0600, Bjorn Helgaas wrote: > > > On Wed, Dec 29, 2021 at 01:12:07PM +0100, Mauro Carvalho Chehab wrote: > > > > Em W

[PATCH v8 00/10] vgaarb: Rework default VGA device selection

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas Current default VGA device selection fails in some cases because part of it is done in the vga_arb_device_init() subsys_initcall, and some arches enumerate PCI devices in pcibios_init(), which runs *after* that. For example: - On BMC system, the AST2500 bridge [1a03:1150

[PATCH v8 01/10] vgaarb: Move vga_arb_integrated_gpu() earlier in file

2022-01-05 Thread Bjorn Helgaas
From: Huacai Chen Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: pull #ifdefs inside function] Link: https://lore.kernel.org/r/20211015061512.2941859-3-chenhua...@loongson.cn Signed-off-by: Huacai Chen Signed-off-by: Bjorn

[PATCH v8 02/10] vgaarb: Factor out vga_select_framebuffer_device()

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas On x86 and ia64, if a VGA device BARs include a framebuffer reported by platform firmware, we select the device as the default VGA device. Factor this code to a separate function. No functional change intended. Signed-off-by: Bjorn Helgaas Cc: Bruno Prémont --- drivers

[PATCH v8 03/10] vgaarb: Factor out default VGA device selection

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas Default VGA device selection fails when PCI devices are enumerated after the vga_arb_device_init() subsys_initcall. vga_arbiter_add_pci_device() selects the first fully enabled device to which legacy VGA resources are routed as the default VGA device. This is an ADD_DEVICE

[PATCH v8 04/10] vgaarb: Move framebuffer detection to ADD_DEVICE path

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas Previously we selected a device that owns the boot framebuffer as the default device in vga_arb_select_default_device(). This was only done in the vga_arb_device_init() subsys_initcall, so devices enumerated later, e.g., by pcibios_init(), were not eligible. Fix this by

[PATCH v8 05/10] vgaarb: Move non-legacy VGA detection to ADD_DEVICE path

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so it could select a non-legacy VGA device as the default. That failed to consider that PCI devices may be e

[PATCH v8 06/10] vgaarb: Move disabled VGA device detection to ADD_DEVICE path

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so that if there are no other eligible devices, it could select a disabled VGA device as the default. Move this

[PATCH v8 07/10] vgaarb: Remove empty vga_arb_device_card_gone()

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas vga_arb_device_card_gone() has always been empty. Remove it. Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/vgaarb.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index

[PATCH v8 08/10] vgaarb: Log bridge control messages when adding devices

2022-01-05 Thread Bjorn Helgaas
there without iterating through the VGA devices again. Note that we call vga_arbiter_check_bridge_sharing() before adding the device to vga_list, so we have to handle the very first device separately. Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/vgaarb.c | 19

[PATCH v8 10/10] vgaarb: Replace full MIT license text with SPDX identifier

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas Per Documentation/process/license-rules.rst, the SPDX MIT identifier is equivalent to including the entire MIT license text from LICENSES/preferred/MIT. Replace the MIT license text with the equivalent SPDX identifier. Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga

[PATCH v8 09/10] vgaarb: Use unsigned format string to print lock counts

2022-01-05 Thread Bjorn Helgaas
From: Bjorn Helgaas In struct vga_device, io_lock_cnt and mem_lock_cnt are unsigned, but we previously printed them with "%d", the signed decimal format. Print them with the unsigned format "%u" instead. Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/vgaarb.c | 2 +

Re: [PATCH v8 04/10] vgaarb: Move framebuffer detection to ADD_DEVICE path

2022-01-06 Thread Bjorn Helgaas
On Thu, Jan 06, 2022 at 02:44:42PM +0800, Huacai Chen wrote: > On Thu, Jan 6, 2022 at 8:07 AM Bjorn Helgaas wrote: > > Previously we selected a device that owns the boot framebuffer as the > > default device in vga_arb_select_default_device(). This was only done in > > th

Re: [PATCH v8 00/10] vgaarb: Rework default VGA device selection

2022-01-06 Thread Bjorn Helgaas
/scm/linux/kernel/git/helgaas/pci.git/log/?h=0f4caffa1297] On Wed, Jan 05, 2022 at 06:06:48PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > Current default VGA device selection fails in some cases because part of it > is done in the vga_arb_device_init() subsys_initcall, and

Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI

2022-01-06 Thread Bjorn Helgaas
On Thu, Jan 06, 2022 at 05:41:00PM +, John Garry wrote: > On 05/01/2022 19:47, Bjorn Helgaas wrote: > > IMO inb() should > > be present but do something innocuous like return ~0, as it would if > > I/O port space is supported but there's no device at that

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-24 Thread Bjorn Helgaas
On Wed, Apr 24, 2019 at 01:31:09PM -0400, Lyude Paul wrote: > Any update on this? This has been waiting for a while now Oh, sorry, I guess we were both waiting for the other. Let me respond to the email with context. > On Thu, 2019-04-04 at 09:17 -0500, Bjorn Helgaas wrote: > &g

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-24 Thread Bjorn Helgaas
On Mon, Apr 15, 2019 at 02:07:18PM -0400, Lyude Paul wrote: > On Thu, 2019-04-04 at 09:17 -0500, Bjorn Helgaas wrote: > > [+cc Hans, author of 0b2fe6594fa2 ("drm/nouveau: Queue hpd_work on (runtime) > > resume")] > > > > On Fri, Mar 22, 2019 at 06:30:15AM -05

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-24 Thread Bjorn Helgaas
On Wed, Apr 24, 2019 at 03:16:37PM -0400, Lyude Paul wrote: > On Wed, 2019-04-24 at 13:59 -0500, Bjorn Helgaas wrote: > > Not being a scheduled work expert, I was unsure if this experiment was > > equivalent to what I proposed. > > > > I'm always suspicious of sing

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-25 Thread Bjorn Helgaas
On Tue, Feb 12, 2019 at 05:02:30PM -0500, Lyude Paul wrote: > On a very specific subset of ThinkPad P50 SKUs, particularly ones that > come with a Quadro M1000M chip instead of the M2000M variant, the BIOS > seems to have a very nasty habit of not always resetting the secondary > Nvidia GPU between

Re: [PATCH v2 0/9] PCI: add help pci_dev_id

2019-04-29 Thread Bjorn Helgaas
On Wed, Apr 24, 2019 at 09:10:21PM +0200, Heiner Kallweit wrote: > In several places in the kernel we find PCI_DEVID used like this: > PCI_DEVID(dev->bus->number, dev->devfn) Therefore create a helper > for it. > > v2: > - apply the change to all affected places in the kernel > > Heiner Kallweit

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-02-18 Thread Bjorn Helgaas
On Mon, Feb 18, 2019 at 3:14 PM Sasha Levin wrote: > > Hi, > > [This is an automated email] > > This commit has been processed because it contains a -stable tag. > The stable tag indicates that it's relevant for the following trees: all > > The bot has tested the following trees: v4.20.8, v4.19.21

Re: [PATCH v5] docs: power: convert docs to ReST and rename to *.rst

2019-06-14 Thread Bjorn Helgaas
s is not linked to > > the main index.rst file, in order to avoid build warnings. > > > > Signed-off-by: Mauro Carvalho Chehab > > Acked-by: Mark Brown > > Acked-by: Bjorn Helgaas > > Acked-by: Srivatsa S. Bhat (VMware) > > So I can't apply this one

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-03-21 Thread Bjorn Helgaas
[+cc Rafael] On Wed, Mar 13, 2019 at 06:25:02PM -0400, Lyude Paul wrote: > On Fri, 2019-02-15 at 16:17 -0500, Lyude Paul wrote: > > On Thu, 2019-02-14 at 18:43 -0600, Bjorn Helgaas wrote: > > > On Tue, Feb 12, 2019 at 05:02:30PM -0500, Lyude Paul wrote: > > > >

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-03-22 Thread Bjorn Helgaas
On Thu, Mar 21, 2019 at 05:48:19PM -0500, Bjorn Helgaas wrote: > On Wed, Mar 13, 2019 at 06:25:02PM -0400, Lyude Paul wrote: > > On Fri, 2019-02-15 at 16:17 -0500, Lyude Paul wrote: > > > On Thu, 2019-02-14 at 18:43 -0600, Bjorn Helgaas wrote: > > > > On Tue, Fe

[PATCH] drm/nouveau: Remove duplicate ACPI_VIDEO_NOTIFY_PROBE definition

2019-04-04 Thread Bjorn Helgaas
From: Bjorn Helgaas Commit 3a6536c51d5d ("drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE") added a definition of ACPI_VIDEO_NOTIFY_PROBE because didn't supply one. Later, commit eff4a751cce5 ("ACPI / video: Move ACPI_VIDEO_NOTIFY_* defines to acpi/video.h") moved AC

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-04 Thread Bjorn Helgaas
[+cc Hans, author of 0b2fe6594fa2 ("drm/nouveau: Queue hpd_work on (runtime) resume")] On Fri, Mar 22, 2019 at 06:30:15AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 21, 2019 at 05:48:19PM -0500, Bjorn Helgaas wrote: > > On Wed, Mar 13, 2019 at 06:25:02PM -0400, Lyude Paul

Re: [PATCH] drm/radeon: Prefer pcie_capability_read_word()

2019-07-18 Thread Bjorn Helgaas
On Wed, Jul 17, 2019 at 9:08 PM Frederick Lawler wrote: > > Commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express Capability") > added accessors for the PCI Express Capability so that drivers didn't > need to be aware of differences between v1 and v2 of the PCI > Express Capability. > > Replace

Re: [PATCH] drm/amdgpu: Prefer pcie_capability_read_word()

2019-07-18 Thread Bjorn Helgaas
On Wed, Jul 17, 2019 at 9:08 PM Frederick Lawler wrote: > > Commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express Capability") > added accessors for the PCI Express Capability so that drivers didn't > need to be aware of differences between v1 and v2 of the PCI > Express Capability. > > Replace

[PATCH 0/2] video: fbdev: Convert from PCI to generic power management

2022-06-07 Thread Bjorn Helgaas
From: Bjorn Helgaas PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. If drivers implement power management, they should use the generic power management framework, not the PCI-specific hooks. No fbdev drivers actually implement PCI power management, but

[PATCH 2/2] video: fbdev: skeletonfb: Convert to generic power management

2022-06-07 Thread Bjorn Helgaas
From: Bjorn Helgaas PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. If drivers implement power management, they should use the generic power management framework, not the PCI-specific hooks. Convert the sample code to use the generic power management

[PATCH 1/2] video: fbdev: cirrusfb: Remove useless reference to PCI power management

2022-06-07 Thread Bjorn Helgaas
From: Bjorn Helgaas PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. The cirrusfb driver has never implemented power management at all, but if it ever does, it should use the generic power management framework, not the PCI-specific hooks. Remove the

Re: [PATCH 0/2] video: fbdev: Convert from PCI to generic power management

2022-06-08 Thread Bjorn Helgaas
On Wed, Jun 08, 2022 at 06:26:34PM +0200, Daniel Vetter wrote: > On Tue, Jun 07, 2022 at 06:11:10PM -0500, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > PCI-specific power management (pci_driver.suspend and pci_driver.resume) is > > deprecated. If drivers imple

Re: [PATCH v8 00/10] vgaarb: Rework default VGA device selection

2022-02-07 Thread Bjorn Helgaas
On Tue, Feb 01, 2022 at 04:46:33PM +0100, Maarten Lankhorst wrote: > Op 31-01-2022 om 23:23 schreef Bjorn Helgaas: > > [+to Maarten, Maxime, Thomas; beginning of thread: > > https://lore.kernel.org/r/20220106000658.243509-1-helg...@kernel.org] > > > > On Wed, Jan 0

Re: [PATCH v3 01/12] thunderbolt: move definition of PCI_CLASS_SERIAL_USB_USB4

2022-02-11 Thread Bjorn Helgaas
> Acked-by: Alex Deucher > Acked-by: Mika Westerberg > Signed-off-by: Mario Limonciello I would change the subject to: PCI: Add USB4 class definition because this seems like more of a PCI thing than a Thunderbolt thing, but either way: Acked-by: Bjorn Helgaas > --- &g

Re: [PATCH v3 02/12] PCI: Move `is_thunderbolt` check for lack of command completed to a quirk

2022-02-11 Thread Bjorn Helgaas
Update subject to something like: PCI: pciehp: Quirk broken Command Completed support on Intel Thunderbolt controllers On Fri, Feb 11, 2022 at 01:32:40PM -0600, Mario Limonciello wrote: > The `is_thunderbolt` check is currently used to indicate the lack of > command completed support for a num

  1   2   3   4   5   >