Commit 145eed48 authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

fbdev: Remove conflicting devices on PCI bus



Remove firmware devices on the PCI bus, by calling
aperture_remove_conflicting_pci_devices() in the probe function of
each related fbdev driver. iSo far, most of these drivers did not
remove conflicting VESA or EFI devices, or outride failed for
resource conflicts (i.e., matroxfb.) This must have been broken
for quite some time.

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-7-tzimmermann@suse.de
parent 8d69d008
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
 *  Code is based on s3fb
 */

#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -949,6 +950,10 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
	int rc;
	u8 regval;

	rc = aperture_remove_conflicting_pci_devices(dev, "arkfb");
	if (rc < 0)
		return rc;

	/* Ignore secondary VGA device because there is no VGA arbitration */
	if (! svga_primary_device(dev)) {
		dev_info(&(dev->dev), "ignoring secondary device\n");
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
 *  more details.
 */

#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -545,6 +546,10 @@ static int asiliantfb_pci_init(struct pci_dev *dp,
	struct fb_info *p;
	int err;

	err = aperture_remove_conflicting_pci_devices(dp, "asiliantfb");
	if (err)
		return err;

	if ((dp->resource[0].flags & IORESOURCE_MEM) == 0)
		return -ENODEV;
	addr = pci_resource_start(dp, 0);
+5 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
 */


#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
@@ -2055,6 +2056,10 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	void __iomem *bios = NULL;
#endif

	err = aperture_remove_conflicting_pci_devices(pdev, "aty128fb");
	if (err)
		return err;

	/* Enable device in PCI config */
	if ((err = pci_enable_device(pdev))) {
		printk(KERN_ERR "aty128fb: Cannot enable PCI device: %d\n",
+6 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@

******************************************************************************/

#include <linux/aperture.h>
#include <linux/compat.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -3533,7 +3534,11 @@ static int atyfb_pci_probe(struct pci_dev *pdev,
	struct fb_info *info;
	struct resource *rp;
	struct atyfb_par *par;
	int rc = -ENOMEM;
	int rc;

	rc = aperture_remove_conflicting_pci_devices(pdev, "atyfb");
	if (rc)
		return rc;

	/* Enable device in PCI config */
	if (pci_enable_device(pdev)) {
+5 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 * - FB1 is display 1 with unique memory area
 * - both display use 32 bit colors
 */
#include <linux/aperture.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/fb.h>
@@ -614,6 +615,10 @@ static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
	struct fb_info *info;
	int ret;

	ret = aperture_remove_conflicting_pci_devices(dev, "carminefb");
	if (ret)
		return ret;

	ret = pci_enable_device(dev);
	if (ret)
		return ret;
Loading