public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PRD_ENTRIES is 256
@ 2004-02-25  9:53 William Lee Irwin III
  2004-02-25 13:11 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2004-02-25  9:53 UTC (permalink / raw)
  To: B.Zolnierkiewicz; +Cc: linux-kernel

PRD_ENTRIES is specified to be precisely 256; on platforms where
PAGE_SIZE varies from 4KB the calculation in the current expression
defining it is inaccurate, which may cause crashes. This patch changes
it to the constant literal 256.


-- wli


===== include/linux/ide.h 1.88 vs edited =====
--- 1.88/include/linux/ide.h	Tue Feb 10 07:35:39 2004
+++ edited/include/linux/ide.h	Wed Feb 25 01:46:45 2004
@@ -224,7 +224,7 @@
  * allowing each to have about 256 entries (8 bytes each) from this.
  */
 #define PRD_BYTES       8
-#define PRD_ENTRIES     (PAGE_SIZE / (2 * PRD_BYTES))
+#define PRD_ENTRIES     256
 
 /*
  * Some more useful definitions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PRD_ENTRIES is 256
  2004-02-25  9:53 PRD_ENTRIES is 256 William Lee Irwin III
@ 2004-02-25 13:11 ` Bartlomiej Zolnierkiewicz
  2004-02-25 13:18   ` William Lee Irwin III
  2004-02-25 16:15   ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-02-25 13:11 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel

On Wednesday 25 of February 2004 10:53, William Lee Irwin III wrote:
> PRD_ENTRIES is specified to be precisely 256; on platforms where
> PAGE_SIZE varies from 4KB the calculation in the current expression
> defining it is inaccurate, which may cause crashes. This patch changes
> it to the constant literal 256.

Ok, thanks.  However I cannot find 256 entries limit in any ATA document
and from looking at the code 512 entries shouldn't be a problem (?).

--bart

> -- wli
>
>
> ===== include/linux/ide.h 1.88 vs edited =====
> --- 1.88/include/linux/ide.h	Tue Feb 10 07:35:39 2004
> +++ edited/include/linux/ide.h	Wed Feb 25 01:46:45 2004
> @@ -224,7 +224,7 @@
>   * allowing each to have about 256 entries (8 bytes each) from this.
>   */
>  #define PRD_BYTES       8
> -#define PRD_ENTRIES     (PAGE_SIZE / (2 * PRD_BYTES))
> +#define PRD_ENTRIES     256
>
>  /*
>   * Some more useful definitions


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PRD_ENTRIES is 256
  2004-02-25 13:11 ` Bartlomiej Zolnierkiewicz
@ 2004-02-25 13:18   ` William Lee Irwin III
  2004-02-25 16:15   ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: William Lee Irwin III @ 2004-02-25 13:18 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel

On Wednesday 25 of February 2004 10:53, William Lee Irwin III wrote:
>> PRD_ENTRIES is specified to be precisely 256; on platforms where
>> PAGE_SIZE varies from 4KB the calculation in the current expression
>> defining it is inaccurate, which may cause crashes. This patch changes
>> it to the constant literal 256.

On Wed, Feb 25, 2004 at 02:11:13PM +0100, Bartlomiej Zolnierkiewicz wrote:
> Ok, thanks.  However I cannot find 256 entries limit in any ATA document
> and from looking at the code 512 entries shouldn't be a problem (?).
> --bart

The numbers I'm fishing out of things say that the PRD table can't
exceed 64KB in size as it can't cross a 64KB boundary and its length
is specified as a 16-bit byte count, so some other method of sizing
the thing may be in order. I do recall something went wrong at the
time I ran into this. If I turn up where I thought the number 256 came
from I'll cite it.


-- wli

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PRD_ENTRIES is 256
  2004-02-25 13:11 ` Bartlomiej Zolnierkiewicz
  2004-02-25 13:18   ` William Lee Irwin III
@ 2004-02-25 16:15   ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2004-02-25 16:15 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: William Lee Irwin III, linux-kernel

Bartlomiej Zolnierkiewicz wrote:
> On Wednesday 25 of February 2004 10:53, William Lee Irwin III wrote:
> 
>>PRD_ENTRIES is specified to be precisely 256; on platforms where
>>PAGE_SIZE varies from 4KB the calculation in the current expression
>>defining it is inaccurate, which may cause crashes. This patch changes
>>it to the constant literal 256.
> 
> 
> Ok, thanks.  However I cannot find 256 entries limit in any ATA document
> and from looking at the code 512 entries shouldn't be a problem (?).


I can't find the 256 limit either, but I would swear it exists...  I'll 
ask around.  Certainly it would be nice for lba48 to have larger tables...

	Jeff




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-25 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-25  9:53 PRD_ENTRIES is 256 William Lee Irwin III
2004-02-25 13:11 ` Bartlomiej Zolnierkiewicz
2004-02-25 13:18   ` William Lee Irwin III
2004-02-25 16:15   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox