linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@arm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Oliver Neukum <oneukum@suse.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	USB list <linux-usb@vger.kernel.org>,
	Linux-pm mailing list <linux-pm@vger.kernel.org>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: lockdep warning in urb.c:363 usb_submit_urb
Date: Thu, 26 Mar 2020 12:27:45 +0000	[thread overview]
Message-ID: <20200326122744.kbtlmev2ravn3wey@e107158-lin> (raw)
In-Reply-To: <CAJZ5v0gqNnoT41=Vm7AtbH8PMW+qPGighK7Up3q2rS+B0jBKFg@mail.gmail.com>

On 03/25/20 22:28, Rafael J. Wysocki wrote:
> On Wed, Mar 25, 2020 at 9:49 PM Alan Stern <stern@rowland.harvard.edu> wrote:
> >
> > On Wed, 25 Mar 2020, Qais Yousef wrote:
> >
> > > Thanks for all the hints Alan.
> > >
> > > I think I figured it out, the below patch seems to fix it for me. Looking
> > > at other drivers resume functions it seems we're missing the
> > > pm_runtime_disable()->set_active()->enable() dance. Doing that fixes the
> > > warning and the dev_err() in driver/base/power.
> >
> > Ah, yes.  This should have been added years ago; guess I forgot.  :-(
> >
> > > I don't see xhci-plat.c doing that, I wonder if it needs it too.
> > >
> > > I'm not well versed about the details and the rules here. So my fix could be
> > > a hack, though it does seem the right thing to do.
> > >
> > > I wonder why the power core doesn't handle this transparently..
> >
> > Initially, we didn't want the PM core to do this automatically because
> > we thought some devices might want to remain runtime-suspended
> > following a system resume, and only the device driver would know what
> > to do.
> >
> > Raphael, now that we have the direct_complete mechanism, can we revisit
> > this?  Should the PM core automatically call pm_runtime_set_active() if
> > dev->power.direct_complete isn't set?  Perhaps in device_resume_early()
> > prior to the pm_runtime_enable() call?
> >
> > It's possible we discussed this and decided against it at the time when
> > direct_complete was added, but if so I don't remember what was said.
> 
> Me neither. :-)
> 
> That said complexity has grown since then and there are the
> DPM_FLAG_SMART_SUSPEND and DPM_FLAG_LEAVE_SUSPENDED flags that can be
> used to control that behavior to some extent.
> 
> Setting DPM_FLAG_SMART_SUSPEND alone, in particular, causes
> pm_runtime_set_active() to be called at the noirq stage of device
> resume either by the core or by bus types (e.g. PCI) etc.
> 
> It looks like ohci-platform might use DPM_FLAG_SMART_SUSPEND, but I
> need to take a closer look at that (possibly later this week).

Okay I take it this was root caused correctly and now it's a question of which
is a better fix.

Thanks!

--
Qais Yousef

  reply	other threads:[~2020-03-26 12:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200325150017.xhabucfo3v6i234o@e107158-lin>
2020-03-25 20:49 ` lockdep warning in urb.c:363 usb_submit_urb Alan Stern
2020-03-25 21:28   ` Rafael J. Wysocki
2020-03-26 12:27     ` Qais Yousef [this message]
2020-03-27 20:45       ` Alan Stern
2020-03-28 14:15         ` Rafael J. Wysocki
2020-03-28 19:58           ` Alan Stern
2020-03-29  9:16             ` Rafael J. Wysocki
2020-03-29 13:56               ` Rafael J. Wysocki
2020-03-29 16:27               ` Alan Stern
2020-04-03 15:04                 ` Rafael J. Wysocki
2020-04-03 16:13                   ` Rafael J. Wysocki
2020-04-03 16:41                   ` Alan Stern
2020-04-03 18:32                     ` Rafael J. Wysocki
2020-04-03 20:15                       ` Alan Stern
2020-04-06 16:45                         ` Rafael J. Wysocki
2020-04-06 20:25                           ` Alan Stern
2020-04-09 18:45                             ` Rafael J. Wysocki
2020-04-11  2:41                               ` Alan Stern
2020-04-13 21:32                                 ` Rafael J. Wysocki
2020-04-14 13:43                                   ` Rafael J. Wysocki
2020-04-14 17:47                                     ` Alan Stern
2020-04-15 22:20                                       ` Rafael J. Wysocki
2020-04-16 15:18                                         ` Alan Stern
2020-04-17  9:57                                           ` Rafael J. Wysocki
2020-04-17 16:10                                             ` Alan Stern
2020-04-17 21:54                                               ` Rafael J. Wysocki
2020-04-17 23:37                                                 ` Alan Stern
2020-04-18  9:40                                                   ` Rafael J. Wysocki
2020-04-03 17:08                 ` Rafael J. Wysocki
2020-04-20 20:26   ` Alan Stern
2020-04-21 11:15     ` Qais Yousef

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=20200326122744.kbtlmev2ravn3wey@e107158-lin \
    --to=qais.yousef@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    /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).