Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Alan Cox

 (Does anybody know who the maintainer for this code is?)

There isnt one

 (An indication of how often this code path is used can be found in
 the fact that the previous define of NCR5380_write had its payload
 and address mixed up, probably making for wierd results should
 the code ever be executed.)

The driver works for me nicely. Im not convinced by the changes of direction
either. At least not without a detailed audit on the 2.2 code. Some of the
naming is very misleading in that driver

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:05:42PM +, Alan Cox wrote:
[...]
  (An indication of how often this code path is used can be found in
  the fact that the previous define of NCR5380_write had its payload
  and address mixed up, probably making for wierd results should
  the code ever be executed.)
 
 The driver works for me nicely. Im not convinced by the changes of direction
 either. At least not without a detailed audit on the 2.2 code. Some of the
 naming is very misleading in that driver
 

Looking at the define of NCR_5380_write

#define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + +NCR53C400_mem_base + 
(reg), value)

followed by an use of NCR5380_write

NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);

I doubt that it is not the intention to write CSR_BASE | CSR_TRANS_DIR
at the offset C400_CONTROL_STATUS_REG. But note that this argument
swap only is in the code produced by -DCONFIG_SCSI_G_NCR5380_MEM.
Perhaps you use CONFIG_SCSI_G_NCR5380_PORT? Otherwise I must admit
that I have been had...
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Duct tape is like the force; it has a light side and a dark side, and
it holds the universe together.
  -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Alan Cox

 Looking at the define of NCR_5380_write
 
 #define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + +NCR53C400_mem_base 
+ (reg), value)
 
 followed by an use of NCR5380_write
 
 NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);
 
 I doubt that it is not the intention to write CSR_BASE | CSR_TRANS_DIR
 at the offset C400_CONTROL_STATUS_REG. But note that this argument
 swap only is in the code produced by -DCONFIG_SCSI_G_NCR5380_MEM.
 Perhaps you use CONFIG_SCSI_G_NCR5380_PORT? Otherwise I must admit
 that I have been had...

Im running PIO. However while I agree with that one Im dubious about the
inverts on the memcpy_*io bits

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

 
 Im running PIO. However while I agree with that one Im dubious about the
 inverts on the memcpy_*io bits
 

I am sorry but have I inverted the arguments to the memcpy_*io calls?
Or are you referring to something other than the arguments here?
-- 
Rasmus([EMAIL PROTECTED])

"Science is like sex: sometimes something useful comes out, but that 
is not the reason we are doing it" -- Richard Feynman 
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Alan Cox

 I am sorry but have I inverted the arguments to the memcpy_*io calls?
 Or are you referring to something other than the arguments here?

You seem to have swapped the source/dest over in memcpy_toio cases and I need
to convince myself you did that correctly

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:46:15PM +, Alan Cox wrote:
  I am sorry but have I inverted the arguments to the memcpy_*io calls?
  Or are you referring to something other than the arguments here?
 
 You seem to have swapped the source/dest over in memcpy_toio cases and I need
 to convince myself you did that correctly

Yes, that is neither obvious nor nice. My apologies, but I could not
find a better way.

Explanation: The memcpy_toio cases goes like this:

-   isa_memcpy_toio(NCR53C400_host_buffer+NCR5380_map_name,src+start,128);
+   memcpy_toio(isa_remap_ptr+OFFSET_FROM_REMAPPING, src+start, 128);

isa_remap_ptr is the ioremap from NCR5380_map_name + NCR53C400_mem_base.
I would like to memcpy from NCR53C400_host_buffer+NCR5380_map_name thus
needing to add the difference between NCR53C400_host_buffer and the
NCR53C400_mem_base (used in isa_remap_ptr). Thus, in the hope that
this can be done linearly, I add OFFSET_FROM_REMAPPING 
(NCR53C400_host_buffer - NCR53C400_mem_base). (BTW, this is also done
in the memcpy_fromio cases.)

I hope that the above is readable.
-- 
Regards,
Rasmus([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]