[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY5PR11MB63668A73BB62B09A30AC10BEED56A@CY5PR11MB6366.namprd11.prod.outlook.com>
Date: Wed, 16 Jul 2025 07:44:28 +0000
From: "Usyskin, Alexander" <alexander.usyskin@...el.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: "Abliyev, Reuven" <reuven.abliyev@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [char-misc-next v2 1/5] mei: set parent for char device
> Subject: Re: [char-misc-next v2 1/5] mei: set parent for char device
>
> On Mon, Jun 30, 2025 at 01:02:12PM +0000, Usyskin, Alexander wrote:
> > > Subject: Re: [char-misc-next v2 1/5] mei: set parent for char device
> > >
> > > On Mon, Jun 30, 2025 at 12:19:38PM +0300, Alexander Usyskin wrote:
> > > > Connect char device to parent device to avoid
> > > > parent device unload while char device is
> > > > still held open by user-space.
> > >
> > > No, that's not what cdev_set_parent() does.
> > >
> > https://elixir.bootlin.com/linux/v6.16-rc3/source/fs/char_dev.c#L511
> > * cdev_set_parent() sets a parent kobject which will be referenced
> > * appropriately so the parent is not freed before the cdev. This
> > * should be called before cdev_add.
> >
> > This is what written there. Is my interpretation wrong?
>
> It has nothing to do with a char device being open or closed from
> userspace, it has to deal with properly placing the device in the
> kobject tree and the object references being correct.
>
> Surely the mei device had this set up before, right? If not, how did
> sysfs look with these char devices with no real parent?
>
Mei device never had this setup.
I've looked at other drivers - some of them do not have this setup.
- -
Thanks,
Sasha
> thanks,
>
> greg k-h
Powered by blists - more mailing lists