public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Bug: media device controller node not removed when uvc device is unplugged
@ 2018-06-07 12:07 Torleiv Sundre
  2018-06-07 15:30 ` Nicolas Dufresne
  2018-06-08 12:34 ` Laurent Pinchart
  0 siblings, 2 replies; 3+ messages in thread
From: Torleiv Sundre @ 2018-06-07 12:07 UTC (permalink / raw)
  To: linux-media

Hi,

Every time I plug in a UVC camera, a media controller node is created at 
/dev/media<N>.

In Ubuntu 17.10, running kernel 4.13.0-43, the media controller device 
node is removed when the UVC camera is unplugged.

In Ubuntu 18.10, running kernel 4.15.0-22, the media controller device 
node is not removed. For every time I plug the device, a new device node 
with incremented minor number is created, leaving me with a growing list 
of media controller device nodes. If I repeat for long enough, I get the 
following error:
"media: could not get a free minor"
I also tried building a kernel from mainline, with the same result.

I'm running on x86_64.

Torleiv Sundre

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

* Re: Bug: media device controller node not removed when uvc device is unplugged
  2018-06-07 12:07 Bug: media device controller node not removed when uvc device is unplugged Torleiv Sundre
@ 2018-06-07 15:30 ` Nicolas Dufresne
  2018-06-08 12:34 ` Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dufresne @ 2018-06-07 15:30 UTC (permalink / raw)
  To: Torleiv Sundre, linux-media

Le jeudi 07 juin 2018 à 14:07 +0200, Torleiv Sundre a écrit :
> Hi,
> 
> Every time I plug in a UVC camera, a media controller node is created at 
> /dev/media<N>.
> 
> In Ubuntu 17.10, running kernel 4.13.0-43, the media controller device 
> node is removed when the UVC camera is unplugged.
> 
> In Ubuntu 18.10, running kernel 4.15.0-22, the media controller device 
> node is not removed. For every time I plug the device, a new device node 
> with incremented minor number is created, leaving me with a growing list 
> of media controller device nodes. If I repeat for long enough, I get the 
> following error:
> "media: could not get a free minor"
> I also tried building a kernel from mainline, with the same result.
> 
> I'm running on x86_64.

I also observe this on 4.17.

> 
> Torleiv Sundre

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

* Re: Bug: media device controller node not removed when uvc device is unplugged
  2018-06-07 12:07 Bug: media device controller node not removed when uvc device is unplugged Torleiv Sundre
  2018-06-07 15:30 ` Nicolas Dufresne
@ 2018-06-08 12:34 ` Laurent Pinchart
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2018-06-08 12:34 UTC (permalink / raw)
  To: Torleiv Sundre; +Cc: linux-media

Hi Torleiv,

On Thursday, 7 June 2018 15:07:24 EEST Torleiv Sundre wrote:
> Hi,
> 
> Every time I plug in a UVC camera, a media controller node is created at
> /dev/media<N>.
> 
> In Ubuntu 17.10, running kernel 4.13.0-43, the media controller device
> node is removed when the UVC camera is unplugged.
> 
> In Ubuntu 18.10, running kernel 4.15.0-22, the media controller device
> node is not removed. For every time I plug the device, a new device node
> with incremented minor number is created, leaving me with a growing list
> of media controller device nodes. If I repeat for long enough, I get the
> following error:
> "media: could not get a free minor"
> I also tried building a kernel from mainline, with the same result.

Thank you for the report. I'm sorry about that :-S It's a known issue, and a 
fix is already present in Linus' tree, on its way to v4.18-rc1.

commit f9ffcb0a21e1fa8e64d09ed613d884e054ae8191
Author: Philipp Zabel <philipp.zabel@gmail.com>
Date:   Mon May 21 06:24:58 2018 -0400

    media: uvcvideo: Fix driver reference counting

It should then get backported to stable releases.

If you have time, could you try to apply that commit on top of mainline and 
see if it fixes the problem for you ?

> I'm running on x86_64.

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2018-06-08 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-07 12:07 Bug: media device controller node not removed when uvc device is unplugged Torleiv Sundre
2018-06-07 15:30 ` Nicolas Dufresne
2018-06-08 12:34 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox