linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Laight" <David.Laight@ACULAB.COM>
To: "Shaohui Xie" <Shaohui.Xie@freescale.com>, <jgarzik@pobox.com>,
	<linux-ide@vger.kernel.org>
Cc: <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	"Anju Bhartiya" <Anju.Bhartiya@freescale.com>
Subject: RE: [PATCH] sata_fsl: add workaround for data length mismatch on freescale V2 controller
Date: Tue, 4 Sep 2012 15:51:26 +0100	[thread overview]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6FD6@saturn3.aculab.com> (raw)
In-Reply-To: <1346756920-19128-1-git-send-email-Shaohui.Xie@freescale.com>

> +	/* Read command completed register */
> +	done_mask = ioread32(hcr_base + CC);
> +
> +	if (host_priv->quirks & SATA_FSL_QUIRK_V2_ERRATA) {
> +		if (unlikely(hstatus & INT_ON_DATA_LENGTH_MISMATCH)) {
> +			for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
> +				qc = ata_qc_from_tag(ap, tag);
> +				if (qc && ata_is_atapi(qc->tf.protocol))
{
> +					atapi_flag = 1;
> +					break;
> +				}
> +			}
> +		}
> +	}
> +
> +	/* Workaround for data length mismatch errata */
> +	if (atapi_flag) {

Seems to me like the conditionals for this code are all
in the wrong order - adding code to the normal path.

The whole lot should probably be inside:
	if (unlikely(hstatus & INT_ON_DATA_LENGTH_MISMATCH)) {
and the 'atapi_flag' boolean removed.

I also wonder it this is worthy of an actual quirk?
Might be worth doing anyway.

	David




  parent reply	other threads:[~2012-09-04 14:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 11:08 [PATCH] sata_fsl: add workaround for data length mismatch on freescale V2 controller Shaohui Xie
2012-09-04 12:00 ` Jenkins, Clive
2012-09-04 14:51 ` David Laight [this message]
2012-09-05  3:20   ` Xie Shaohui-B21989

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=AE90C24D6B3A694183C094C60CF0A2F6026B6FD6@saturn3.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Anju.Bhartiya@freescale.com \
    --cc=Shaohui.Xie@freescale.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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).