linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: linux-ide@vger.kernel.org, Alexander Sabourenkov <screwdriver@lxnt.info>
Subject: Re: [PATCH 2.6.24-rc1] sata_promise: fix endianess bug in ASIC PRD bug workaround
Date: Sat, 03 Nov 2007 08:48:33 -0400	[thread overview]
Message-ID: <472C6E21.6020303@garzik.org> (raw)
In-Reply-To: <200710311221.l9VCLTiG008243@harpo.it.uu.se>

Mikael Pettersson wrote:
> The original workaround for the Promise ASIC PRD bug
> contained an endianess bug which I failed to detect:
> the adjustment of the last PRD entry's length field
> applied host arithmetic to little-endian data, which
> is incorrect on big-endian machines.
> 
> We have the length available in host-endian format, so
> do the adjustment on host-endian data and then convert
> and store it in the PRD entry's little-endian data field.
> 
> Thanks to an anonymous reviewer for detecting this bug.
> 
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
> ---
> Jeff: please include this fix in any backport(s) of the
> ASIC PRD bug workaround.
> 
>  drivers/ata/sata_promise.c |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff -rupN linux-2.6.24-rc1/drivers/ata/sata_promise.c linux-2.6.24-rc1.sata_promise-endianess-fix/drivers/ata/sata_promise.c
> --- linux-2.6.24-rc1/drivers/ata/sata_promise.c	2007-10-31 11:47:13.000000000 +0100
> +++ linux-2.6.24-rc1.sata_promise-endianess-fix/drivers/ata/sata_promise.c	2007-10-31 11:47:25.000000000 +0100
> @@ -585,7 +585,7 @@ static void pdc_fill_sg(struct ata_queue
>  			VPRINTK("Splitting last PRD.\n");
>  
>  			addr = le32_to_cpu(ap->prd[idx - 1].addr);
> -			ap->prd[idx - 1].flags_len -= cpu_to_le32(SG_COUNT_ASIC_BUG);
> +			ap->prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG);
>  			VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG);
>  
>  			addr = addr + len - SG_COUNT_ASIC_BUG;
> -

applied



      reply	other threads:[~2007-11-03 12:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 12:21 [PATCH 2.6.24-rc1] sata_promise: fix endianess bug in ASIC PRD bug workaround Mikael Pettersson
2007-11-03 12:48 ` Jeff Garzik [this message]

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=472C6E21.6020303@garzik.org \
    --to=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=screwdriver@lxnt.info \
    /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).