All of lore.kernel.org
 help / color / mirror / Atom feed
* /dev entry of USB device not disappearing after detach
@ 2014-02-14 17:35 Valentina Manea
  2014-02-14 18:20 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Valentina Manea @ 2014-02-14 17:35 UTC (permalink / raw)
  To: linux-hotplug

Hello,

I am working on a driver for a virtual USB host controller. When I attach a USB
device, everything is fine - sysfs files are created, /dev entry is
created, device is usable.
However, when I detach it, the /dev entry still remains. The sysfs
files are removed, as expected. Obviously, the /dev entry is no longer
usable, e.g. it can't be used for mounting.

The output from udevmon is here [1]. vhci_hcd is the device representing the
USB hub and 2-1 is the bus ID of the attached device.

As far as I can tell, udevd receives the remove event but, for some
reason, the /dev entry still remains.

Any help is greatly appreciated.

Thanks,
Valentina

[1] http://pastebin.com/0M2pSGw1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /dev entry of USB device not disappearing after detach
  2014-02-14 17:35 /dev entry of USB device not disappearing after detach Valentina Manea
@ 2014-02-14 18:20 ` Greg KH
  2014-02-14 18:21 ` Greg KH
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-02-14 18:20 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Feb 14, 2014 at 07:35:31PM +0200, Valentina Manea wrote:
> Hello,
> 
> I am working on a driver for a virtual USB host controller. When I attach a USB
> device, everything is fine - sysfs files are created, /dev entry is
> created, device is usable.
> However, when I detach it, the /dev entry still remains. The sysfs
> files are removed, as expected. Obviously, the /dev entry is no longer
> usable, e.g. it can't be used for mounting.

What /dev entry are you referring to?

Did something have it held open while the device was still connected and
hasn't closed it yet?

> The output from udevmon is here [1]. vhci_hcd is the device representing the
> USB hub and 2-1 is the bus ID of the attached device.
> 
> As far as I can tell, udevd receives the remove event but, for some
> reason, the /dev entry still remains.

How about enabling debugging in the USB core to see what is going on
with the device removal path?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /dev entry of USB device not disappearing after detach
  2014-02-14 17:35 /dev entry of USB device not disappearing after detach Valentina Manea
  2014-02-14 18:20 ` Greg KH
@ 2014-02-14 18:21 ` Greg KH
  2014-02-15 12:38 ` Valentina Manea
  2014-02-15 16:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-02-14 18:21 UTC (permalink / raw)
  To: linux-hotplug

Adding linux-usb@vger...

On Fri, Feb 14, 2014 at 10:20:11AM -0800, Greg KH wrote:
> On Fri, Feb 14, 2014 at 07:35:31PM +0200, Valentina Manea wrote:
> > Hello,
> > 
> > I am working on a driver for a virtual USB host controller. When I attach a USB
> > device, everything is fine - sysfs files are created, /dev entry is
> > created, device is usable.
> > However, when I detach it, the /dev entry still remains. The sysfs
> > files are removed, as expected. Obviously, the /dev entry is no longer
> > usable, e.g. it can't be used for mounting.
> 
> What /dev entry are you referring to?
> 
> Did something have it held open while the device was still connected and
> hasn't closed it yet?

Also, the kernel is the one now responsible for managing the /dev node
creation/removal, through devtmpfs, there shouldn't be any "hotplug"
scripts involved in this process, so I doubt it's a userspace issue.

you do have CONFIG_DEVTMPFS enabled in your kernel, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /dev entry of USB device not disappearing after detach
  2014-02-14 17:35 /dev entry of USB device not disappearing after detach Valentina Manea
  2014-02-14 18:20 ` Greg KH
  2014-02-14 18:21 ` Greg KH
@ 2014-02-15 12:38 ` Valentina Manea
  2014-02-15 16:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Valentina Manea @ 2014-02-15 12:38 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Feb 14, 2014 at 8:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> Also, the kernel is the one now responsible for managing the /dev node
> creation/removal, through devtmpfs, there shouldn't be any "hotplug"
> scripts involved in this process, so I doubt it's a userspace issue.
>
> you do have CONFIG_DEVTMPFS enabled in your kernel, right?
>

Hi Greg,

It seems I did not have CONFIG_DEVTMPFS and, with this option, the bug
is no longer reproducible. Since, as I've read, devtmpfs has replaced
tmpfs, there's no point in further debugging.

Thanks,
Valentina

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /dev entry of USB device not disappearing after detach
  2014-02-14 17:35 /dev entry of USB device not disappearing after detach Valentina Manea
                   ` (2 preceding siblings ...)
  2014-02-15 12:38 ` Valentina Manea
@ 2014-02-15 16:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-02-15 16:52 UTC (permalink / raw)
  To: linux-hotplug

On Sat, Feb 15, 2014 at 02:38:28PM +0200, Valentina Manea wrote:
> On Fri, Feb 14, 2014 at 8:21 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > Also, the kernel is the one now responsible for managing the /dev node
> > creation/removal, through devtmpfs, there shouldn't be any "hotplug"
> > scripts involved in this process, so I doubt it's a userspace issue.
> >
> > you do have CONFIG_DEVTMPFS enabled in your kernel, right?
> >
> 
> Hi Greg,
> 
> It seems I did not have CONFIG_DEVTMPFS and, with this option, the bug
> is no longer reproducible. Since, as I've read, devtmpfs has replaced
> tmpfs, there's no point in further debugging.

Ok, that makes sense, it wasn't a "bug", it was just that nothing was
around to delete the device node at all (udev no longer does this, it
relies on devtmpfs to be present).  So all was working just fine.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-15 16:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 17:35 /dev entry of USB device not disappearing after detach Valentina Manea
2014-02-14 18:20 ` Greg KH
2014-02-14 18:21 ` Greg KH
2014-02-15 12:38 ` Valentina Manea
2014-02-15 16:52 ` Greg KH

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.