All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Moreau <pierre.morrow-GANU6spQydw@public.gmane.org>
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] drm/nouveau/bl: Fix oops on driver unbind
Date: Mon, 19 Feb 2018 10:38:04 +0100	[thread overview]
Message-ID: <20180219093803.3bbevbvd574r7epx@pmoreau.org> (raw)
In-Reply-To: <5c682f35ac338efac66416b7670dc01f1ee02676.1518870434.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2806 bytes --]

My bad; I did test suspend/resume, but not unbinding. Shouldn’t that
happen on shutdown as well, as the driver gets unloaded? I don’t remember
seeing that issue there though.

On 2018-02-17 — 13:40, Lukas Wunner wrote:
> Unbinding nouveau on a dual GPU MacBook Pro oopses because we iterate
> over the bl_connectors list in nouveau_backlight_exit() but skipped
> initializing it in nouveau_backlight_init().  Stacktrace for posterity:
> 
>     BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
>     IP: nouveau_backlight_exit+0x2b/0x70 [nouveau]
>     nouveau_display_destroy+0x29/0x80 [nouveau]
>     nouveau_drm_unload+0x65/0xe0 [nouveau]
>     drm_dev_unregister+0x3c/0xe0 [drm]
>     drm_put_dev+0x2e/0x60 [drm]
>     nouveau_drm_device_remove+0x47/0x70 [nouveau]
>     pci_device_remove+0x36/0xb0
>     device_release_driver_internal+0x157/0x220
>     driver_detach+0x39/0x70
>     bus_remove_driver+0x51/0xd0
>     pci_unregister_driver+0x2a/0xa0
>     nouveau_drm_exit+0x15/0xfb0 [nouveau]
>     SyS_delete_module+0x18c/0x290
>     system_call_fast_compare_end+0xc/0x6f
> 
> Fixes: b53ac1ee12a3 ("drm/nouveau/bl: Do not register interface if Apple GMUX detected")
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # v4.10+
> Cc: Pierre Moreau <pierre.morrow-GANU6spQydw@public.gmane.org>
> Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
> ---
> I reviewed the patch causing the oops but unfortunately missed this, sorry!
> 
>  drivers/gpu/drm/nouveau/nouveau_backlight.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 380f340204e8..f56f60f695e1 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -268,13 +268,13 @@ nouveau_backlight_init(struct drm_device *dev)
>  	struct nvif_device *device = &drm->client.device;
>  	struct drm_connector *connector;
>  
> +	INIT_LIST_HEAD(&drm->bl_connectors);
> +

We could instead have an early return in the exit function if
`apple_gmux_present()` or `drm->bl_connectors` is null, but your current fix
seems better.

Reviewed-by: Pierre Moreau <pierre.morrow-GANU6spQydw@public.gmane.org>

Thank you for the fix!
Pierre

>  	if (apple_gmux_present()) {
>  		NV_INFO(drm, "Apple GMUX detected: not registering Nouveau backlight interface\n");
>  		return 0;
>  	}
>  
> -	INIT_LIST_HEAD(&drm->bl_connectors);
> -
>  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
>  		if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS &&
>  		    connector->connector_type != DRM_MODE_CONNECTOR_eDP)
> -- 
> 2.15.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2018-02-19  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 12:40 [PATCH] drm/nouveau/bl: Fix oops on driver unbind Lukas Wunner
     [not found] ` <5c682f35ac338efac66416b7670dc01f1ee02676.1518870434.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-02-19  9:38   ` Pierre Moreau [this message]
     [not found]     ` <20180219093803.3bbevbvd574r7epx-WLoDKDh+7sdAfugRpC6u6w@public.gmane.org>
2018-03-14 11:54       ` Lukas Wunner
     [not found]         ` <20180314115452.GA10761-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-03-16  1:57           ` Ben Skeggs
2018-03-17 11:07       ` Lukas Wunner
     [not found]         ` <20180317110740.GA3109-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-03-18 20:48           ` Pierre Moreau

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=20180219093803.3bbevbvd574r7epx@pmoreau.org \
    --to=pierre.morrow-ganu6spqydw@public.gmane.org \
    --cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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.