Re: [PATCH v2 18/29] media: mc: Postpone graph object removal until free

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

 



On Tue, Jun 04, 2024 at 10:59:49AM +0000, Sakari Ailus wrote:
> > > @@ -787,42 +812,14 @@ EXPORT_SYMBOL_GPL(__media_device_register);
> > >  
> > >  void media_device_unregister(struct media_device *mdev)
> > >  {
> > > -	struct media_entity *entity;
> > > -	struct media_entity *next;
> > > -	struct media_interface *intf, *tmp_intf;
> > > -	struct media_entity_notify *notify, *nextp;
> > > -
> > >  	if (mdev == NULL)
> > >  		return;
> > >  
> > >  	mutex_lock(&mdev->graph_mutex);
> > > -
> > > -	/* Check if mdev was ever registered at all */
> > >  	if (!media_devnode_is_registered(&mdev->devnode)) {
> > >  		mutex_unlock(&mdev->graph_mutex);
> > 
> > Unless I'm mistaken we don't need to lock the graph mutext to test this,
> > so I think you can drop locking completely here.
> 
> There may be IOCTL calls in progress while unregister takes place. The test
> seems to be fine outside the lock but the section below still needs the
> lock.
> 
> I'll change this for v4.

Indeed the mutex can go, all of the work with the lists was removed by this
patch.

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