[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025063030-surprise-blinker-89f8@gregkh>
Date: Mon, 30 Jun 2025 15:13:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: "Usyskin, Alexander" <alexander.usyskin@...el.com>
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
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?
thanks,
greg k-h
Powered by blists - more mailing lists