[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445667176.2395.16.camel@decadent.org.uk>
Date: Sat, 24 Oct 2015 15:12:56 +0900
From: Ben Hutchings <ben@...adent.org.uk>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org, Ben Skeggs <bskeggs@...hat.com>
Subject: Re: [PATCH 4.2 41/54] drm/nouveau/fbcon: take runpm reference when
userspace has an open fd
On Fri, 2015-10-23 at 10:45 -0700, Greg Kroah-Hartman wrote:
> 4.2-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Ben Skeggs <bskeggs@...hat.com>
>
> commit f231976c2e8964ceaa9250e57d27c35ff03825c2 upstream.
>
> We need to do this in order to prevent accesses to the device while it's
> powered down. Userspace may have an mmap of the fb, and there's no good
> way (that I know of) to prevent it from touching the device otherwise.
>
> This fixes some nasty races between runpm and plymouth on some systems,
> which result in the GPU getting very upset and hanging the boot.
>
> Signed-off-by: Ben Skeggs <bskeggs@...hat.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>
> ---
> drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
> @@ -178,8 +178,30 @@ nouveau_fbcon_sync(struct fb_info *info)
> > > return 0;
> }
>
> +static int
> +nouveau_fbcon_open(struct fb_info *info, int user)
> +{
> +> > struct nouveau_fbdev *fbcon = info->par;
> +> > struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
> +> > int ret = pm_runtime_get_sync(drm->dev->dev);
> + if (ret < 0 && ret != -EACCES)
> + return ret;
> +> > return 0;
> +}
[...]
As pm_runtime_get_sync() always bumps the usage count, the error path
here should call pm_runtime_put().
Ben.
>
--
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists