public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: jgarzik@pobox.com, linux-kernel@vger.kernel.org
Subject: [PATCH] libata: Don't believe bogus claims in the older PIO mode register
Date: Fri, 29 Sep 2006 18:26:47 +0100	[thread overview]
Message-ID: <1159550807.13029.43.camel@localhost.localdomain> (raw)

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-mm2/drivers/ata/libata-core.c linux-2.6.18-mm2/drivers/ata/libata-core.c
--- linux.vanilla-2.6.18-mm2/drivers/ata/libata-core.c	2006-09-28 14:33:46.000000000 +0100
+++ linux-2.6.18-mm2/drivers/ata/libata-core.c	2006-09-29 17:33:53.000000000 +0100
@@ -870,7 +870,11 @@
 		 * the PIO timing number for the maximum. Turn it into
 		 * a mask.
 		 */
-		pio_mask = (2 << (id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ;
+		u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF;
+		if( mode < 5)	/* Valid PIO range */
+                	pio_mask = (2 << mode) - 1 ;
+		else
+			pio_mask = 1;
 
 		/* But wait.. there's more. Design your standards by
 		 * committee and you too can get a free iordy field to


             reply	other threads:[~2006-09-29 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29 17:26 Alan Cox [this message]
2006-10-05 10:55 ` [PATCH] libata: Don't believe bogus claims in the older PIO mode register 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=1159550807.13029.43.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@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