linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] libata-core Use more robust parsing for multi_count
Date: Wed, 18 Mar 2009 11:58:04 -0400	[thread overview]
Message-ID: <49C11A0C.3070502@rtr.ca> (raw)
In-Reply-To: <49C1047D.4000008@rtr.ca>

Mark Lord wrote:
> Gents,
> 
> I am debugging a drive hang issue for a client,
> which involves "multiple sector" read/write commands (PIO).
> 
> Libata does not appear (as of current #upstream at least)
> to correctly implement this functionality.
> 
> Specifically, libata doesn't reset dev->multi_count to zero
> on drive resets (whereas the drive firmware often *does*),
> and libata does not deal well with dubious IDENTIFY data.
> 
> So, on resets, we should either clear dev->multi_count,
> or re-probe it from the drive, or issue a SET_MULTIPLE command
> to restore the old value.
> 
> When probing:
> 
> If (dev->id[59] == 0xffff), ignore it.
> If (dev->id[59] & 0x00ff) is not an even power of two, ignore it.
> it should also be ignored (this catches the 0xffff case too).
> 
> The powers of two is from the ATA8 standard, which strongly suggests
> that only powers of two are valid for use with SET_MULTIPLE.
> 
> The probe stuff is trivial to fix (below), but I'm not really
> up to speed on figuring out how to get this code re-invoked
> after drive resets, and on how to ensure that a SET_MULTIPLE
> gets issued to restore the previous working value (with eventual
> fallback to not using it after repeated errors).   Tejun?
..

Mmm.. we also have to re-check and/or re-set dev->multi_count
after any ata_acpi_on_devcfg() call, because some machines use
ACPI taskfiles to issue a "set multi_count" command to the drive.

This appears to be taken care of already though,
as as ata_dev_configure() is where we now invoke ata_acpi_on_devcfg(),
and this all gets called from ata_dev_revalidate().

So with the patch I provided, newer kernels should then be fine.
But I suppose the patch itself could also be even more finicky
about things, and not bother with R/W multi commands if multi_count==1,
and also validate multi_count against the drive's reported maximum 
from ID word 47.

Alan:  do you reckon we'll be fine enough by just checking
that word on its own, or would its interpretation depend upon
the supported ATA revisions of the device?  If so, then so would
the rest of the mult_count support in libata, right?

I'll re-spin a v3 of the patch to check against word 47.

Cheers

  parent reply	other threads:[~2009-03-18 15:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 14:26 [PATCH] libata-core Use more robust parsing for multi_count Mark Lord
2009-03-18 14:32 ` Alan Cox
2009-03-18 15:06   ` Mark Lord
2009-03-18 15:13     ` Mark Lord
2009-03-18 17:09     ` Alan Cox
2009-03-18 15:58 ` Mark Lord [this message]
2009-03-18 16:18   ` [PATCH] libata-core More robust parsing for multi_count(v3) Mark Lord
2009-03-18 16:24     ` Mark Lord
2009-03-19  0:23     ` Tejun Heo
2009-03-19  0:25       ` Tejun Heo
2009-03-19 17:30         ` [PATCH] libata-core More robust parsing for multi_count(v4) Mark Lord
2009-03-19 17:32           ` [PATCH] libata-core More robust parsing for multi_count(v5) Mark Lord
2009-03-19 23:33             ` Tejun Heo
2009-03-20  3:37               ` Mark Lord
2009-03-20 13:13               ` Mark Lord
2009-03-20 13:14                 ` Mark Lord
2009-03-20 14:07                   ` Alan Cox
2009-03-20 15:36                     ` Mark Lord
2009-03-20 23:14                       ` Tejun Heo
2009-03-21  0:54                         ` Jeff Garzik
2009-03-21  2:17                           ` Tejun Heo
2009-03-21 13:54                             ` Mark Lord
2009-03-21 14:02                           ` Alan Cox
2009-03-21 14:59                             ` Mark Lord
2009-03-20 13:38                 ` Alan Cox
2009-04-12 15:10                 ` Mark Lord
2009-04-12 15:18                   ` Alan Cox
2009-04-12 15:31                     ` Jeff Garzik
2009-03-25  2:40             ` Jeff Garzik

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=49C11A0C.3070502@rtr.ca \
    --to=liml@rtr.ca \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --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).