Advansys SCSI driver and 2.6.16
Subsystems (2)
I use an Advansys controller for an old, slow SCSI drive and my flatbed scanner. I noticed that upon trying to boot 2.6.16, my Advansys controller wasn't detected. Further investigation shows that the driver has been fairly silently disappearing over the last couple releases.
Is this a permanent change or is the Advansys driver just in need of some updating to current APIs? I'd hate to have to replace this controller and I don't want to be stuck at 2.6.15 forever. If someone could point me in the right direction about what the problem is, I'd be glad to take a look at seeing if I could fix it.
Signature · 3 lines
Ken Witherow <phantoml AT rochester.rr.com>
ICQ: 21840670 AIM: phantomlordken
http://www.krwtech.com/kenQuoted 11 lines · Ken Witherow
I use an Advansys controller for an old, slow SCSI drive and my flatbed scanner. I noticed that upon trying to boot 2.6.16, my Advansys controller wasn't detected. Further investigation shows that the driver has been fairly silently disappearing over the last couple releases.
Is this a permanent change or is the Advansys driver just in need of some updating to current APIs? I'd hate to have to replace this controller and I don't want to be stuck at 2.6.15 forever. If someone could point me in the right direction about what the problem is, I'd be glad to take a look at seeing if I could fix it.
There have been no changes in the advansys driver since November 2005, and nothing substantial in over a year. So I'd say what we have here is either a faulty .config or a bug.
Please check the .config and if it looks OK, provide a full description of the problem. It may be useful to do
boot (2.6.15)
dmesg -s 1000000 > 1
boot (2.6.16)
dmesg -s 1000000 > 2
diff -u 1 2 > 3
and include `3' in the report.
Thanks.
Quoted 3 lines · Andrew Morton
There have been no changes in the advansys driver since November 2005, and
nothing substantial in over a year.
The advansys driver has been disabled for two years - since 2.6.8:
Quoted 7 lines
[email protected], 2004-06-26 10:50:12-05:00, jejb@mulgrave.(none)
advansys: add warning and convert #includesThe DMA conversion of the advansys driver is still broken. Add a #warning to the driver and a comment above it explaining what needs to be done.
Quoted 6 lines
Mark the driver as BROKEN because of the warning
Also remove the #include "
scsi.h"Signed-off-by James Bottomley <[email protected]>
So I don't know how you managed to get it to build in 2.6.15.
You can reenable it with:
drivers/scsi/Kconfig renamed from drivers/scsi/Kconfig~a +1 -1
@@ -453,7 +453,7 @@ config SCSI_DPT_I2O config SCSI_ADVANSYS tristate "AdvanSys SCSI support" - depends on (ISA || EISA || PCI) && SCSI && BROKEN + depends on (ISA || EISA || PCI) && SCSI help This is a driver for all SCSI host adapters manufactured by AdvanSys. It is documented in the kernel source in
_
and it does compile. Does it actually work?
Quoted 38 lines · Andrew Morton
Quoted 3 lines · Andrew Morton
There have been no changes in the advansys driver since November 2005, and
nothing substantial in over a year.The advansys driver has been disabled for two years - since 2.6.8:
Quoted 7 lines
[email protected], 2004-06-26 10:50:12-05:00, jejb@mulgrave.(none)
advansys: add warning and convert #includesThe DMA conversion of the advansys driver is still broken. Add a #warning to the driver and a comment above it explaining what needs to be done.
Quoted 6 lines
Mark the driver as BROKEN because of the warning
Also remove the #include "
scsi.h"Signed-off-by James Bottomley <[email protected]>So I don't know how you managed to get it to build in 2.6.15.
You can reenable it with:
drivers/scsi/Kconfig renamed from drivers/scsi/Kconfig~a +0
-0@@ -453,7 +453,7 @@ config SCSI_DPT_I2Oconfig
SCSI_ADVANSYS
tristate "AdvanSys SCSI support"drivers/scsi/Kconfig renamed from drivers/scsi/Kconfig~a +1
-1- depends on (ISA || EISA || PCI) && SCSI && BROKEN + depends on (ISA || EISA || PCI) && SCSIhelp
This is a driver for all SCSI host adapters manufactured by AdvanSys. It is documented in the kernel source in
_
Quoted 1 line
and it does compile. Does it actually work?
[root@death ~]# cat /proc/version
Linux version 2.6.16 ([email protected]) (gcc version 4.1.0) #20 SMP PREEMPT Thu Apr 20 02:30:28 EDT 2006
[root@death ~]# cat /proc/scsi/advansys/0 AdvanSys SCSI 3.3K: PCI Ultra: IO 0x1800-0x180F, IRQ 0x10
Device Information for AdvanSys SCSI Host 0:
Target IDs Detected: 5, 7, (7=Host Adapter)
EEPROM Settings for AdvanSys SCSI Host 0:
Serial Number: AE54C713B960
Host SCSI ID: 7, Host Queue Size: 16, Device Queue Size: 8 cntl 0x7ff7, no_scam 0x0
Target ID: 0 1 2 3 4 5 6 7 Disconnects: Y Y Y N Y Y Y Y Command Queuing: N N N N N N N N Start Motor: Y Y Y Y Y Y Y Y
Synchronous Transfer: Y Y Y Y Y Y Y Y
Linux Driver Configuration and Information for AdvanSys SCSI Host 0:
host_busy 0, last_reset 0, max_id 8, max_lun 8, max_channel 0 unique_id 0, can_queue 16, this_id 7, sg_tablesize 50, cmd_per_lun 1 unchecked_isa_dma 0, use_clustering 1
flags 0x8, last_reset 0x0, jiffies 0x5c14, asc_n_io_port 0x10 io_port 0x1800, n_io_port 0x10
Linux Driver Statistics for AdvanSys SCSI Host 0:
queuecommand 101, reset 0, biosparam 0, interrupt 102 callback 101, done 101, build_error 0, build_noreq 0, build_nosg 0 exe_noerror 101, exe_busy 0, exe_error 0, exe_unknown 0 cont_cnt 3, cont_xfer 0.0 kb avg_xfer 0.0 kb
sg_cnt 98, sg_elem 208, sg_xfer 1569.0 kb
avg_num_elem 2.1, avg_elem_size 7.5 kb, avg_xfer_size 16.0 kb Active and Waiting Request Queues (Time Unit: 250 HZ):
target 5
active: cnt [cur 0, max 4, tot 95], time [min 0, max 16, avg 3.7]
waiting: cnt [cur 0, max 0, tot 0], time [min 0, max 0, avg 0.0]
Asc Library Configuration and Statistics for AdvanSys SCSI Host 0:
chip_version 10, lib_version 0x118, lib_serial_no 123, mcode_date 0x12c3 mcode_version 0x50d, err_code 0
Total Command Pending: 0
Command Queuing: 5:N
Command Queue Pending: 5:0
Command Queue Limit: 5:4
Command Queue Full: 5:N
Synchronous Transfer: 5:N
[root@death ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 05 Lun: 00
Vendor: SEAGATE Model: SX410800N Rev: 7117
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: DNES-309170 Rev: SAH0
Type: Direct-Access ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 01 Lun: 00
Vendor: WDIGTL Model: WD183 ULTRA2 Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 02 Lun: 00
Vendor: TEAC Model: CD-W512SB Rev: 1.0C
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 06 Lun: 00
Vendor: CyberDrv Model: CD-ROM TW240S Rev: 1.20
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 14 Lun: 00
Vendor: SEAGATE Model: SX118273LC Rev: 6367
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: SanDisk Model: ImageMate II Rev: 1.30
Type: Direct-Access ANSI SCSI revision: 02
The SX410800N is the drive off the Advansys controller and is working just fine. I also have a scanner that I've been using all along as well but it isn't turned on atm so it isn't in the list.
I haven't had a problem with the controller in linux for as long as I can remember until 2.6.16. I've been using the patches rather than tarballs as they've come out for years. I believe I freshened the tree from tarball around 2.6.11.
I would say driver is working as intended, though I do get a slew of:
drivers/scsi/advansys.c:18223: warning: passing argument 2 of 'writew' makes pointer from integer without a cast drivers/scsi/advansys.c:18223: warning: passing argument 2 of 'writeb' makes pointer from integer without a cast
warnings when compiling
Quoted 2 lines · Ken Witherow
I would say driver is working as intended,
OK, thanks. The driver needs some caring for. Probably marking it as BROKEN was the wrong thing to do, because then everyone ignores it. I'll enable it in -mm, see if that motivates someone to take pity upon it.
Quoted 8 lines
though I do get a slew of:
drivers/scsi/advansys.c:18223: warning: passing argument 2 of 'writew' makes pointer from integer without a castdrivers/scsi/advansys.c:18223: warning: passing argument 2 of 'writeb' makes pointer from integer without a castwarnings when compiling
Yes, you will. I stuck a few typecasts in there just to quieten things down.
PATCH 1/1 scsi: clean up warnings in Advansys driver
Fix typecast warnings and switch from check_region to request_region
--- drivers/scsi/advansys.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/scsi/advansys.c +10 -7
@@ -2056,11 +2056,11 @@ STATIC ASC_DCNT AscGetMaxDmaCount(ushor/* * Define Adv Library required memory access macros. */ -#define ADV_MEM_READB (addr) readb(addr) -#define ADV_MEM_READW (addr) readw(addr) -#define ADV_MEM_WRITEB (addr, byte) writeb(byte, addr) -#define ADV_MEM_WRITEW (addr, word) writew(word, addr) -#define ADV_MEM_WRITEDW (addr, dword) writel(dword, addr) +#define ADV_MEM_READB (addr) readb((void *) addr) +#define ADV_MEM_READW (addr) readw((void *) addr) +#define ADV_MEM_WRITEB (addr, byte) writeb(byte, (void *) addr) +#define ADV_MEM_WRITEW (addr, word) writew(word, (void *) addr) +#define ADV_MEM_WRITEDW (addr, dword) writel(dword,(void *) addr)#define ADV_CARRIER_COUNT (ASC_DEF_MAX_HOST_QNG + 15)
@@ -4415,7 +4415,7 @@ advansys_detect(struct scsi_host_templatASC_DBG1 (1 ,"advansys_detect: probing I/O port 0x%x...\n" , iop); -if (check_region (iop,ASC_IOADR_GAP ) !=0 ) { +if (!request_region (iop,ASC_IOADR_GAP ,"advansys" )){printk ("AdvanSys SCSI: specified I/O Port 0x%X is busy\n" , iop);/* Don't try this I/O port twice. */
@@ -4425,6 +4425,7 @@ advansys_detect(struct scsi_host_templatprintk ("AdvanSys SCSI: specified I/O Port 0x%X has no adapter\n" , iop);/* Don't try this I/O port twice. */ +release_region (iop,ASC_IOADR_GAP ); asc_ioport[ioport] =0 ; goto ioport_try_again; }else {
@@ -4445,6 +4446,7 @@ advansys_detect(struct scsi_host_templat ioport++; goto ioport_try_again; } +release_region (iop,ASC_IOADR_GAP ); }/* * This board appears good, don't try the I/O port
@@ -9752,13 +9754,14 @@ AscSearchIOPortAddr11( }for (; i <ASC_IOADR_TABLE_MAX_IX ; i++) { iop_base = _asc_def_iop_base[i]; -if (check_region (iop_base,ASC_IOADR_GAP ) !=0 ) { +if (!request_region (iop_base,ASC_IOADR_GAP ,"advansys" )){ASC_DBG1 (1 ,"AscSearchIOPortAddr11: check_region() failed I/O port 0x%x\n" , iop_base);continue ; }ASC_DBG1 (1 ,"AscSearchIOPortAddr11: probing I/O port 0x%x\n" , iop_base); +release_region (iop_base,ASC_IOADR_GAP );if (AscFindSignature (iop_base)) {return (iop_base); }
Re: [PATCH 2.6.16] scsi: clean up warnings in Advansys driver
Quoted 17 lines · Ken Witherow
Fix typecast warnings and switch from
check_regiontorequest_regionSigned-off-by Ken Witherow <[email protected]>--- drivers/scsi/advansys.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)drivers/scsi/advansys.c +0
-0@@ -2056,11 +2056,11 @@ STATIC ASC_DCNT AscGetMaxDmaCount(ushor/* * Define Adv Library required memory access macros. */
drivers/scsi/advansys.c STATIC ASC_DCNT AscGetMaxDmaCount(ushor · line 2063
Quoted 10 lines
drivers/scsi/advansys.c +5
-5-#define ADV_MEM_READB (addr) readb(addr) -#define ADV_MEM_READW (addr) readw(addr) -#define ADV_MEM_WRITEB (addr, byte) writeb(byte, addr) -#define ADV_MEM_WRITEW (addr, word) writew(word, addr) -#define ADV_MEM_WRITEDW (addr, dword) writel(dword, addr) +#define ADV_MEM_READB (addr) readb((void *) addr) +#define ADV_MEM_READW (addr) readw((void *) addr) +#define ADV_MEM_WRITEB (addr, byte) writeb(byte, (void *) addr) +#define ADV_MEM_WRITEW (addr, word) writew(word, (void *) addr) +#define ADV_MEM_WRITEDW (addr, dword) writel(dword,(void *) addr)
Yes, I already did that, only I stuck a new #warning in there as well, because this isn't the right fix.
Quoted 33 lines
drivers/scsi/advansys.c +4
-2#define ADV_CARRIER_COUNT (ASC_DEF_MAX_HOST_QNG + 15)@@ -4415,7 +4415,7 @@ advansys_detect(struct scsi_host_templatASC_DBG1 (1 ,"advansys_detect: probing I/O port 0x%x...\n" , iop); -if (check_region (iop,ASC_IOADR_GAP ) !=0 ) { +if (!request_region (iop,ASC_IOADR_GAP ,"advansys" )){printk ("AdvanSys SCSI: specified I/O Port 0x%X is busy\n" , iop);/* Don't try this I/O port twice. */ @@ -4425,6 +4425,7 @@ advansys_detect(struct scsi_host_templatprintk ("AdvanSys SCSI: specified I/O Port 0x%X has no adapter\n" , iop);/* Don't try this I/O port twice. */ +release_region (iop,ASC_IOADR_GAP ); asc_ioport[ioport] =0 ; goto ioport_try_again; }else {@@ -4445,6 +4446,7 @@ advansys_detect(struct scsi_host_templat ioport++; goto ioport_try_again; } +release_region (iop,ASC_IOADR_GAP ); }/* * This board appears good, don't try the I/O port @@ -9752,13 +9754,14 @@ AscSearchIOPortAddr11( }for (; i <ASC_IOADR_TABLE_MAX_IX ; i++) { iop_base = _asc_def_iop_base[i]; -if (check_region (iop_base,ASC_IOADR_GAP ) !=0 ) { +if (!request_region (iop_base,ASC_IOADR_GAP ,"advansys" )){
drivers/scsi/advansys.c AscSearchIOPortAddr11( · line 9767
Quoted 10 lines
drivers/scsi/advansys.c +1
-0ASC_DBG1 (1 ,"AscSearchIOPortAddr11: check_region() failed I/O port 0x%x\n" , iop_base);continue ; }ASC_DBG1 (1 ,"AscSearchIOPortAddr11: probing I/O port 0x%x\n" , iop_base); +release_region (iop_base,ASC_IOADR_GAP );if (AscFindSignature (iop_base)) {return (iop_base); }
OK, thanks. But I added this fixup on top:
drivers/scsi/advansys.c renamed from drivers/scsi/advansys.c~scsi-clean-up-warnings-in-advansys-driver-fix +1 -1
@@ -4445,9 +4445,9 @@ advansys_detect(struct scsi_host_templat* 'ioport' past this board. */ ioport++; +release_region (iop,ASC_IOADR_GAP ); goto ioport_try_again; } -release_region (iop,ASC_IOADR_GAP ); }/* * This board appears good, don't try the I/O port
_
Quoted 13 lines · Andrew Morton
drivers/scsi/Kconfig renamed from drivers/scsi/Kconfig~a +1
-1@@ -453,7 +453,7 @@ config SCSI_DPT_I2O config SCSI_ADVANSYS tristate "AdvanSys SCSI support" - depends on (ISA || EISA || PCI) && SCSI && BROKEN + depends on (ISA || EISA || PCI) && SCSI help This is a driver for all SCSI host adapters manufactured by AdvanSys. It is documented in the kernel source in_
Quoted 1 line
and it does compile. Does it actually work?
It doesn't work on all architectures, but for the one most people care about (x86), it seems to have quite a few happy users. (I got a slew of bug reports in Fedora bugzilla when it disappeared,
and resurrected it with the exact same patch you did).
Dave
Signature · 1 line
http://www.codemonkey.org.uk