mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: John Keeping <john@metanate.com>
Cc: Lee Jones <lee@kernel.org>, Greg KH <gregkh@linuxfoundation.org>,
	balbi@kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/1] usb: gadget: f_hid: Conduct proper refcounting on shared f_hidg pointer
Date: Fri, 18 Nov 2022 16:07:24 -0500	[thread overview]
Message-ID: <Y3f0DJTOQ/8TVX0h@rowland.harvard.edu> (raw)
In-Reply-To: <Y3e0zAa7+HiNVrKN@donbot>

On Fri, Nov 18, 2022 at 04:37:32PM +0000, John Keeping wrote:
> I don't think it's at all simple to fix this - I posted a series
> addressing the lifetime issues here a few years ago but didn't chase it
> up and there was no feedback:
> 
> 	https://lore.kernel.org/linux-usb/20191028114228.3679219-1-john@metanate.com/
> 
> That includes a patch to remove the embedded struct cdev and manage its
> lifetime separately, which I think is needed as there are two different
> struct device objects here and we cannot tie their lifetimes together.

I still don't have a clear picture of what the real problem is.  Lee's 
original patch description just said "external references are presently 
not tracked", with no details about what those external references are. 
Why not add just proper cdev_get() and cdev_put() calls to whatever code 
handles those external references, so that they _are_ tracked?

What are the two different struct device objects?  Why do their 
lifetimes need to be tied together?  If you do need to tie their 
lifetimes somehow, why not simply make one of them (the one which is 
logically allowed to be shorter-lived) hold a reference to the other?

Alan Stern

  reply	other threads:[~2022-11-18 21:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 12:08 Lee Jones
2022-11-17 12:50 ` Greg KH
2022-11-17 13:26   ` Lee Jones
2022-11-17 17:38     ` Greg KH
2022-11-17 12:50 ` Greg KH
2022-11-17 13:46   ` Lee Jones
2022-11-17 16:47     ` Alan Stern
2022-11-18  8:54       ` Lee Jones
2022-11-18 15:59         ` Alan Stern
2022-11-18 16:37           ` John Keeping
2022-11-18 21:07             ` Alan Stern [this message]
2022-11-20 17:22               ` John Keeping
2022-11-20 20:46                 ` Alan Stern
2022-11-21 12:30                   ` Lee Jones
2022-11-21 12:38                   ` John Keeping
2022-11-21 16:18                     ` Alan Stern
2022-11-21 18:54                       ` John Keeping
2022-11-21 19:17                         ` Alan Stern
2022-11-22 11:52                           ` John Keeping
2022-11-22  8:31                         ` Lee Jones
2022-11-22 11:55                           ` John Keeping
  -- strict thread matches above, loose matches on Subject: below --
2022-10-17 11:27 Lee Jones
2022-10-22 12:52 ` Greg Kroah-Hartman
2022-10-24  7:17   ` Lee Jones

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=Y3f0DJTOQ/8TVX0h@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john@metanate.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®