Re: [2.6 patch] SCSI seagate.c: remove SEAGATE_USE_ASM

2007-01-22 Thread Alan
> > The C codepaths are essentially untested on this driver.
> 
> Has any part of this driver ever be tested with kernel 2.6?
> Or compiled with gcc 4?

The C code paths have never been tested at all, the asm ones certainly
worked in late 2.4, but I don't; have an ISA box any more.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] SCSI seagate.c: remove SEAGATE_USE_ASM

2007-01-22 Thread Adrian Bunk
On Mon, Jan 22, 2007 at 03:18:41PM +, Alan wrote:
> On Sun, 21 Jan 2007 20:13:00 +0100
> Adrian Bunk <[EMAIL PROTECTED]> wrote:
> 
> > Using assembler code for performance in drivers might have been a good 
> > idea 15 years ago when this code was written, but with today's compilers 
> > that's unlikely to be an advantage.
> > 
> > Besides this, it also hurts the readability.
> > 
> > Simply use the C code that was already there as an alternative.
> > 
> > Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
>   "stosb\n\t"
> 
> NAK
> 
> The C codepaths are essentially untested on this driver.

Has any part of this driver ever be tested with kernel 2.6?
Or compiled with gcc 4?

> Alan

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] SCSI seagate.c: remove SEAGATE_USE_ASM

2007-01-22 Thread Alan
On Sun, 21 Jan 2007 20:13:00 +0100
Adrian Bunk <[EMAIL PROTECTED]> wrote:

> Using assembler code for performance in drivers might have been a good 
> idea 15 years ago when this code was written, but with today's compilers 
> that's unlikely to be an advantage.
> 
> Besides this, it also hurts the readability.
> 
> Simply use the C code that was already there as an alternative.
> 
> Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
"stosb\n\t"

NAK

The C codepaths are essentially untested on this driver.

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[2.6 patch] SCSI seagate.c: remove SEAGATE_USE_ASM

2007-01-21 Thread Adrian Bunk
Using assembler code for performance in drivers might have been a good 
idea 15 years ago when this code was written, but with today's compilers 
that's unlikely to be an advantage.

Besides this, it also hurts the readability.

Simply use the C code that was already there as an alternative.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

This patch was already sent on:
- 6 Jan 2007

 drivers/scsi/Makefile  |2 
 drivers/scsi/seagate.c |  148 -
 2 files changed, 1 insertion(+), 149 deletions(-)

--- linux-2.6.20-rc3-mm1/drivers/scsi/Makefile.old  2007-01-05 
23:01:12.0 +0100
+++ linux-2.6.20-rc3-mm1/drivers/scsi/Makefile  2007-01-05 23:01:51.0 
+0100
@@ -16,7 +16,7 @@
 
 CFLAGS_aha152x.o =   -DAHA152X_STAT -DAUTOCONF
 CFLAGS_gdth.o= # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
-CFLAGS_seagate.o =   -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
+CFLAGS_seagate.o =   -DARBITRATE -DPARITY
 
 subdir-$(CONFIG_PCMCIA)+= pcmcia
 
--- linux-2.6.20-rc3-mm1/drivers/scsi/seagate.c.old 2007-01-05 
23:02:03.0 +0100
+++ linux-2.6.20-rc3-mm1/drivers/scsi/seagate.c 2007-01-05 23:03:11.0 
+0100
@@ -60,10 +60,6 @@
  * -DPARITY  
  *  This will enable parity.
  *
- * -DSEAGATE_USE_ASM
- *  Will use older seagate assembly code. should be (very small amount)
- *  Faster.
- *
  * -DSLOW_RATE=50
  *  Will allow compatibility with broken devices that don't
  *  handshake fast enough (ie, some CD ROM's) for the Seagate
@@ -132,10 +128,6 @@
 #error Please use -DCONTROLLER=SEAGATE or -DCONTROLLER=FD to override 
controller type
 #endif
 
-#ifndef __i386__
-#undef SEAGATE_USE_ASM
-#endif
-
 /*
Thanks to Brian Antoine for the example code in his Messy-Loss ST-01
driver, and Mitsugu Suzuki for information on the ST-01
@@ -539,9 +531,6 @@
 #ifdef PARITY
" PARITY"
 #endif
-#ifdef SEAGATE_USE_ASM
-   " SEAGATE_USE_ASM"
-#endif
 #ifdef SLOW_RATE
" SLOW_RATE"
 #endif
@@ -1139,30 +1128,7 @@
 data);
 
/* SJT: Start. Fast Write */
-#ifdef SEAGATE_USE_ASM
-   __asm__ ("cld\n\t"
-#ifdef FAST32
-"shr $2, %%ecx\n\t"
-"1:\t"
-"lodsl\n\t"
-"movl %%eax, (%%edi)\n\t"
-#else
-"1:\t"
-"lodsb\n\t"
-"movb %%al, (%%edi)\n\t"
-#endif
-"loop 1b;"
- /* output */ :
- /* input */ :"D" (st0x_dr),
-"S"
-(data),
-"c" (SCint->transfersize)
-/* clobbered */
- :  "eax", "ecx",
-"esi");
-#else  /* SEAGATE_USE_ASM */
memcpy_toio(st0x_dr, data, 
transfersize);
-#endif /* SEAGATE_USE_ASM */
 /* SJT: End */
len -= transfersize;
data += transfersize;
@@ -1175,49 +1141,6 @@
 */
 
 /* SJT: Start. Slow Write. */
-#ifdef SEAGATE_USE_ASM
-
-   int __dummy_1, __dummy_2;
-
-/*
- *  We loop as long as we are in a data out phase, there is data to send, 
- *  and BSY is still active.
- */
-/* Local variables : len = ecx , data = esi, 
- st0x_cr_sr = ebx, st0x_dr =  edi
-*/
-   __asm__ (
-   /* Test for any data 
here at all. */
-   "orl %%ecx, %%ecx\n\t"
-   "jz 2f\n\t" "cld\n\t"
-/*"movl st0x_cr_sr, %%ebx\n\t"  */
-/*"movl st0x_dr, %%edi\n\t"  */
-   "1:\t"
-   "movb (%%ebx), %%al\n\t"
-   /* Test for BSY */
-   "test $1, %%al\n\t"
-   "jz 2f\n\t"
-   /* Test for data out 
phase - STATUS & REQ_MASK should be 
-  REQ_DATAOUT, which 
is 0. */
-

[2.6 patch] SCSI seagate.c: remove SEAGATE_USE_ASM

2007-01-05 Thread Adrian Bunk
Using assembler code for performance in drivers might have been a good 
idea 15 years ago when this code was written, but with today's compilers 
that's unlikely to be an advantage.

Besides this, it also hurts the readability.

Simply use the C code that was already there as an alternative.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 drivers/scsi/Makefile  |2 
 drivers/scsi/seagate.c |  148 -
 2 files changed, 1 insertion(+), 149 deletions(-)

--- linux-2.6.20-rc3-mm1/drivers/scsi/Makefile.old  2007-01-05 
23:01:12.0 +0100
+++ linux-2.6.20-rc3-mm1/drivers/scsi/Makefile  2007-01-05 23:01:51.0 
+0100
@@ -16,7 +16,7 @@
 
 CFLAGS_aha152x.o =   -DAHA152X_STAT -DAUTOCONF
 CFLAGS_gdth.o= # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
-CFLAGS_seagate.o =   -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
+CFLAGS_seagate.o =   -DARBITRATE -DPARITY
 
 subdir-$(CONFIG_PCMCIA)+= pcmcia
 
--- linux-2.6.20-rc3-mm1/drivers/scsi/seagate.c.old 2007-01-05 
23:02:03.0 +0100
+++ linux-2.6.20-rc3-mm1/drivers/scsi/seagate.c 2007-01-05 23:03:11.0 
+0100
@@ -60,10 +60,6 @@
  * -DPARITY  
  *  This will enable parity.
  *
- * -DSEAGATE_USE_ASM
- *  Will use older seagate assembly code. should be (very small amount)
- *  Faster.
- *
  * -DSLOW_RATE=50
  *  Will allow compatibility with broken devices that don't
  *  handshake fast enough (ie, some CD ROM's) for the Seagate
@@ -132,10 +128,6 @@
 #error Please use -DCONTROLLER=SEAGATE or -DCONTROLLER=FD to override 
controller type
 #endif
 
-#ifndef __i386__
-#undef SEAGATE_USE_ASM
-#endif
-
 /*
Thanks to Brian Antoine for the example code in his Messy-Loss ST-01
driver, and Mitsugu Suzuki for information on the ST-01
@@ -539,9 +531,6 @@
 #ifdef PARITY
" PARITY"
 #endif
-#ifdef SEAGATE_USE_ASM
-   " SEAGATE_USE_ASM"
-#endif
 #ifdef SLOW_RATE
" SLOW_RATE"
 #endif
@@ -1139,30 +1128,7 @@
 data);
 
/* SJT: Start. Fast Write */
-#ifdef SEAGATE_USE_ASM
-   __asm__ ("cld\n\t"
-#ifdef FAST32
-"shr $2, %%ecx\n\t"
-"1:\t"
-"lodsl\n\t"
-"movl %%eax, (%%edi)\n\t"
-#else
-"1:\t"
-"lodsb\n\t"
-"movb %%al, (%%edi)\n\t"
-#endif
-"loop 1b;"
- /* output */ :
- /* input */ :"D" (st0x_dr),
-"S"
-(data),
-"c" (SCint->transfersize)
-/* clobbered */
- :  "eax", "ecx",
-"esi");
-#else  /* SEAGATE_USE_ASM */
memcpy_toio(st0x_dr, data, 
transfersize);
-#endif /* SEAGATE_USE_ASM */
 /* SJT: End */
len -= transfersize;
data += transfersize;
@@ -1175,49 +1141,6 @@
 */
 
 /* SJT: Start. Slow Write. */
-#ifdef SEAGATE_USE_ASM
-
-   int __dummy_1, __dummy_2;
-
-/*
- *  We loop as long as we are in a data out phase, there is data to send, 
- *  and BSY is still active.
- */
-/* Local variables : len = ecx , data = esi, 
- st0x_cr_sr = ebx, st0x_dr =  edi
-*/
-   __asm__ (
-   /* Test for any data 
here at all. */
-   "orl %%ecx, %%ecx\n\t"
-   "jz 2f\n\t" "cld\n\t"
-/*"movl st0x_cr_sr, %%ebx\n\t"  */
-/*"movl st0x_dr, %%edi\n\t"  */
-   "1:\t"
-   "movb (%%ebx), %%al\n\t"
-   /* Test for BSY */
-   "test $1, %%al\n\t"
-   "jz 2f\n\t"
-   /* Test for data out 
phase - STATUS & REQ_MASK should be 
-  REQ_DATAOUT, which 
is 0. */
-