LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix oops in MGA DRM on root bus.
@ 2005-11-19 23:19 David Woodhouse
  2005-11-20  0:08 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: David Woodhouse @ 2005-11-19 23:19 UTC (permalink / raw)
  To: airlied, greg; +Cc: linuxppc-dev

I think that if a PCI bus is a root bus, attached to a host bridge not a
PCI->PCI bridge, then bus->self is allowed to be NULL. Certainly that's
the case on my Pegasos, and it makes the MGA DRM driver oops...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_
 	 * device.
 	 */
 
-	if ((pdev->device == 0x0525)
+	if ((pdev->device == 0x0525) && pdev->bus->self &&
 	    && (pdev->bus->self->vendor == 0x3388)
 	    && (pdev->bus->self->device == 0x0021)) {
 		return 0;

-- 
dwmw2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix oops in MGA DRM on root bus.
  2005-11-19 23:19 [PATCH] Fix oops in MGA DRM on root bus David Woodhouse
@ 2005-11-20  0:08 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2005-11-20  0:08 UTC (permalink / raw)
  To: greg, airlied; +Cc: linuxppc-dev

On Sat, 2005-11-19 at 23:19 +0000, David Woodhouse wrote:
> -       if ((pdev->device == 0x0525)
> +       if ((pdev->device == 0x0525) && pdev->bus->self &&
>             && (pdev->bus->self->vendor == 0x3388)
>             && (pdev->bus->self->device == 0x0021)) {
>                 return 0;

Perhaps with one fewer '&&'...

diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_
 	 * device.
 	 */
 
-	if ((pdev->device == 0x0525)
+	if ((pdev->device == 0x0525) && pdev->bus->self
 	    && (pdev->bus->self->vendor == 0x3388)
 	    && (pdev->bus->self->device == 0x0021)) {
 		return 0;

-- 
dwmw2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-20  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-19 23:19 [PATCH] Fix oops in MGA DRM on root bus David Woodhouse
2005-11-20  0:08 ` David Woodhouse

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