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: 82761 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1S3SOrd025157 for ; Sun, 28 Feb 2010 03:31:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968616Ab0B1Da7 (ORCPT ); Sat, 27 Feb 2010 22:30:59 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:56355 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968613Ab0B1Da7 convert rfc822-to-8bit (ORCPT ); Sat, 27 Feb 2010 22:30:59 -0500 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 Cc: linux-pci@vger.kernel.org, dri-devel@lists.sourceforge.net, zhenyuw@linux.intel.com, Greg Kroah-Hartman 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) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 28 Feb 2010 03:31:00 +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: