* (Possible Fix) MS-PNR SCSI Card / NCR5380 SCSI Driver
@ 2003-09-16 19:55 Wagner Volanin
2003-09-17 14:28 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Wagner Volanin @ 2003-09-16 19:55 UTC (permalink / raw)
To: linux-kernel
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();
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: (Possible Fix) MS-PNR SCSI Card / NCR5380 SCSI Driver
2003-09-16 19:55 (Possible Fix) MS-PNR SCSI Card / NCR5380 SCSI Driver Wagner Volanin
@ 2003-09-17 14:28 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2003-09-17 14:28 UTC (permalink / raw)
To: Wagner Volanin; +Cc: Linux Kernel Mailing List
On Maw, 2003-09-16 at 20:55, Wagner Volanin wrote:
> Why the function NCR5380_poll_politely() returned the value 'r'
> on success if this value should be '0' case everything went ok...
That looks correct. Its been a long time since I attacked this driver
though, an although I had it working beautifully in 2.5.30 or so its
rotted back into nonfunctioning with the later 2.5 scsi changes.
> 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. :)
It looks right to me.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-17 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-16 19:55 (Possible Fix) MS-PNR SCSI Card / NCR5380 SCSI Driver Wagner Volanin
2003-09-17 14:28 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®