All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	linux-kernel@vger.kernel.org,
	Douglas Anderson <dianders@chromium.org>,
	linux-usb@vger.kernel.org, Bastien Nocera <hadess@hadess.net>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	devicetree@vger.kernel.org,
	Ravi Chandra Sadineni <ravisadineni@chromium.org>,
	Peter Chen <peter.chen@nxp.com>,
	Stephen Boyd <swboyd@chromium.org>,
	"Alexander A. Klimov" <grandmaster@al2klimov.de>,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: Re: [PATCH v2 2/2] USB: misc: Add onboard_usb_hub driver
Date: Mon, 21 Sep 2020 18:25:38 -0700	[thread overview]
Message-ID: <20200922012538.GF21107@google.com> (raw)
In-Reply-To: <20200922010812.GA1238082@rowland.harvard.edu>

On Mon, Sep 21, 2020 at 09:08:12PM -0400, Alan Stern wrote:
> On Mon, Sep 21, 2020 at 05:41:58PM -0700, Matthias Kaehlcke wrote:
> > > > +	put_device(hub->dev);
> > > 
> > > Is there a matching get_device somewhere (like in _find_onboard_hub)?
> > > If so, I didn't see it.  And I don't see any reason for it.
> > 
> > Yes, implicitly, of_find_device_by_node() "takes a reference to the
> > embedded struct device which needs to be dropped after use."
> 
> Okay.  In that case it probably would be better to do the put_device()
> right away, at the end of _find_onboard_hub().

ok

> There would be no danger of the platform device getting freed too soon 
> if you make onboard_hub_remove unbind the associated USB hub devices.

Yes, I'll add the unbinding as you suggested earlier

> But there would still be a danger of those devices somehow getting 
> rebound again at the wrong time; this suggests that you should add a 
> flag to the onboard_hub structure saying that the platform device is 
> about to go away.

Indeed, we want to avoid that. I'll add a flag to the struct as you
suggested.

  reply	other threads:[~2020-09-22  1:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 18:46 [PATCH v2 1/2] dt-bindings: usb: Add binding for onboard USB hubs Matthias Kaehlcke
2020-09-17 18:46 ` [PATCH v2 2/2] USB: misc: Add onboard_usb_hub driver Matthias Kaehlcke
2020-09-17 19:54   ` Alan Stern
2020-09-22  0:41     ` Matthias Kaehlcke
2020-09-22  1:08       ` Alan Stern
2020-09-22  1:25         ` Matthias Kaehlcke [this message]
2020-09-18  1:30   ` Peter Chen
2020-09-22  0:57     ` Matthias Kaehlcke
2020-09-20 14:17   ` Greg Kroah-Hartman
2020-09-22  1:18     ` Matthias Kaehlcke
2020-09-23 22:25       ` Matthias Kaehlcke
2020-09-24  6:36         ` Greg Kroah-Hartman
2020-09-18 17:30 ` [PATCH v2 1/2] dt-bindings: usb: Add binding for onboard USB hubs Rob Herring

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=20200922012538.GF21107@google.com \
    --to=mka@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=frowand.list@gmail.com \
    --cc=grandmaster@al2klimov.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=ravisadineni@chromium.org \
    --cc=robh+dt@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swboyd@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.