From: Aaron Lu <aaron.lu@intel.com>
To: Phillip Susi <psusi@ubuntu.com>, linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 2/2] libata: avoid waking disk to check power
Date: Tue, 05 Nov 2013 10:39:27 +0800 [thread overview]
Message-ID: <52785A5F.4060001@intel.com> (raw)
In-Reply-To: <1383612780-6591-2-git-send-email-psusi@ubuntu.com>
+linux-ide
On 11/05/2013 08:53 AM, Phillip Susi wrote:
> When a disk is in SLEEP mode it can not respond to commands,
> including the CHECK POWER command. Instead of waking up the
> sleeping disk, fake the reply to the CHECK POWER command to
> indicate the disk is in standby mode. This prevents udisks
> from waking up sleeping disks when it polls to see if they
> are awake or not before trying to read their smart status.
If the disk entered sleep mode due to runtime PM, then udisks can easily
tell by checking the device's runtime status and not send out the query.
But if the disk entered sleep mode due to other reason, the patch may be
necessary. So what's your scenario?
Best regards,
Aaron
>
> Signed-off-by: Phillip Susi <psusi@ubuntu.com>
> ---
> drivers/ata/libata-core.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 83b1a9f..573d151 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -5084,6 +5084,13 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
>
> /* if device is sleeping, schedule reset and abort the link */
> if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) {
> + if (unlikely(qc->tf.command == ATA_CMD_CHK_POWER))
> + {
> + /* fake reply to avoid waking drive */
> + qc->result_tf.nsect = 0;
> + ata_qc_complete(qc);
> + return;
> + }
> link->eh_info.action |= ATA_EH_RESET;
> ata_ehi_push_desc(&link->eh_info, "waking up from sleep");
> ata_link_abort(link);
>
next prev parent reply other threads:[~2013-11-05 2:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 0:52 [PATCH 1/2] libata: use sleep instead of standby command Phillip Susi
2013-11-05 0:53 ` [PATCH 2/2] libata: avoid waking disk to check power Phillip Susi
2013-11-05 2:39 ` Aaron Lu [this message]
2013-11-05 2:45 ` Phillip Susi
2013-11-05 2:23 ` [PATCH 1/2] libata: use sleep instead of standby command Aaron Lu
2013-11-05 2:39 ` Phillip Susi
2013-11-05 2:44 ` Aaron Lu
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=52785A5F.4060001@intel.com \
--to=aaron.lu@intel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=psusi@ubuntu.com \
--cc=tj@kernel.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