All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Dave Airlie <airlied@redhat.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm: don't double-free on driver load error
Date: Thu, 5 Dec 2013 16:01:43 +0100	[thread overview]
Message-ID: <20131205160143.50380ea1@pluto.restena.lu> (raw)
In-Reply-To: <1386254569-28477-1-git-send-email-imirkin@alum.mit.edu>

Hi Ilia,

On Thu,  5 Dec 2013 09:42:49 -0500 Ilia Mirkin wrote:
> All instances of drm_dev_register are followed by drm_dev_free on
> failure. Don't free dev->control/render/primary on failure, as they will
> be freed by drm_dev_free since commit 8f6599da8e (drm: delay minor
> destruction to drm_dev_free()). Instead unplug them.

This patch prevents the reported GPF for 3.13-rc2 on my MBA2,1
with GeForce 9400M.

So
  Reported-and-tested-by: Bruno Prémont <bonbons@linux-vserver.org>


Resulting dmesg is:
...
[   34.179136] ACPI Warning: \_SB_.PCI0.IXVE.IGPU._DSM: Argument #4 type mismatch - Found [Integer], ACPI requires [Package] (20131115/nsarguments-95)
[   34.179315] ACPI Warning: \_SB_.PCI0.IXVE.IGPU._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20131115/nsarguments-95)
[   34.179478] checking generic (80010000 640000) vs hw (80000000 10000000)
[   34.179481] fb: conflicting fb hw usage nouveaufb vs EFI VGA - removing generic driver
[   34.179587] Console: switching to colour dummy device 80x25
[   34.179841] nouveau 0000:02:00.0: enabling device (0006 -> 0007)
[   34.181330] ACPI: PCI Interrupt Link [LGPU] enabled at IRQ 16
[   34.181549] [drm] hdmi device  not found 2 0 1
[   34.182041] nouveau  [  DEVICE][0000:02:00.0] BOOT0  : 0x0ac800b1
[   34.182044] nouveau  [  DEVICE][0000:02:00.0] Chipset: MCP79/MCP7A (NVAC)
[   34.182047] nouveau  [  DEVICE][0000:02:00.0] Family : NV50
[   34.189313] nouveau  [   VBIOS][0000:02:00.0] checking PRAMIN for image...
[   34.247351] nouveau  [   VBIOS][0000:02:00.0] ... appears to be valid
[   34.247355] nouveau  [   VBIOS][0000:02:00.0] using image from PRAMIN
[   34.247521] nouveau  [   VBIOS][0000:02:00.0] BIT signature found
[   34.247525] nouveau  [   VBIOS][0000:02:00.0] version 62.79.47.00.01
[   34.269748] nouveau 0000:02:00.0: irq 42 for MSI/MSI-X
[   34.269816] nouveau  [     PMC][0000:02:00.0] MSI interrupts enabled
[   34.269956] nouveau  [     PFB][0000:02:00.0] RAM type: stolen system memory
[   34.269963] nouveau  [     PFB][0000:02:00.0] RAM size: 256 MiB
[   34.269969] nouveau  [     PFB][0000:02:00.0]    ZCOMP: 0 tags
[   34.328924] nouveau  [  PTHERM][0000:02:00.0] FAN control: none / external
[   34.328935] nouveau  [  PTHERM][0000:02:00.0] fan management: automatic
[   34.328939] nouveau  [  PTHERM][0000:02:00.0] internal sensor: yes
[   34.328949] nouveau  [     CLK][0000:02:00.0] 03: core 100 MHz shader 200 MHz 
[   34.328954] nouveau  [     CLK][0000:02:00.0] 05: core 150 MHz shader 300 MHz 
[   34.328959] nouveau  [     CLK][0000:02:00.0] 0e: core 300 MHz shader 600 MHz 
[   34.328964] nouveau  [     CLK][0000:02:00.0] 0f: core 350 MHz shader 800 MHz 
[   34.328978] nouveau E[     CLK][0000:02:00.0] 17 freq unknown
[   34.328980] nouveau E[     CLK][0000:02:00.0] init failed, -22
[   34.328983] nouveau E[     DRM] failed to create 0x80000080, -22
[   34.331106] nouveau: probe of 0000:02:00.0 failed with error -22

(the probe failure being fixed by commit mentioned earlier in this thread)

Thanks for the fix,
Bruno

> Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
> 
> v2: use drm_unplug_minor instead of just removing the puts, as suggested by
>     David Herrman.
> 
>  drivers/gpu/drm/drm_stub.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
> index f53d524..66dd3a0 100644
> --- a/drivers/gpu/drm/drm_stub.c
> +++ b/drivers/gpu/drm/drm_stub.c
> @@ -566,11 +566,11 @@ err_unload:
>  	if (dev->driver->unload)
>  		dev->driver->unload(dev);
>  err_primary_node:
> -	drm_put_minor(dev->primary);
> +	drm_unplug_minor(dev->primary);
>  err_render_node:
> -	drm_put_minor(dev->render);
> +	drm_unplug_minor(dev->render);
>  err_control_node:
> -	drm_put_minor(dev->control);
> +	drm_unplug_minor(dev->control);
>  err_agp:
>  	if (dev->driver->bus->agp_destroy)
>  		dev->driver->bus->agp_destroy(dev);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2013-12-05 15:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 11:01 Nouveau failing during probe followed by GPF on 3.13-rc2 Bruno Prémont
     [not found] ` <20131204120100.5331f1c6-I2t2yFIzmohO7ya8xxV06g@public.gmane.org>
2013-12-04 11:15   ` Ilia Mirkin
     [not found]     ` <CAKb7Uvg2XpchxYxVTRgbwBWZzk9ONrSOAQcUQoM8GECn8-w=8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-12-04 14:45       ` Bruno Prémont
2013-12-04 20:37     ` Ilia Mirkin
2013-12-05  0:19       ` [PATCH] drm: don't double-free on driver load error Ilia Mirkin
2013-12-05  7:51         ` David Herrmann
2013-12-05 14:42           ` [PATCH v2] " Ilia Mirkin
2013-12-05 15:01             ` Bruno Prémont [this message]
2013-12-05 15:53             ` David Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131205160143.50380ea1@pluto.restena.lu \
    --to=bonbons@linux-vserver.org \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imirkin@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.