linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	rostedt@goodmis.org, pmladek@suse.com,
	linux-fbdev@vger.kernel.org, sergey.senozhatsky@gmail.com,
	b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org,
	akpm@linux-foundation.org, sergey.senozhatsky.work@gmail.com
Subject: Re: [PATCH 1/1] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set
Date: Wed, 18 Jul 2018 08:44:31 +0000	[thread overview]
Message-ID: <f8d45969-fb04-f706-de66-e51522bbf1ed@redhat.com> (raw)
In-Reply-To: <20180718083633.24182-2-tzimmermann@suse.de>

Hi,

On 18-07-18 10:36, Thomas Zimmermann wrote:
> If the console is unlocked during registration, the console subsystem
> generates significant amounts of warnings, which obfuscate actual
> debugging messages. Setting ignore_console_lock_warning while debugging
> console registration avoid the noise.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Thank you for doing this, but there are multiple console_unlock exit
paths in do_register_framebuffer(), you missed the one in:

         if (!lock_fb_info(fb_info)) {
                 if (!lockless_register_fb)
                         console_unlock();
                 return -ENODEV;
         }

I would change this to:

         if (!lock_fb_info(fb_info)) {
                 ret = -ENODEV;
		goto unlock_console;
         }

	ret = 0;

And put a "unlock_console:" label here:

unlock_console:
    	if (!lockless_register_fb)
    		console_unlock();
	else
		ignore_console_lock_warning 			saved_ignore_console_lock_warning;

And change the final return to:

	return ret;

Otherwise this looks good to me.

Regards,

Hans





> ---
>   drivers/video/fbdev/core/fbmem.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index 9e2f9d3c760e..79b489ad603d 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1627,6 +1627,7 @@ static int do_register_framebuffer(struct fb_info *fb_info)
>   	int i, ret;
>   	struct fb_event event;
>   	struct fb_videomode mode;
> +	bool saved_ignore_console_lock_warning = ignore_console_lock_warning;
>   
>   	if (fb_check_foreignness(fb_info))
>   		return -ENOSYS;
> @@ -1691,6 +1692,8 @@ static int do_register_framebuffer(struct fb_info *fb_info)
>   	event.info = fb_info;
>   	if (!lockless_register_fb)
>   		console_lock();
> +	else
> +		ignore_console_lock_warning = true;
>   	if (!lock_fb_info(fb_info)) {
>   		if (!lockless_register_fb)
>   			console_unlock();
> @@ -1701,6 +1704,9 @@ static int do_register_framebuffer(struct fb_info *fb_info)
>   	unlock_fb_info(fb_info);
>   	if (!lockless_register_fb)
>   		console_unlock();
> +	else
> +		ignore_console_lock_warning > +			saved_ignore_console_lock_warning;
>   	return 0;
>   }
>   
> 

  reply	other threads:[~2018-07-18  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18  8:36 [PATCH 0/1] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set Thomas Zimmermann
2018-07-18  8:36 ` [PATCH 1/1] " Thomas Zimmermann
2018-07-18  8:44   ` Hans de Goede [this message]
2018-07-18  9:13     ` Thomas Zimmermann
2018-07-18 19:21   ` kbuild test robot

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=f8d45969-fb04-f706-de66-e51522bbf1ed@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).