From patchwork Sun Feb 28 03:30:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 82865 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2186EUo023954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 1 Mar 2010 08:06:50 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nm0cf-0003Tq-TQ; Mon, 01 Mar 2010 08:05:01 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NlaN0-0003r4-D9 for dri-devel@lists.sourceforge.net; Sun, 28 Feb 2010 04:03:06 +0000 X-ACL-Warn: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NlaMt-0000DC-LI for dri-devel@lists.sourceforge.net; Sun, 28 Feb 2010 04:03:05 +0000 Received: from deadeye.i.decadent.org.uk ([192.168.4.185] helo=localhost) by shadbolt.decadent.org.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NlZrp-0001l5-0W; Sun, 28 Feb 2010 03:30:53 +0000 Received: from womble by localhost with local (Exim 4.71) (envelope-from ) id 1NlZro-0001Bd-4W; Sun, 28 Feb 2010 03:30:52 +0000 From: Ben Hutchings To: David Airlie Date: Sun, 28 Feb 2010 03:30:51 +0000 Message-ID: <1267327851.2282.8.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 X-SA-Exim-Connect-IP: 192.168.4.185 X-SA-Exim-Mail-From: ben@decadent.org.uk X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on shadbolt.decadent.org.uk X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 Subject: [PATCH] agpgart: Reprobe VGA devices when a new GART device is added X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.decadent.org.uk) X-Spam-Score: -0.7 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NlaMt-0000DC-LI X-Mailman-Approved-At: Mon, 01 Mar 2010 08:05:00 +0000 Cc: linux-pci@vger.kernel.org, dri-devel@lists.sourceforge.net, Greg Kroah-Hartman X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 01 Mar 2010 08:06:51 +0000 (UTC) diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index c3ab46d..f9680bf 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "agp.h" @@ -281,6 +282,24 @@ void agp_put_bridge(struct agp_bridge_data *bridge) EXPORT_SYMBOL(agp_put_bridge); +/* + * DRM drivers may fail to probe their devices when the associated AGP + * GART does not yet have a driver, so we reprobe unbound VGA devices + * when a GART device is added. This problem applies not only to true + * AGP devices which would be children of the affected bridge, but + * also to PCI Express devices that may be siblings of the GART + * device. Therefore iterate over all PCI VGA devices. + */ +static void agp_probe_video(struct work_struct *work) +{ + struct pci_dev *pdev = NULL; + + while ((pdev = pci_get_class(0x030000, pdev)) != NULL) { + if (!pdev->dev.driver && device_reprobe(&pdev->dev)) + pr_err(PFX "failed to reprobe %s\n", pci_name(pdev)); +} +static DECLARE_WORK(agp_probe_video_work, agp_probe_video); + int agp_add_bridge(struct agp_bridge_data *bridge) { int error; @@ -324,6 +343,7 @@ int agp_add_bridge(struct agp_bridge_data *bridge) } list_add(&bridge->list, &agp_bridges); + schedule_work(&agp_probe_video_work); return 0; frontend_err: