Message ID | 20221026144448.424-1-tzimmermann@suse.de |
---|---|
State | New |
Headers | show |
Series | [v2] video/aperture: Call sysfb_disable() before removing PCI devices | expand |
On Wed, Oct 26, 2022 at 04:44:48PM +0200, Thomas Zimmermann wrote: > Call sysfb_disable() from aperture_remove_conflicting_pci_devices() > before removing PCI devices. Without, simpledrm can still bind to > simple-framebuffer devices after the hardware driver has taken over > the hardware. Both drivers interfere with each other and results are > undefined. > > Reported modesetting errors [1] are shown below. Now queued up, thanks. greg k-h
diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index d245826a9324..cc6427a091bc 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -338,6 +338,17 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na resource_size_t base, size; int bar, ret; + /* + * If a driver asked to unregister a platform device registered by + * sysfb, then can be assumed that this is a driver for a display + * that is set up by the system firmware and has a generic driver. + * + * Drivers for devices that don't have a generic driver will never + * ask for this, so let's assume that a real driver for the display + * was already probed and prevent sysfb to register devices later. + */ + sysfb_disable(); + /* * WARNING: Apparently we must kick fbdev drivers before vgacon, * otherwise the vga fbdev driver falls over.