From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Usyskin, Alexander" <alexander.usyskin@intel.com>
Cc: "Abliyev, Reuven" <reuven.abliyev@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [char-misc-next v2 1/5] mei: set parent for char device
Date: Wed, 16 Jul 2025 09:47:20 +0200 [thread overview]
Message-ID: <2025071623-lasso-twenty-9b9a@gregkh> (raw)
In-Reply-To: <CY5PR11MB63668A73BB62B09A30AC10BEED56A@CY5PR11MB6366.namprd11.prod.outlook.com>
On Wed, Jul 16, 2025 at 07:44:28AM +0000, Usyskin, Alexander wrote:
> > 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.
So what is the "parent" of a mei device today?
> I've looked at other drivers - some of them do not have this setup.
Then they are broken, don't copy them :)
thanks,
greg k-h
next prev parent reply other threads:[~2025-07-16 7:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 9:19 [char-misc-next v2 0/5] mei: fix mei_device lifetime Alexander Usyskin
2025-06-30 9:19 ` [char-misc-next v2 1/5] mei: set parent for char device Alexander Usyskin
2025-06-30 10:02 ` Greg Kroah-Hartman
2025-06-30 13:02 ` Usyskin, Alexander
2025-06-30 13:13 ` Greg Kroah-Hartman
2025-07-16 7:44 ` Usyskin, Alexander
2025-07-16 7:47 ` Greg Kroah-Hartman [this message]
2025-07-16 8:09 ` Usyskin, Alexander
2025-06-30 9:19 ` [char-misc-next v2 2/5] mei: make char device control its own lifetime Alexander Usyskin
2025-06-30 17:24 ` Greg Kroah-Hartman
2025-06-30 9:19 ` [char-misc-next v2 3/5] mei: bus: use cldev in prints Alexander Usyskin
2025-06-30 9:19 ` [char-misc-next v2 4/5] mei: more prints with client prefix Alexander Usyskin
2025-06-30 17:25 ` Greg Kroah-Hartman
2025-07-01 10:13 ` Usyskin, Alexander
2025-06-30 9:19 ` [char-misc-next v2 5/5] mei: create dedicated device object Alexander Usyskin
2025-06-30 17:27 ` Greg Kroah-Hartman
2025-07-01 10:55 ` Usyskin, Alexander
2025-06-30 10:02 ` [char-misc-next v2 0/5] mei: fix mei_device lifetime Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025071623-lasso-twenty-9b9a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alexander.usyskin@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reuven.abliyev@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).