Skip to contentSkip to conversation

amd64-agp conflicts with sis-agp

DISCUSSION Ben Hutchings 1 participant 1 message Mar 20, 2010

lore
Share & tools
lore
#0 lore raw

This code in agp_amd64_init() can optionally bind to devices generically, and it does this without going through the device core:

		/* Look for any AGP bridge */
		dev = NULL;
		err = -ENODEV;
		for_each_pci_dev(dev) {
			if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
				continue;
			/* Only one bridge supported right now */
			if (agp_amd64_probe(dev, NULL) == 0) {
				err = 0;
				break;
			}
		}

This is causing crashes on some systems where sis-agp is already bound to the device. It could even race with binding of another driver when they are both built-in. I think it should be using something like the following instead of directly calling agp_amd64_probe():

			down(&dev->dev.sem);
			if (!dev->dev.driver &&
			    driver_probe_device(&drv->driver, &dev->dev) == 0)
				err = 0;
			up(&dev->dev.sem);
			if (err == 0)
				break;

Ben.

Signature · 3 lines
Ben Hutchings
Power corrupts.  Absolute power is kind of neat.
                           - John Lehman, Secretary of the US Navy 1981-1987