* [PATCH] agpgart: Reprobe VGA devices when a new GART device is added
@ 2010-02-28 3:30 Ben Hutchings
2010-02-28 13:53 ` Ben Hutchings
2010-03-01 8:33 ` Dave Airlie
0 siblings, 2 replies; 5+ messages in thread
From: Ben Hutchings @ 2010-02-28 3:30 UTC (permalink / raw)
To: David Airlie; +Cc: linux-pci, dri-devel, zhenyuw, Greg Kroah-Hartman
This addresses <http://bugzilla.kernel.org/show_bug.cgi?id=15021>.
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.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
This is intended to address the dependency problem highlighted in the
above bug report. That specific bug can be fixed by adding a module
dependency from i915 to intel_agp, but in general there is no fixed
relationship betweem DRM and GART drivers.
There is a narrow race between the check for a current driver binding
and the call to device_reprobe(). This could be closed by adding a
variant on device_attach() and device_reprobe() that is a no-op for
bound devices.
Ben.
drivers/char/agp/backend.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
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 <linux/agp_backend.h>
#include <linux/agpgart.h>
#include <linux/vmalloc.h>
+#include <linux/workqueue.h>
#include <asm/io.h>
#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:
--
1.6.6.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] agpgart: Reprobe VGA devices when a new GART device is added
2010-02-28 3:30 [PATCH] agpgart: Reprobe VGA devices when a new GART device is added Ben Hutchings
@ 2010-02-28 13:53 ` Ben Hutchings
2010-03-01 8:33 ` Dave Airlie
1 sibling, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2010-02-28 13:53 UTC (permalink / raw)
To: David Airlie; +Cc: linux-pci, dri-devel, zhenyuw, Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
On Sun, 2010-02-28 at 03:30 +0000, Ben Hutchings wrote:
> +static void agp_probe_video(struct work_struct *work)
> +{
> + struct pci_dev *pdev = NULL;
> +
> + while ((pdev = pci_get_class(0x030000, pdev)) != NULL) {
Only without the opening brace here...
Ben.
> + if (!pdev->dev.driver && device_reprobe(&pdev->dev))
> + pr_err(PFX "failed to reprobe %s\n", pci_name(pdev));
> +}
--
Ben Hutchings
Horngren's Observation:
Among economists, the real world is often a special case.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] agpgart: Reprobe VGA devices when a new GART device is added
2010-02-28 3:30 [PATCH] agpgart: Reprobe VGA devices when a new GART device is added Ben Hutchings
2010-02-28 13:53 ` Ben Hutchings
@ 2010-03-01 8:33 ` Dave Airlie
2010-03-01 16:19 ` Eric Anholt
1 sibling, 1 reply; 5+ messages in thread
From: Dave Airlie @ 2010-03-01 8:33 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Airlie, linux-pci, dri-devel, Greg Kroah-Hartman
On Sun, Feb 28, 2010 at 1:30 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> This addresses <http://bugzilla.kernel.org/show_bug.cgi?id=15021>.
>
> 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.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> This is intended to address the dependency problem highlighted in the
> above bug report. That specific bug can be fixed by adding a module
> dependency from i915 to intel_agp, but in general there is no fixed
> relationship betweem DRM and GART drivers.
>
> There is a narrow race between the check for a current driver binding
> and the call to device_reprobe(). This could be closed by adding a
> variant on device_attach() and device_reprobe() that is a no-op for
> bound devices.
>
This isn't useful, generally there is no AGP binding, and most drivers
if they can't find an AGP backend will still run fine without it. i.e. radeon,
mga etc.
Intel is a special case and I think we've already merged an explicit
depend.
Just build agp drivers into the kernel, I'm tempted to make them all
non-modular.
Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] agpgart: Reprobe VGA devices when a new GART device is added
2010-03-01 8:33 ` Dave Airlie
@ 2010-03-01 16:19 ` Eric Anholt
2010-03-01 17:40 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2010-03-01 16:19 UTC (permalink / raw)
To: Dave Airlie, Ben Hutchings
Cc: David Airlie, linux-pci, dri-devel, Greg Kroah-Hartman
[-- Attachment #1.1: Type: text/plain, Size: 1376 bytes --]
On Mon, 1 Mar 2010 18:33:14 +1000, Dave Airlie <airlied@gmail.com> wrote:
> On Sun, Feb 28, 2010 at 1:30 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > This addresses <http://bugzilla.kernel.org/show_bug.cgi?id=15021>.
> >
> > 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.
> >
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > This is intended to address the dependency problem highlighted in the
> > above bug report. That specific bug can be fixed by adding a module
> > dependency from i915 to intel_agp, but in general there is no fixed
> > relationship betweem DRM and GART drivers.
> >
> > There is a narrow race between the check for a current driver binding
> > and the call to device_reprobe(). This could be closed by adding a
> > variant on device_attach() and device_reprobe() that is a no-op for
> > bound devices.
> >
>
> This isn't useful, generally there is no AGP binding, and most drivers
> if they can't find an AGP backend will still run fine without it. i.e. radeon,
> mga etc.
>
> Intel is a special case and I think we've already merged an explicit
> depend.
>
> Just build agp drivers into the kernel, I'm tempted to make them all
> non-modular.
That seems easier.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 345 bytes --]
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
[-- Attachment #3: Type: text/plain, Size: 161 bytes --]
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] agpgart: Reprobe VGA devices when a new GART device is added
2010-03-01 16:19 ` Eric Anholt
@ 2010-03-01 17:40 ` Ben Hutchings
0 siblings, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2010-03-01 17:40 UTC (permalink / raw)
To: Eric Anholt
Cc: Dave Airlie, David Airlie, linux-pci, dri-devel,
Greg Kroah-Hartman
On Mon, Mar 01, 2010 at 08:19:02AM -0800, Eric Anholt wrote:
> On Mon, 1 Mar 2010 18:33:14 +1000, Dave Airlie <airlied@gmail.com> wrote:
> > On Sun, Feb 28, 2010 at 1:30 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > > This addresses <http://bugzilla.kernel.org/show_bug.cgi?id=15021>.
> > >
> > > 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.
> > >
> > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > ---
> > > This is intended to address the dependency problem highlighted in the
> > > above bug report. That specific bug can be fixed by adding a module
> > > dependency from i915 to intel_agp, but in general there is no fixed
> > > relationship betweem DRM and GART drivers.
> > >
> > > There is a narrow race between the check for a current driver binding
> > > and the call to device_reprobe(). This could be closed by adding a
> > > variant on device_attach() and device_reprobe() that is a no-op for
> > > bound devices.
> > >
> >
> > This isn't useful, generally there is no AGP binding, and most drivers
> > if they can't find an AGP backend will still run fine without it. i.e. radeon,
> > mga etc.
I see, only the Intel GPU drivers set DRIVER_REQUIRE_AGP.
> > Intel is a special case and I think we've already merged an explicit
> > depend.
> >
> > Just build agp drivers into the kernel, I'm tempted to make them all
> > non-modular.
>
> That seems easier.
Easier, yes, but it's a fair amount of bloat for i386 kernels (less so for
x86-64) since there are many different GART drivers. I was hoping to avoid
that.
Ben.
--
Ben Hutchings
Life is like a sewer:
what you get out of it depends on what you put into it.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-01 17:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 3:30 [PATCH] agpgart: Reprobe VGA devices when a new GART device is added Ben Hutchings
2010-02-28 13:53 ` Ben Hutchings
2010-03-01 8:33 ` Dave Airlie
2010-03-01 16:19 ` Eric Anholt
2010-03-01 17:40 ` Ben Hutchings
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.