public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* amd64-agp conflicts with sis-agp
@ 2010-03-20 17:17 Ben Hutchings
  0 siblings, 0 replies; only message in thread
From: Ben Hutchings @ 2010-03-20 17:17 UTC (permalink / raw)
  To: Dave Airlie, David Woodhouse; +Cc: linux-kernel, 570321, 571003, 548090

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

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.

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-20 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-20 17:17 amd64-agp conflicts with sis-agp Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox