linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raul E Rangel <rrangel@chromium.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, groeck@chromium.org, oneukum@suse.com,
	djkurtz@chromium.org, zwisler@chromium.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Dmitry Torokhov <dtor@chromium.org>,
	Suwan Kim <suwan.kim027@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Johan Hovold <johan@kernel.org>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Raul Rangel <rrangel@chromium.org>
Subject: [v2] usb/hcd: Send a uevent signaling that the host controller has died
Date: Wed, 17 Apr 2019 12:31:52 -0600	[thread overview]
Message-ID: <20190417183152.GA118957@google.com> (raw)

On Wed, Apr 17, 2019 at 02:24:06PM -0400, Alan Stern wrote:
> On Wed, 17 Apr 2019, Raul Rangel wrote:
> 
> > > > Also where would be a good place to document this?
> > > 
> > > Documentation/ABI/ is a good start.
> > I'll add something to Documentation/ABI/testing/xhci-uevent
> 
> Your patch will apply to all host controllers, not just xhci.  The
> documentation filename should reflect this.  Perhaps "usb-uevent"?
I realized that after I had sent the email :) I'll do usb-uevent.
> 
> > > Why do you need to lock something that is "dead"?  And why is the idr
> > > lock the correct one here?
> > We need to ensure that root_hub is not null. Though I'm not sure the
> > lock is entirely necessary in this case. usb_remove_hcd stops the work
> > item before it sets the rhdev to null. The reason I picked
> > usb_bus_idr_lock was because it's the same lock that usb_remove_hcd uses
> > when setting rhdev = NULL.
> > 
> > Alan, what do you think? Should I remove the lock?
> 
> You're both right; the lock isn't needed because the work is stopped
> before the root hub gets removed.  Acquiring the lock doesn't do any
> harm, but it isn't needed so you probably should remove it.  In fact, 
> you don't even need to test for whether hcd->self.root_hub is 
> non-NULL.
Sounds good, I'll clean it up.
> 
> Alan Stern
> 
>

WARNING: multiple messages have this Message-ID (diff)
From: Raul Rangel <rrangel@chromium.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, groeck@chromium.org, oneukum@suse.com,
	djkurtz@chromium.org, zwisler@chromium.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Dmitry Torokhov <dtor@chromium.org>,
	Suwan Kim <suwan.kim027@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Johan Hovold <johan@kernel.org>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Raul Rangel <rrangel@chromium.org>
Subject: Re: [PATCH v2] usb/hcd: Send a uevent signaling that the host controller has died
Date: Wed, 17 Apr 2019 12:31:52 -0600	[thread overview]
Message-ID: <20190417183152.GA118957@google.com> (raw)
Message-ID: <20190417183152.Wg2a5jQ3_SBt6fUTpyskVd_v3quRXv8W_seImFj16MU@z> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1904171419260.1400-100000@iolanthe.rowland.org>

On Wed, Apr 17, 2019 at 02:24:06PM -0400, Alan Stern wrote:
> On Wed, 17 Apr 2019, Raul Rangel wrote:
> 
> > > > Also where would be a good place to document this?
> > > 
> > > Documentation/ABI/ is a good start.
> > I'll add something to Documentation/ABI/testing/xhci-uevent
> 
> Your patch will apply to all host controllers, not just xhci.  The
> documentation filename should reflect this.  Perhaps "usb-uevent"?
I realized that after I had sent the email :) I'll do usb-uevent.
> 
> > > Why do you need to lock something that is "dead"?  And why is the idr
> > > lock the correct one here?
> > We need to ensure that root_hub is not null. Though I'm not sure the
> > lock is entirely necessary in this case. usb_remove_hcd stops the work
> > item before it sets the rhdev to null. The reason I picked
> > usb_bus_idr_lock was because it's the same lock that usb_remove_hcd uses
> > when setting rhdev = NULL.
> > 
> > Alan, what do you think? Should I remove the lock?
> 
> You're both right; the lock isn't needed because the work is stopped
> before the root hub gets removed.  Acquiring the lock doesn't do any
> harm, but it isn't needed so you probably should remove it.  In fact, 
> you don't even need to test for whether hcd->self.root_hub is 
> non-NULL.
Sounds good, I'll clean it up.
> 
> Alan Stern
> 
> 

         reply	other threads:[~2019-04-17 18:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 18:52 [v2] usb/hcd: Send a uevent signaling that the host controller has died Raul E Rangel
2019-04-11 18:52 ` [PATCH v2] " Raul E Rangel
2019-04-15 15:56 ` [v2] " Alan Stern
2019-04-15 15:56   ` [PATCH v2] " Alan Stern
2019-04-16  9:54 ` [v2] " Greg Kroah-Hartman
2019-04-16  9:54   ` [PATCH v2] " Greg Kroah-Hartman
2019-04-17 17:53   ` [v2] " Raul E Rangel
2019-04-17 17:53     ` [PATCH v2] " Raul Rangel
2019-04-17 18:24     ` [v2] " Alan Stern
2019-04-17 18:24       ` [PATCH v2] " Alan Stern
2019-04-17 18:31       ` Raul E Rangel [this message]
2019-04-17 18:31         ` Raul Rangel

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=20190417183152.GA118957@google.com \
    --to=rrangel@chromium.org \
    --cc=bigeasy@linutronix.de \
    --cc=djkurtz@chromium.org \
    --cc=dtor@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    --cc=suwan.kim027@gmail.com \
    --cc=zwisler@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 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).