Re: intel-agp: skip non-AGP devices

Matt Domsch
2004-06-08T16:18:00Z

[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]

On Tue, Jun 08, 2004 at 11:00:27AM -0500, Matt Domsch wrote:
> On Tue, Jun 01, 2004 at 05:31:00PM +0100, Dave Jones wrote:
> > On Tue, Jun 01, 2004 at 05:20:58PM +0100, Christoph Hellwig wrote:
> >
> > > > The patch below checks for a valid cap_ptr prior to printing the
> > > > message, now at KERN_WARNING level (it's not really an error, is it?)
> > >
> > > The real problem is that agpgart doesn't properly fill in the pci_id
> > > table but claims all devices and then does it's own probing internally.
> > > This also breaks hotplug in a funny way.
> >
> > This is fixed in agpgart-bk / -mm. Andi went through all the drivers
> > adding their id's. Should be going to Linus soon.
> >
> > Dave
>
> FWIW, sworks-agp.c has the same issue in mainline yet today.
> agpgart: Unsupported Serverworks chipset (device id: 0011)
> agpgart: Unsupported Serverworks chipset (device id: 0201)
>
> I'll look at -mm to verify it's fixed there.

agpgart-bk and -mm didn't add proper PCI ID lists to sworks-agp.c (yet
I assume). Patch below does the same for this as I submitted for
Intel previously. It only prints a warning now if the device is AGP
capable but unrecognized.

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== drivers/char/agp/sworks-agp.c 1.41 vs edited =====
--- 1.41/drivers/char/agp/sworks-agp.c Tue Jun 1 02:50:11 2004
+++ edited/drivers/char/agp/sworks-agp.c Tue Jun 8 11:13:38 2004
@@ -447,6 +447,7 @@
struct agp_bridge_data *bridge;
struct pci_dev *bridge_dev;
u32 temp, temp2;
+ u8 cap_ptr = 0;

/* Everything is on func 1 here so we are hardcoding function one */
bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
@@ -457,6 +458,8 @@
return -ENODEV;
}

+ cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
+
switch (pdev->device) {
case 0x0006:
/* ServerWorks CNB20HE
@@ -470,8 +473,9 @@
break;

default:
- printk(KERN_ERR PFX "Unsupported Serverworks chipset "
- "(device id: %04x)\n", pdev->device);
+ if (cap_ptr)
+ printk(KERN_WARNING PFX "Unsupported Serverworks chipset "
+ "(device id: %04x)\n", pdev->device);
return -ENODEV;
}

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]