mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "dbasehore ." <dbasehore@chromium.org>
Cc: Linux-pm mailing list <linux-pm@vger.kernel.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] scsi: allow scsi devices to use direct complete
Date: Mon, 29 Feb 2016 12:10:09 +0200	[thread overview]
Message-ID: <20160229101009.GE1770@lahna.fi.intel.com> (raw)
In-Reply-To: <CAGAzgsrzwO_uCLeJWnqfZXGbv8Ex=i_jfQ=W9AhqEdv0-uuN-w@mail.gmail.com>

On Sat, Feb 27, 2016 at 01:07:06AM -0800, dbasehore . wrote:
> That's an interesting question. Part of direct complete is to leave
> the device runtime suspended even after the system resumes if
> possible. The comments in pm_complete_with_resume_check indicate that
> the firmware may resume a device. I could see this happening with some
> kind of SCSI device.
> 
> If this is possible, are we able to put the device back into a
> consistent state (runtime suspended) by calling suspend for the scsi
> device? If not, we might need to use pm_complete_with_resume_check for
> the complete callback.

To me the latter option sounds safer.

I tried this series (as I'm interested in AHCI host controller runtime
PM) and noticed possible issue.

I have following two additional patches from linux-next applied to get
system resume working (otherwise resume is never finished):

  d07ab6d11477 block: Add blk_set_runtime_active()
  356fd2663cff scsi: Set request queue runtime PM status back to active on resume

Then I do this:

  # echo auto > /sys/block/sda/device/power/control
  # echo 5000 > /sys/block/sda/device/power/autosuspend_delay_ms

  # echo auto > /sys/bus/pci/devices/0000\:00\:12.0/ata1/power/control

The last line unblocks runtime PM from the parent device.

After 5 seconds of idle I see that the disk gets runtime suspended:

  [  566.858971] sd 0:0:0:0: [sda] Synchronizing SCSI cache
  [  567.049288] sd 0:0:0:0: [sda] Stopping disk

Now suspend the machine:

  # rtcwake -s10 -mmem

Once the system resumes I get this:

  [  668.879149] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
  [  668.927319] ata1.00: configured for UDMA/133
  [  669.392246] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
  [  669.440427] ata1.00: configured for UDMA/133
  [  669.445352] sd 0:0:0:0: [sda] Starting disk
  [  669.464647] sda: detected capacity change from 0 to 240057409536
  [  669.482596] sda: detected capacity change from 0 to 240057409536

It looks like we get resumed two times. If I have this patch reverted I
can see it happening only once. Also with the patch applied and if the
parent device has runtime PM blocked, it happens only once.

      reply	other threads:[~2016-02-29 10:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  0:22 [PATCH v2 1/3] PM / sleep: Check legacy pm callbacks for " Derek Basehore
2016-02-25  0:22 ` [PATCH v2 2/3] PM / sleep: try to runtime suspend " Derek Basehore
2016-02-28  1:31   ` Rafael J. Wysocki
2016-03-01 21:48     ` dbasehore .
2016-02-25  0:22 ` [PATCH v2 3/3] scsi: allow scsi devices to use " Derek Basehore
2016-02-27  7:26   ` Mika Westerberg
2016-02-27  8:10     ` dbasehore .
2016-02-27  8:38       ` Mika Westerberg
2016-02-27  9:07         ` dbasehore .
2016-02-29 10:10           ` Mika Westerberg [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=20160229101009.GE1770@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=dbasehore@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /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

all inboxes | Powered by JetHome®