linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kepplinger <martin.kepplinger@puri.sm>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "mathias.nyman@intel.com" <mathias.nyman@intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	nicolas.ferre@microchip.com, ludovic.desroches@microchip.com,
	cristian.birsan@microchip.com, iain.galloway@nxp.com,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"kernel@puri.sm" <kernel@puri.sm>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: Microchip USB2642 Hub not resuming from USB autosuspend
Date: Wed, 24 Jun 2020 09:22:42 +0200	[thread overview]
Message-ID: <db8405e4-3026-9b3e-3e00-169b3559cac2@puri.sm> (raw)
In-Reply-To: <20200623145453.GA178927@rowland.harvard.edu>

On 23.06.20 16:54, Alan Stern wrote:
> On Tue, Jun 23, 2020 at 03:48:01PM +0200, Martin Kepplinger wrote:
> 
>> We've resolved this issue too. When scsi (sd) runtime pm is not enabled
>> by default, it needs to be enabled of course and events_dfl_poll_msecs
>> for the block layer set to 0.
> 
> Actually that last step isn't needed.  But if you don't do it, the device 
> will wake up from runtime suspend every time the block layer polls it.  So 
> you probably do want to either turn off polling or increase the polling 
> interval significantly.

true, thanks for pointing that out. a long interval is totally an option
too.

> 
>> scsi sd has until now incomplete support for runtime pm and this
>> addition makes it work, i.e. suspend when not mounted:
>> https://lore.kernel.org/linux-scsi/20200623111018.31954-1-martin.kepplinger@puri.sm/T/
>> the whole USB path is suspended as a consequence - and woken up if opened.
> 
> 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).

so thanks for your feedback again,

                                 martin


> Alan Stern
> 

  reply	other threads:[~2020-06-24  7:23 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 [this message]
2020-06-24 14:45       ` Alan Stern

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=db8405e4-3026-9b3e-3e00-169b3559cac2@puri.sm \
    --to=martin.kepplinger@puri.sm \
    --cc=balbi@kernel.org \
    --cc=cristian.birsan@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iain.galloway@nxp.com \
    --cc=kernel@puri.sm \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=mathias.nyman@intel.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=p.zabel@pengutronix.de \
    --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).