(Possible Fix) MS-PNR SCSI Card / NCR5380 SCSI Driver

From: Wagner Volanin
Date: Tue Sep 16 2003 - 14:58:22 EST



I have an old Genius Colorpage-SP2 SCSI scanner.
It is shipped with a MS-PNR 8bit ISA non-pnp proprietary SCSI
card from Microtek.

Although its chipset is a NCR53c400a, it wouldn't work with the
appropriate driver, always accusing timeout, whatever settings
I passed to it.

Today I messed a little with the NCR5380.c file in drivers/scsi
which is included by the g_NCR5380 driver and I couldn't understand
one thing:

Why the function NCR5380_poll_politely() returned the value 'r'
on success if this value should be '0' case everything went ok...

So I changed "return r;" to "return 0;" and after that my
scanner worked fine, and was easily detected by SANE, without
a single error message. :)

I have not the time to delve into the problem further, but I
wanted to report this. I couldn't find any counter-effects caused
by changing these return values.

- Wagner Volanin.


GCC: gcc 2.95 (Debian Stable)
Kernel: 2.6.0-test5 compiled for Pentium-MMX.
Computer: Pentium MMX with PCCHIPS Motherboard.
Distribution: Debian Unstable
Command issued:
modprobe g_NCR5380 ncr_53c400a=1 ncr_addr=0x280 ncr_irq=255


The diff for the file follows below:
(Apply it inside drivers/scsi directory)


--- NCR5380.c.orig 2003-09-16 18:24:00.000000000 +0000
+++ NCR5380.c 2003-09-16 18:53:59.000000000 +0000
@@ -371,18 +371,18 @@
while( n-- > 0)
{
r = NCR5380_read(reg);
if((r & bit) == val)
- return r;
+ return 0;
cpu_relax();
}

/* t time yet ? */
while(time_before(jiffies, end))
{
r = NCR5380_read(reg);
if((r & bit) == val)
- return r;
+ return 0;
if(!in_interrupt())
yield();
else
cpu_relax();




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