All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: udlfb: remove sysfs framebuffer device with USB .disconnect()
Date: Sat, 21 Jan 2012 14:13:07 +0000	[thread overview]
Message-ID: <4F1AC7F3.3040909@gmx.de> (raw)
In-Reply-To: <1327090686.1555.2.camel@mop>

On 01/21/2012 01:57 PM, Kay Sievers wrote:
> On Sat, Jan 21, 2012 at 14:44, Florian Tobias Schandinat
> <FlorianSchandinat@gmx.de> wrote:
>> On 01/20/2012 08:18 PM, Kay Sievers wrote:
> 
>>> +++ b/drivers/video/fbmem.c
>>> @@ -1672,7 +1672,7 @@ static int do_unregister_framebuffer(str
>>>       registered_fb[i] = NULL;
>>
>> Here registered_fb[fb_info->node] is set to NULL...
> 
>>> +int unlink_framebuffer(struct fb_info *fb_info)
>>> +{
>>> +     int i;
>>> +
>>> +     i = fb_info->node;
>>> +     if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
>>> +             return -EINVAL;
>>
>> ...and here you check whether it is still valid (did you copy the check from the
>> do_unregister_framebuffer?). So the code below would be never executed, when
>> called in this context.
> 
> That's true. If one calls the current _unregister() *before* calling
> _unlink(), the _unlink() is a NOP. But that's intentional.

I don't think you got me right. My complaint was that after your patch
do_unregister_framebuffer itself calls unlink_framebuffer _after_ it set
registered_fb[i] = NULL;
So for any framebuffer that does not call unlink_framebuffer directly the line
device_destroy(fb_class, MKDEV(FB_MAJOR, i));
will no longer be executed. Do you agree?


Best regards,

Florian Tobias Schandinat

> 
> The _unlink() is only needed for stuff needs to be called when we are
> required to 'orphan' the device before cleaning up. Normal,
> non-hotpluggable devices do not need this, they can continue what they
> do today.
> 
> The _unlink() call *can* be called before _unregister() if needed for
> disconnecting it from the driver core parent and remove its userspace
> visibility. If _unlink() is called before _unregister(), it passes the
> check, the later _unregister() will also pass the check but get rid of
> the entire device.
> 
> Kay
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  parent reply	other threads:[~2012-01-21 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 20:18 udlfb: remove sysfs framebuffer device with USB .disconnect() Kay Sievers
2012-01-21 13:44 ` Florian Tobias Schandinat
2012-01-21 13:57 ` Kay Sievers
2012-01-21 14:13 ` Florian Tobias Schandinat [this message]
2012-01-21 14:32 ` Kay Sievers
2012-01-27 16:32 ` Kay Sievers
2012-01-30  5:16 ` Florian Tobias Schandinat

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=4F1AC7F3.3040909@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.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.