mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Boris V." <borisvk@bstnet.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org, Javier Martinez Canillas <javierm@redhat.com>
Subject: Re: [PATCH 6.0 20/20] fbdev/core: Remove remove_conflicting_pci_framebuffers()
Date: Tue, 1 Nov 2022 11:34:34 +0100	[thread overview]
Message-ID: <88e835b3-4075-e1a3-9201-8ab5c8eaaaff@suse.de> (raw)
In-Reply-To: <ba4caf7a-9e1f-d5fb-f20c-dba81dc00c06@bstnet.org>


[-- Attachment #1.1: Type: text/plain, Size: 7686 bytes --]

(cc: Alex Williamson)

Hi

Am 01.11.22 um 09:42 schrieb Boris V.:
> On 24/10/2022 13:31, Greg Kroah-Hartman wrote:
>> From: Thomas Zimmermann <tzimmermann@suse.de>
>>
>> commit 9d69ef1838150c7d87afc1a87aa658c637217585 upstream.
>>
>> Remove remove_conflicting_pci_framebuffers() and implement similar
>> functionality in aperture_remove_conflicting_pci_device(), which was
>> the only caller. Removes an otherwise unused interface and streamlines
>> the aperture helper. No functional changes.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>> Link: 
>> https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-5-tzimmermann@suse.de
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>>   drivers/video/aperture.c         |   30 ++++++++++++++----------
>>   drivers/video/fbdev/core/fbmem.c |   48 
>> ---------------------------------------
>>   include/linux/fb.h               |    2 -
>>   3 files changed, 18 insertions(+), 62 deletions(-)
>>
>> --- a/drivers/video/aperture.c
>> +++ b/drivers/video/aperture.c
>> @@ -335,30 +335,36 @@ EXPORT_SYMBOL(aperture_remove_conflictin
>>    */
>>   int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, 
>> const char *name)
>>   {
>> +    bool primary = false;
>>       resource_size_t base, size;
>>       int bar, ret;
>> -    /*
>> -     * WARNING: Apparently we must kick fbdev drivers before vgacon,
>> -     * otherwise the vga fbdev driver falls over.
>> -     */
>> -#if IS_REACHABLE(CONFIG_FB)
>> -    ret = remove_conflicting_pci_framebuffers(pdev, name);
>> -    if (ret)
>> -        return ret;
>> +#ifdef CONFIG_X86
>> +    primary = pdev->resource[PCI_ROM_RESOURCE].flags & 
>> IORESOURCE_ROM_SHADOW;
>>   #endif
>> -    ret = vga_remove_vgacon(pdev);
>> -    if (ret)
>> -        return ret;
>>       for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) {
>>           if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
>>               continue;
>> +
>>           base = pci_resource_start(pdev, bar);
>>           size = pci_resource_len(pdev, bar);
>> -        aperture_detach_devices(base, size);
>> +        ret = aperture_remove_conflicting_devices(base, size, 
>> primary, name);
>> +        if (ret)
>> +            break;
>>       }
>> +    if (ret)
>> +        return ret;
>> +
>> +    /*
>> +     * WARNING: Apparently we must kick fbdev drivers before vgacon,
>> +     * otherwise the vga fbdev driver falls over.
>> +     */
>> +    ret = vga_remove_vgacon(pdev);
>> +    if (ret)
>> +        return ret;
>> +
>>       return 0;
>>   }
>> --- a/drivers/video/fbdev/core/fbmem.c
>> +++ b/drivers/video/fbdev/core/fbmem.c
>> @@ -1788,54 +1788,6 @@ int remove_conflicting_framebuffers(stru
>>   EXPORT_SYMBOL(remove_conflicting_framebuffers);
>>   /**
>> - * remove_conflicting_pci_framebuffers - remove firmware-configured 
>> framebuffers for PCI devices
>> - * @pdev: PCI device
>> - * @name: requesting driver name
>> - *
>> - * This function removes framebuffer devices (eg. initialized by 
>> firmware)
>> - * using memory range configured for any of @pdev's memory bars.
>> - *
>> - * The function assumes that PCI device with shadowed ROM drives a 
>> primary
>> - * display and so kicks out vga16fb.
>> - */
>> -int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const 
>> char *name)
>> -{
>> -    struct apertures_struct *ap;
>> -    bool primary = false;
>> -    int err, idx, bar;
>> -
>> -    for (idx = 0, bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>> -        if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
>> -            continue;
>> -        idx++;
>> -    }
>> -
>> -    ap = alloc_apertures(idx);
>> -    if (!ap)
>> -        return -ENOMEM;
>> -
>> -    for (idx = 0, bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>> -        if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
>> -            continue;
>> -        ap->ranges[idx].base = pci_resource_start(pdev, bar);
>> -        ap->ranges[idx].size = pci_resource_len(pdev, bar);
>> -        pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
>> -            (unsigned long)pci_resource_start(pdev, bar),
>> -            (unsigned long)pci_resource_end(pdev, bar));
>> -        idx++;
>> -    }
>> -
>> -#ifdef CONFIG_X86
>> -    primary = pdev->resource[PCI_ROM_RESOURCE].flags &
>> -                    IORESOURCE_ROM_SHADOW;
>> -#endif
>> -    err = remove_conflicting_framebuffers(ap, name, primary);
>> -    kfree(ap);
>> -    return err;
>> -}
>> -EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
>> -
>> -/**
>>    *    register_framebuffer - registers a frame buffer device
>>    *    @fb_info: frame buffer info structure
>>    *
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -615,8 +615,6 @@ extern ssize_t fb_sys_write(struct fb_in
>>   /* drivers/video/fbmem.c */
>>   extern int register_framebuffer(struct fb_info *fb_info);
>>   extern void unregister_framebuffer(struct fb_info *fb_info);
>> -extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>> -                           const char *name);
>>   extern int remove_conflicting_framebuffers(struct apertures_struct *a,
>>                          const char *name, bool primary);
>>   extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
>>
>>
>>
>>
> 
> Hello,
> 
> this patch seems to disable console/framebuffer when vfio-pci is used.
> I hava 2 nvidia GPUs one is used for host and other is passed through to 
> VM.

Vfio uses this helper to unload the driver before passing it to a VM 
AFAIU. But unless you're using nouveau, you're on your own.

Best regards
Thomas

> Now after this patch, when vfio-pci module is loaded with parameter 
> ids=10de:2486,10de:228b,
> console is lost/frozen, last message is that vfio-pci module was loaded 
> and then there is no more output.
> This PCI IDs (10de:2486,10de:228b) are for secondary GPU, primary/boot 
> GPU is used for host and boot messages are displayed on primary/boot GPU.
> 
> Using dmesg I see this messages after vfio-pci is loaded:
> 
> [    3.993601] VFIO - User Level meta-driver version: 0.3
> [    4.020239] Console: switching to colour dummy device 80x25
> [    4.020335] vfio-pci 0000:1a:00.0: vgaarb: changed VGA decodes: 
> olddecodes=io+mem,decodes=none:owns=none
> [    4.020722] vfio_pci: add [10de:2486[ffffffff:ffffffff]] class 
> 0x000000/00000000
> [    4.116616] vfio_pci: add [10de:228b[ffffffff:ffffffff]] class 
> 0x000000/00000000
> 
> I guess the problem here is "Console: switching to colour dummy device 
> 80x25", but I don't know why this happens.
> Last working kernel is 6.0.3, after upgrading to 6.0.4 (and 6.0.5, 
> 6.0.6), console is no longer working.
> By git bisecting it seems bad commit is 
> af9ac541e88390d97b01d5e8c77309d2637c1d4c.
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-11-01 10:34 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 11:31 [PATCH 6.0 00/20] 6.0.4-rc1 review Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 01/20] drm/i915/bios: Validate fp_timing terminator presence Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 02/20] drm/i915/bios: Use hardcoded fp_timing size for generating LFP data pointers Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 03/20] pinctrl: amd: change dev_warn to dev_dbg for additional feature support Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 04/20] thermal: intel_powerclamp: Use first online CPU as control_cpu Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 05/20] io_uring/net: fail zc send when unsupported by socket Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 06/20] HID: playstation: stop DualSense output work on remove Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 07/20] HID: playstation: add initial DualSense Edge controller support Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 08/20] net: flag sockets supporting msghdr originated zerocopy Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 09/20] drm/amd/pm: fulfill SMU13.0.7 cstate control interface Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 10/20] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 11/20] drm/amd/pm: disable cstate feature for gpu reset scenario Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 12/20] drm/amd/pm: fulfill SMU13.0.0 cstate control interface Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 13/20] drm/amd/pm: update SMU IP v13.0.4 driver interface version Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 14/20] dm clone: Fix typo in block_device format specifier Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 15/20] efi: efivars: Fix variable writes without query_variable_store() Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 16/20] efi: ssdt: Dont free memory if ACPI table was loaded successfully Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 17/20] gcov: support GCC 12.1 and newer compilers Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 18/20] io-wq: Fix memory leak in worker creation Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 19/20] mm/huge_memory: do not clobber swp_entry_t during THP split Greg Kroah-Hartman
2022-10-25 15:11   ` Hugh Dickins
2022-10-25 15:58     ` Greg Kroah-Hartman
2022-10-30  3:33       ` Hugh Dickins
2022-10-31  6:44         ` Greg Kroah-Hartman
2022-10-24 11:31 ` [PATCH 6.0 20/20] fbdev/core: Remove remove_conflicting_pci_framebuffers() Greg Kroah-Hartman
2022-11-01  8:42   ` Boris V.
2022-11-01 10:34     ` Thomas Zimmermann [this message]
2022-11-01 11:34       ` Boris V.
2022-10-24 15:47 ` [PATCH 6.0 00/20] 6.0.4-rc1 review Luna Jernberg
2022-10-24 19:10 ` Rudi Heitbaum
2022-10-24 19:21 ` Jon Hunter
2022-10-24 19:28 ` Florian Fainelli
2022-10-24 20:48 ` Shuah Khan
2022-10-24 21:55 ` Ron Economos
2022-10-25  0:20 ` Slade Watkins
2022-10-25  9:08 ` Bagas Sanjaya
2022-10-25 12:33 ` Naresh Kamboju
2022-10-25 15:32 ` Guenter Roeck
2022-10-25 22:43 ` Justin Forbes
2022-10-26  6:36 ` Ernst Herzberg
2022-10-26  6:59   ` Greg Kroah-Hartman

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=88e835b3-4075-e1a3-9201-8ab5c8eaaaff@suse.de \
    --to=tzimmermann@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=borisvk@bstnet.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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

Powered by JetHome