linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Elias Oltmanns <eo@nebensachen.de>
Cc: Jeff Garzik <jeff@garzik.org>, linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/2 v3] libata: Implement disk shock protection support
Date: Fri, 19 Sep 2008 21:47:22 -0700	[thread overview]
Message-ID: <48D4805A.3090707@kernel.org> (raw)
In-Reply-To: <20080919214400.7183.64611.stgit@denkblock.local>

Hello, Elias.

Ah... we're so close but no ack yet.  Just a few nits.

It would be nice if there's explanation why action pulling is
necessary in the first place.

> +static inline void ata_eh_pull_park_action(struct ata_port *ap)
> +{
> +	struct ata_link *link;
> +	struct ata_device *dev;
> +	unsigned long flags;
> +
> +	/*
> +	 * All write accesses to &ap->park_req_pending through
> +	 * INIT_COMPLETION() (see below) or complete_all() (see
> +	 * ata_scsi_park_store()) are protected by the host lock. As a
> +	 * result we have that park_req_pending.done is zero on exit
> +	 * from this function, i.e. when ATA_EH_PARK actions for *all*
> +	 * devices on port ap have been pulled into the respective
> +	 * eh_context structs. If, and only if, park_req_pending.done
> +	 * is non-zero by the time we reach
> +	 * wait_for_completion_timeout(), another ATA_EH_PARK action
> +	 * has been scheduled for at least one of the devices on port
> +	 * ap and we have to cycle over the do { } while () loop in
> +	 * ata_eh_recover() again.
> +	 */
...
> +	do {
> +		unsigned long now;
> +
> +		ata_eh_pull_park_action(ap);

How about adding the folloiwng to the above line?
						/* clears park_req_pending */

> +static ssize_t ata_scsi_park_store(struct device *device,
> +				   struct device_attribute *attr,
> +				   const char *buf, size_t len)
> +{
...
> +		complete_all(&ap->park_req_pending);

Sorry to catching this this late but calling complete_all() twice will
overflow the done counter.  I think complete() should just work here,
no?

Thanks.

-- 
tejun


  reply	other threads:[~2008-09-20  4:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-19 21:41 Disk shock protection in libata Elias Oltmanns
2008-09-19 21:46 ` [PATCH 1/2 v3] Introduce ata_id_has_unload() Elias Oltmanns
2008-09-29  4:34   ` Jeff Garzik
2008-09-19 21:48 ` [PATCH 2/2 v3] libata: Implement disk shock protection support Elias Oltmanns
2008-09-20  4:47   ` Tejun Heo [this message]
2008-09-20  5:54     ` Elias Oltmanns
2008-09-20 11:12       ` Elias Oltmanns
2008-09-20 21:44         ` [PATCH 2/2 v4] " Elias Oltmanns
2008-09-20 23:55           ` Tejun Heo
2008-09-21  9:54             ` [PATCH 2/2 v5] " Elias Oltmanns
2008-09-21  9:58               ` Tejun Heo
2008-09-21  9:51       ` [PATCH 2/2 v3] " Elias Oltmanns

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=48D4805A.3090707@kernel.org \
    --to=tj@kernel.org \
    --cc=eo@nebensachen.de \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.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;
as well as URLs for NNTP newsgroup(s).