linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Martin Kepplinger <martin.kepplinger@puri.sm>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: Microchip USB2642 Hub not resuming from USB autosuspend
Date: Wed, 24 Jun 2020 10:45:13 -0400	[thread overview]
Message-ID: <20200624144513.GB214996@rowland.harvard.edu> (raw)
In-Reply-To: <db8405e4-3026-9b3e-3e00-169b3559cac2@puri.sm>

[CC: list drastically trimmed]

On Wed, Jun 24, 2020 at 09:22:42AM +0200, Martin Kepplinger wrote:
> On 23.06.20 16:54, Alan Stern wrote:
> > I don't understand this.  As far as I know, runtime-PM support in the SCSI 
> > and block layers has been complete for many years.  If you have to do 
> > anything extra (like applying the patch in the email you mentioned) then 
> > something is broken.  The device should be able to go into runtime suspend 
> > just fine with the current code -- even when a file system is mounted.
> > 
> 
> The scsi and usb layers have good implementations for runtime pm for a
> long time indeed. The scsi drivers though vary: for example sr indeed
> suspends when unused, when mounted and open too.
> 
> look at the sd driver in comparison though: From what I see, it "uses"
> autopm (runtime pm) as it would let the device suspend, but never
> resumes from it (except when removing and probing again). My suspicion
> is that it's not really used for that reason.
> 
> I might be wrong of course - I usually don't look at scsi code and I'm
> so thankful for feedback. That's what I read though and also what my
> tests verify. Hence the patch to the sd driver that makes enabling
> runtime pm result in a usable device (granted, not yet saving as much
> power as it really could, but that can be added later).

I haven't looked at this code or tested it for a long time, so maybe it 
isn't working properly.

Still, here's the general idea of how it's _intended_ to work: The 
runtime PM control for sd lies not in the sd driver itself but in the 
block layer core.  If a SCSI drive is suspended when a block request is 
issued, the block layer initiates a runtime resume.  See the kerneldoc for 
blk_pm_runtime_init() and the following functions in block/blk-pm.c.

If you need a more detailed explanation, please ask.

Alan Stern

      reply	other threads:[~2020-06-24 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  7:04 Microchip USB2642 Hub not resuming from USB autosuspend Martin Kepplinger
2020-06-10 10:25 ` Martin Kepplinger
2020-06-23 13:48 ` Martin Kepplinger
2020-06-23 14:54   ` Alan Stern
2020-06-24  7:22     ` Martin Kepplinger
2020-06-24 14:45       ` Alan Stern [this message]

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=20200624144513.GB214996@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.kepplinger@puri.sm \
    /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).