ide.h cleanup, 2.5.47

ide.h cleanup, 2.5.47

Post by Matti Annal » Sun, 17 Nov 2002 11:10:06



The patch below performs minor cleanups on the include/linux/ide.h header. It
simplifies the use of endianness #ifdefs and removes a chunk of duplicated
code.

Comments?

--------------------------------------------------------------------------------

diff -ur linux-2.5.47/include/linux/ide.h difflinux/include/linux/ide.h
--- linux-2.5.47/include/linux/ide.h 2002-11-10 20:07:26.000000000 +0200

 #include <asm/hdreg.h>
 #include <asm/io.h>

+#if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
+#error "Please fix <asm/byteorder.h>"
+#endif
+
 /*
  * This is the multiple IDE interface driver, as evolved from hd.c.

  * so the two PRD tables (ide0 & ide1) will each get half of that,
  * allowing each to have about 256 entries (8 bytes each) from this.
  */
-#define PRD_BYTES       8
-#define PRD_ENTRIES     (PAGE_SIZE / (2 * PRD_BYTES))
-
-/*
- * Our Physical Region Descriptor (PRD) table should be large enough
- * to handle the biggest I/O request we are likely to see.  Since requests
- * can have no more than 256 sectors, and since the typical blocksize is
- * two or more sectors, we could get by with a limit of 128 entries here for
- * the usual worst case.  Most requests seem to include some contiguous blocks,
- * further reducing the number of table entries required.
- *
- * The driver reverts to PIO mode for individual requests that exceed
- * this limit (possible with 512 byte blocksizes, eg. MSDOS f/s), so handling
- * 100% of all crazy scenarios here is not necessary.
- *
- * As it turns out though, we must allocate a full 4KB page for this,
- * so the two PRD tables (ide0 & ide1) will each get half of that,
- * allowing each to have about 256 entries (8 bytes each) from this.
- */
 #define PRD_BYTES 8
 #define PRD_ENTRIES (PAGE_SIZE / (2 * PRD_BYTES))

   unsigned set_tune : 1;
   unsigned serviced : 1;
   unsigned reserved : 3;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned reserved : 3;
   unsigned serviced : 1;
   unsigned set_tune : 1;
   unsigned set_multmode : 1;
   unsigned recalibrate : 1;
   unsigned set_geometry : 1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

 #if defined(__LITTLE_ENDIAN_BITFIELD)
   unsigned low  :8; /* LSB */
   unsigned high  :8; /* MSB */
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned high  :8; /* MSB */
   unsigned low  :8; /* LSB */
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned mce  :1;
   unsigned ecc  :1;
   unsigned bdd  :1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned bdd  :1;
   unsigned ecc  :1;

   unsigned abrt  :1;
   unsigned tzero  :1;
   unsigned mark  :1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned bit5  : 1;
   unsigned lba  : 1;
   unsigned bit7  : 1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned bit7  : 1;
   unsigned lba  : 1;
   unsigned bit5  : 1;
   unsigned unit  : 1;
   unsigned head  : 4;
 #else
-#error "Please fix <asm/byteorder.h>"
-#endif
  } b;
 } select_t, ata_select_t;

   unsigned df  :1;
   unsigned drdy  :1;
   unsigned bsy  :1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned bsy  :1;
   unsigned drdy  :1;

   unsigned corr           :1;
   unsigned idx  :1;
   unsigned check  :1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned bit3  : 1;
   unsigned reserved456 : 3;
   unsigned HOB  : 1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned HOB  : 1;
   unsigned reserved456 : 3;
   unsigned bit3  : 1;
   unsigned SRST  : 1;
   unsigned nIEN  : 1;
   unsigned bit0  : 1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned reserved321 :3;
   unsigned reserved654 :3;
   unsigned reserved7 :1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned reserved7 :1;
   unsigned reserved654 :3;
   unsigned reserved321 :3;
   unsigned dma  :1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned cod  :1;
   unsigned io  :1;
   unsigned reserved :6;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned reserved :6;
   unsigned io  :1;
   unsigned cod  :1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned abrt  :1;
   unsigned mcr  :1;
   unsigned sense_key :4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned sense_key :4;
   unsigned mcr  :1;
   unsigned abrt  :1;
   unsigned eom  :1;
   unsigned ili  :1;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;

   unsigned one5  :1;
   unsigned reserved6 :1;
   unsigned one7  :1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
+#else
   unsigned one7  :1;
   unsigned reserved6 :1;
   unsigned one5  :1;
   unsigned drv  :1;
   unsigned reserved3 :1;
   unsigned sam_lun :3;
-#else
-#error "Please fix <asm/byteorder.h>"
 #endif
  } b;
 } atapi_select_t;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ide.h cleanup, 2.5.47

Post by Alan Co » Mon, 18 Nov 2002 01:50:08



> The patch below performs minor cleanups on the include/linux/ide.h header. It
> simplifies the use of endianness #ifdefs and removes a chunk of duplicated
> code.

> Comments?

Why are you deleting chunks of comments ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ide.h cleanup, 2.5.47

Post by Matti Annal » Tue, 19 Nov 2002 16:20:10


----- Original Message -----



Sent: Sunday, November 17, 2002 2:08 AM
Subject: Re: [PATCH] ide.h cleanup, 2.5.47


> > The patch below performs minor cleanups on the include/linux/ide.h header. It
> > simplifies the use of endianness #ifdefs and removes a chunk of duplicated
> > code.

> > Comments?

> Why are you deleting chunks of comments ?

The comments and the #define statement that the patch is deleting are duplicated in the header as you may see by checking the header file.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. 2.5.47-ac6 IDE test result

Hi.
I've tested IDE HDD performance on 2.5.47-ac6.
Using old pentium-classic PC-9800 box, it has no DMA mode.

 1. "hdparm -t /dev/hda3" results (PIO mode)
  2.5.47-ac6 with Task file IO:    2.86MB/s
  2.5.47-ac6 without Task file IO: 2.90MB/s
  2.4.19 without Task file IO:     2.93MB/s

 2. Heavy usage test
  "cp -pr /usr/src /tmp/foo" (in same HDD)
  about 92000files/total size 2.3GB
  I had always "lost interrupt" message and FS corruption
   by this test at 2.5.20 days.
  2.5.47-ac6 works fine. (takes about 30 minutes.)

Thanks,
Osamu Tomita
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. How to snoop on a tty?

3. Build FAILED! 2.5.47 & 2.5.47-bk2

4. Desknote computers

5. 2.5.47-ac5:undefined reference to `boot_gdt_table'

6. PPP: interactive work sloooow while rcp-ing files

7. PNP driver changes for 2.5.47

8. cdrom-cdr under linux/nt?

9. 2.5.47 Minor bug in non-fatal machine check

10. error building - kernel 2.5.47 +patch2.5.47-bk2

11. 2.5.47-mm1 oops

12. 2.5.47 bug - USB usbfs segvs processes

13. 2.5.47 Oops on hub disconnect