Bug in extended translation handling in aha1542.c

Nick Andrew (nick@zeta.org.au)
Tue, 23 Jun 1998 16:42:59 +1000


This is against 2.0.0 - 2.0.34; I haven't checked the 2.1 series:

AHA1542CF and AHA1542CP behave differently w.r.t. extended translation
NVRAM setting. The controller BIOS setting is labelled "Use extended
translation for SCSI drives >1 gig". The linux/drivers/scsi/aha1542.c file
was patched in 2.0.30 by mike.mclagan@linux.org for AHA1542CP support;
this patch while necessary is insufficient for AHA1542CP users with large
disks to turn _off_ extended translation.

Here are the tables showing how the controllers behave:

AHA1542CF

Physical environment Controller result
big disk, extd ON 0x08, 0x01
small disk, extd ON 0x08, 0x00
big disk, extd OFF 0x00, 0x00 * note
small disk, extd OFF 0x00, 0x00

AHA1542CP

Physical environment Controller result
big disk, extd ON 0x08, 0x02
small disk, extd ON 0x08, 0x00
big disk, extd OFF 0x00, 0x02 * note
small disk, extd OFF 0x00, 0x00

The difference is that the 1542CP flags the presence of a large disk even
when the setting is turned off, yet the driver code ignores the switch
setting:

if ((mbenable_result[0] & 0x08) || mbenable_result[1]) {
...
if(mbenable_result[1] & 0x03) retval = BIOS_TRANSLATION_25563;
...
}

Correct behaviour IMHO is to only turn on translation if the NVRAM switch
is also set to "enabled", thus the patch:

*** aha1542.c.original Tue Jun 23 16:36:10 1998
--- aha1542.c Tue Jun 23 16:35:41 1998
***************
*** 809,815 ****
mbenable_cmd[1]=0;
mbenable_cmd[2]=mbenable_result[1];

! if(mbenable_result[1] & 0x03) retval = BIOS_TRANSLATION_25563;

aha1542_out(base,mbenable_cmd,3);
WAIT(INTRFLAGS(base),INTRMASK,HACC,0);
--- 809,815 ----
mbenable_cmd[1]=0;
mbenable_cmd[2]=mbenable_result[1];

! if((mbenable_result[0] & 0x08) && (mbenable_result[1] & 0x03)) retval = B
IOS_TRANSLATION_25563;

aha1542_out(base,mbenable_cmd,3);
WAIT(INTRFLAGS(base),INTRMASK,HACC,0);

Can anybody tell me who is currently maintaining this driver so we can roll
the fix in?

Nick.

-- 
Zeta Internet                     SP4   Fax: +61-2-9233-6545 Voice: 9231-9400
G.P.O. Box 3400, Sydney NSW 1043        http://www.zeta.org.au/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu