Re: [PATCH v4 22/26] media: mc: Maintain a list of open file handles in a media device

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

 



Hi Hans,

On Tue, Jun 18, 2024 at 07:35:45AM +0200, Hans Verkuil wrote:
> On 17/06/2024 19:46, Sakari Ailus wrote:
> > Hi Hans,
> > 
> > On Mon, Jun 17, 2024 at 11:57:20AM +0200, Hans Verkuil wrote:
> >> On 10/06/2024 12:05, Sakari Ailus wrote:
> >>> @@ -830,6 +843,10 @@ void media_device_unregister(struct media_device *mdev)
> >>>  	if (!media_devnode_is_registered(&mdev->devnode))
> >>>  		return;
> >>>  
> >>> +	spin_lock_irq(&mdev->fh_list_lock);
> >>> +	list_del_init(&mdev->fh_list);
> >>> +	spin_unlock_irq(&mdev->fh_list_lock);
> >>
> >> Huh? This doesn't make sense to me. Unregistering the media device
> >> makes no difference to the list of open filehandles.
> > 
> > Right, I agree with that.
> > 
> > Presumably the list will be empty at release time. I think I'll drop this
> > and add a sanity check for the list.
> 
> Why would it be empty? You can have multiple fhs open when
> media_device_unregister is called. But that's fine, eventually all fhs
> will be closed.

By "release" I meant device's (memory) release callback, i.e. no file
handles to the device would remain open by that time.

-- 
Regards,

Sakari Ailus




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux