Re: [PATCH 1/1] fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 18.07.2018 um 10:44 schrieb Hans de Goede:
> 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@xxxxxxx>
> 
> Thank you for doing this, but there are multiple console_unlock exit
> paths in do_register_framebuffer(), you missed the one in:

Sorry for this half-baked patch and thanks for the review. I'll provide
an update.

Best regards
Thomas


> 
>         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;
>>   }
>>  

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755;  https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux