From: Oliver Neukum <oneukum@suse.de>
To: "Brandt, Todd E" <todd.e.brandt@intel.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Tejun Heo <tj@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH v2] Hard disk S3 resume time optimization
Date: Fri, 09 Aug 2013 09:25:47 +0200 [thread overview]
Message-ID: <1376033147.1902.6.camel@linux-fkkt.site> (raw)
In-Reply-To: <11E08D716F0541429B7042699DD5C1A170680F5C@FMSMSX103.amr.corp.intel.com>
On Fri, 2013-08-09 at 01:09 +0000, Brandt, Todd E wrote:
> static struct ata_force_ent *ata_force_tbl;
> static int ata_force_tbl_size;
> +int ata_resume_status;
A single global variable for multiple ports?
> static char ata_force_param_buf[PAGE_SIZE] __initdata;
> /* param_buf is thrown away after initialization, disallow read */
> @@ -5415,6 +5416,22 @@ static int ata_port_resume(struct device *dev)
> return rc;
> }
>
> +static int ata_port_resume_async(struct device *dev)
> +{
> + struct ata_port *ap = to_ata_port(dev);
> +
> + ata_resume_status = 0;
> + ata_port_request_pm(ap, PMSG_RESUME, ATA_EH_RESET,
> + ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, &ata_resume_status);
If this ever runs in paralell it is extremely racy.
> + if (!ata_resume_status) {
> + pm_runtime_disable(dev);
> + pm_runtime_set_active(dev);
> + pm_runtime_enable(dev);
> + }
> +
> + return ata_resume_status;
> +}
> +
> + req = blk_get_request(sdkp->device->request_queue, 0, __GFP_WAIT);
What happens if commands go to the device before this has finished?
Especially should it fail.
Regards
Oliver
next prev parent reply other threads:[~2013-08-09 7:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 1:09 [PATCH v2] Hard disk S3 resume time optimization Brandt, Todd E
2013-08-09 7:25 ` Oliver Neukum [this message]
2013-08-09 20:38 ` Brandt, Todd E
2013-08-09 18:06 ` Alan Stern
2013-08-09 20:44 ` Brandt, Todd E
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=1376033147.1902.6.camel@linux-fkkt.site \
--to=oneukum@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=tj@kernel.org \
--cc=todd.e.brandt@intel.com \
/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).