Bug 213
Summary: | compile failure in drivers/scsi/ini9100u.c | ||
---|---|---|---|
Product: | SCSI Drivers | Reporter: | Steven Barnhart (sbarn03) |
Component: | Other | Assignee: | Mike Christie (mikenc) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | gcs, zawadaa |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | --- | Bisected commit-id: | |
Attachments: |
fix compile errors in ini9100u
fixes DMA_NONE case fix DMA_NONE case (2nd try) INI-9100UW driver failure in 2.6.0 -- files from /proc and /sys and kernel messages |
Description
Steven Barnhart
2002-12-29 17:50:21 UTC
I have the same results on a Athlon-XP 1800, 768 DDR, Gentoo 1.4_rc2 Kernel 2.5.58 bash-2.05b$ gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs Configured with: /var/tmp/portage/gcc-3.2.1-r6/work/gcc-3.2.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext Thread model: posix gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207 Compile error: drivers/scsi/ini9100u.c:111:2: #error Please convert me to Documentation/DMA-mapping.txt drivers/scsi/ini9100u.c:144: unknown field `next' specified in initializer drivers/scsi/ini9100u.c:144: warning: initialization from incompatible pointer type drivers/scsi/ini9100u.c:144: warning: initialization from incompatible pointer type drivers/scsi/ini9100u.c: In function `i91uBuildSCB': drivers/scsi/ini9100u.c:492: structure has no member named `address' drivers/scsi/ini9100u.c:501: structure has no member named `address' make[3]: *** [drivers/scsi/ini9100u.o] Error 1 make[2]: *** [drivers/scsi] Error 2 make[1]: *** [drivers] Error 2 make: *** [vmlinux] Error 2 Same steps to reproduce as original reporter This driver still does not compile correctly with 2.5.62 *** Bug 707 has been marked as a duplicate of this bug. *** still does not compile in 2.5.74 #error Please convert me to Documentation/DMA-mapping.txt Still fails to compile in 2.6.0-test2 still does not compile in 2.6.0-test4 *** Bug 1178 has been marked as a duplicate of this bug. *** Still does not compile in 2.6.0-test8. Is it going to be fixed in 2.6.0-test*? Created attachment 1187 [details]
fix compile errors in ini9100u
This patch fixes the compile errors in the ini9100u driver. I do not have the
hardware, so it has not been tested. There were major DMA changes needed, so if
someone has the card and would like to help by testing I want to warn them that
the patch is very experimental. (I think there might be a problem in i91uscsi.c
and the sg table usage)
There is also no error handling. It needs to be updated to the new eh style.
When the driver loads you will see an error msg stating that it is not safe to
run the host without EH, but if you read the previous paragraph and you know
the dangers then proceed.
Oh yeah, the patch was made against 2.6.0-test8. It compiles cleanly, I can load it as a module (yes, it's verbose about EH), and detects my card. It finds the correct IRQ (shared with something), base and scsi id. Reset the SCSI bus, then it says: Initio INI-9X00U/UW SCSI device driver; Revision: 1.03g. IMHO it will be ok, but I have to test it with disk I/O. Others: please test it as well! Anyway, do you have a wishlist? Maybe at http://www.amazon.com/exec/obidos/registry/27GCKVV5CGZ2J/ref=cm_aya_bb_wl/104-3581292-9101506 Please mail me in private. I applied the patch to kernel 2.6.0-test8, and it did compile (it did not compile before the patch). But when I booted the new kernel I got a kernel panic when loading the Initio SCSI driver. Note that I compiled support for the ini9100u directly into the kernel, not as a module. I have a Koutech 910U card, it works fine with 2.4.22. OK, I recompiled support for the ini9100u driver as a module in 2.6.0-test8, with the patch, and here is what I got in /var/adm/messages: i91u: PCI Base=0xE000, IRQ=11, BIOS=0xFF000, SCSI ID=7 i91u: Reset SCSI Bus ... ERROR: SCSI host `INI9100U' has no error handling ERROR: This is not a safe way to run your SCSI host ERROR: The error handling must be added to this driver Call Trace: [<c02e28de>] scsi_host_alloc+0x28e/0x2a0 [<e4c9d708>] init_tulip+0x298/0x2b0 [initio] [<c02e290f>] scsi_register+0x1f/0x70 [<e4c9c3d2>] i91u_detect+0x1e2/0x430 [initio] [<e08ce06b>] init_this_scsi_driver+0x6b/0x107 [initio] [<c0130e3c>] sys_init_module+0x12c/0x250 [<c0109315>] sysenter_past_esp+0x52/0x71 scsi0 : Initio INI-9X00U/UW SCSI device driver; Revision: 1.03g Vendor: MEMOREX Model: CD-RW 8220S Rev: 1.16 Type: CD-ROM ANSI SCSI revision: 02 ------------[ cut here ]------------ kernel BUG at include/asm/dma-mapping.h:19! invalid operand: 0000 [#1] CPU: 0 EIP: 0060:[<e4c9c7b8>] Not tainted EFLAGS: 00210046 EIP is at i91uBuildSCB+0x198/0x1c0 [initio] eax: c04d2e00 ebx: d631c3fc ecx: 00000000 edx: d6304d00 esi: d6304d5a edi: d631c43a ebp: db9e5000 esp: d630fc4c ds: 007b es: 007b ss: 0068 Process modprobe (pid: 939, threadinfo=d630e000 task=dd8dc660) Stack: d6304dbc c02e1b94 d6304d54 d631c3fc e4ca1ae0 d6304d00 db9e5000 e4c9c84e e4ca1ae0 d631c3fc d6304d00 d6304d00 d6304d00 00200297 c02e1a29 d6304d00 c02e1c10 c02e4370 00000000 d6304d88 d6304d00 df3aec00 db9e5000 dfaec000 Call Trace: [<c02e1b94>] scsi_init_cmd_from_req+0xd4/0x150 [<e4c9c84e>] i91u_queue+0x6e/0x90 [initio] [<c02e1a29>] scsi_dispatch_cmd+0x139/0x1d0 [<c02e1c10>] scsi_done+0x0/0x70 [<c02e4370>] scsi_times_out+0x0/0x60 [<c02e6b67>] scsi_request_fn+0x1b7/0x2f0 [<c02ab12d>] blk_insert_request+0x7d/0xd0 [<c02e58ba>] scsi_insert_special_req+0x3a/0x40 [<c02e5b09>] scsi_wait_req+0x69/0xa0 [<c02e5a10>] scsi_wait_done+0x0/0x90 [<c02fd083>] get_capabilities+0xa3/0x440 [<c02fccd2>] sr_probe+0x1a2/0x290 [<c0163be2>] dput+0x22/0x220 [<c02a6f8f>] bus_match+0x3f/0x70 [<c02a7001>] device_attach+0x41/0xa0 [<c02a71eb>] bus_add_device+0x5b/0xa0 [<c02a60e7>] device_add+0xa7/0x110 [<c02e8abe>] scsi_device_register+0xde/0x1f0 [<c02e7a44>] scsi_add_lun+0x2a4/0x380 [<c02e14e9>] scsi_allocate_request+0x29/0x70 [<c02e7c3d>] scsi_probe_and_add_lun+0x11d/0x1b0 [<c02e7fb1>] scsi_scan_target+0xa1/0x100 [<c02e8069>] scsi_scan_channel+0x59/0xa0 [<c02e8181>] scsi_scan_host_selected+0xd1/0xe0 [<c02e81bf>] scsi_scan_host+0x2f/0x40 [<e08ce0b4>] init_this_scsi_driver+0xb4/0x107 [initio] [<c0130e3c>] sys_init_module+0x12c/0x250 [<c0109315>] sysenter_past_esp+0x52/0x71 Code: 0f 0b 13 00 f4 04 ca e4 eb d8 89 44 24 08 89 74 24 04 89 3c <6>note: modprobe[939] exited with preempt_count 1 bad: scheduling while atomic! Call Trace: [<c01170c4>] schedule+0x574/0x580 [<c013edb3>] unmap_page_range+0x43/0x70 [<c013efaa>] unmap_vmas+0x1ca/0x230 [<c0142d9b>] exit_mmap+0x7b/0x190 [<c0118ac5>] mmput+0x65/0xc0 [<c011ca4b>] do_exit+0x12b/0x3d0 [<c0109f30>] do_invalid_op+0x0/0xd0 [<c0109bb1>] die+0xe1/0xf0 [<c0109ff9>] do_invalid_op+0xc9/0xd0 [<e4c9c7b8>] i91uBuildSCB+0x198/0x1c0 [initio] [<c0117191>] __wake_up_common+0x31/0x50 [<c01160c4>] recalc_task_prio+0xb4/0x1f0 [<c011629e>] try_to_wake_up+0x9e/0x160 [<c0109511>] error_code+0x2d/0x38 [<e4c9c7b8>] i91uBuildSCB+0x198/0x1c0 [initio] [<c02e1b94>] scsi_init_cmd_from_req+0xd4/0x150 [<e4c9c84e>] i91u_queue+0x6e/0x90 [initio] [<c02e1a29>] scsi_dispatch_cmd+0x139/0x1d0 [<c02e1c10>] scsi_done+0x0/0x70 [<c02e4370>] scsi_times_out+0x0/0x60 [<c02e6b67>] scsi_request_fn+0x1b7/0x2f0 [<c02ab12d>] blk_insert_request+0x7d/0xd0 [<c02e58ba>] scsi_insert_special_req+0x3a/0x40 [<c02e5b09>] scsi_wait_req+0x69/0xa0 [<c02e5a10>] scsi_wait_done+0x0/0x90 [<c02fd083>] get_capabilities+0xa3/0x440 [<c02fccd2>] sr_probe+0x1a2/0x290 [<c0163be2>] dput+0x22/0x220 [<c02a6f8f>] bus_match+0x3f/0x70 [<c02a7001>] device_attach+0x41/0xa0 [<c02a71eb>] bus_add_device+0x5b/0xa0 [<c02a60e7>] device_add+0xa7/0x110 [<c02e8abe>] scsi_device_register+0xde/0x1f0 [<c02e7a44>] scsi_add_lun+0x2a4/0x380 [<c02e14e9>] scsi_allocate_request+0x29/0x70 [<c02e7c3d>] scsi_probe_and_add_lun+0x11d/0x1b0 [<c02e7fb1>] scsi_scan_target+0xa1/0x100 [<c02e8069>] scsi_scan_channel+0x59/0xa0 [<c02e8181>] scsi_scan_host_selected+0xd1/0xe0 [<c02e81bf>] scsi_scan_host+0x2f/0x40 [<e08ce0b4>] init_this_scsi_driver+0xb4/0x107 [initio] [<c0130e3c>] sys_init_module+0x12c/0x250 [<c0109315>] sysenter_past_esp+0x52/0x71 scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 2 lun 0 Unable to handle kernel paging request at virtual address 00080df8 printing eip: 00080df8 *pde = 00000000 Oops: 0000 [#2] CPU: 0 EIP: 0060:[<00080df8>] Not tainted EFLAGS: 00010016 EIP is at 0x80df8 eax: df755c98 ebx: f77306c6 ecx: 00000000 edx: 00000003 esi: 00000000 edi: 00000001 ebp: d631bf40 esp: d631bf24 ds: 007b es: 007b ss: 0068 Process scsi_eh_0 (pid: 940, threadinfo=d631a000 task=dba68720) Stack: c0117191 df755c98 00000003 00000000 d631a000 00000296 d6304d00 d631bf60 c01172fe d630fd38 00000003 00000001 00000000 df3aec00 db9e5000 d631bfa8 c02e1e19 d6304d00 d6304dbc 00000040 d631bfa8 d631bfa8 00000282 c02e541f Call Trace: [<c0117191>] __wake_up_common+0x31/0x50 [<c01172fe>] complete+0x3e/0x60 [<c02e1e19>] scsi_finish_command+0x79/0xc0 [<c02e541f>] scsi_eh_flush_done_q+0x3f/0x70 [<c02e54e2>] scsi_unjam_host+0x92/0xd0 [<c02e55f1>] scsi_error_handler+0xd1/0x110 [<c02e5520>] scsi_error_handler+0x0/0x110 [<c0107189>] kernel_thread_helper+0x5/0xc Code: Bad EIP value. <6>note: scsi_eh_0[940] exited with preempt_count 1 Created attachment 1271 [details]
fixes DMA_NONE case
I wasn't handling the DMA_NONE case properly. This patch was made against
2.6.0-test9, but it will apply to test8 too.
I just tried test9 with the new patch, initio module still won't load properly, still got the same errors. Comment on attachment 1271 [details]
fixes DMA_NONE case
I was looking at dma_bidirectional and dma_none cross eyed :)
Created attachment 1307 [details]
fix DMA_NONE case (2nd try)
OK, that new patch worked. The initio module loaded and all my SCSI devices were detected and function properly. Thanks a lot! Created attachment 1740 [details] INI-9100UW driver failure in 2.6.0 -- files from /proc and /sys and kernel messages Contains: Kernel 2.6.0 + Mike Christie's patch (initio driver built into kernel) + Ben Slusky's loop device patches (please see http://marc.theaimsgroup.com/?l=linux-kernel&m=107208761928132&w=2): /proc/interrupts /proc/ioports /proc/iomem /sys/bus/scsi hierarchy syslog extract of kern.* from klogd start to root mount lspci output kernel configuration Kernel 2.6.0 + Mike Christie's patch (initio driver built as module) + Ben Slusky's loop device patches (please see http://marc.theaimsgroup.com/?l=linux-kernel&m=107208761928132&w=2): /proc/interrupts before and after load /proc/ioports before and after load /proc/iomem before and after load /sys/bus/scsi hierarchy after load syslog extract of kern.* from klogd load onward lspci output before and after load kernel configuration dmesg output before and after load and removal Kernel 2.4.23-ck1 (using Con Kolivas and Eric Hustvedt's scheduler patches; please see http://www.plumlocosoft.com/kernel/): /proc/interrupts /proc/ioports /proc/iomem /proc/scsi hierarchy syslog extract of kern.* from klogd start to root mount lspci output kernel configuration Tested this patch with stock 2.6.0 release + the loop patches by Ben Slusky as posted on linux-kernel (please see http://marc.theaimsgroup.com/?l=linux-kernel&m=107208761928132&w=2). Tried with a Koutech KW-910UW (appears to be a clone of the Initio INI-9100UW reference design) with a single IBM UltraStar 36LZX 36GB drive. Building and loading as a module as well as building the driver statically into the kernel image resulted in a failure (device offlined - not ready after error recovery). Here's an extract from dmesg: PCI: Found IRQ 11 for device 0000:00:11.0 i91u: PCI Base=0x6100, IRQ=11, BIOS=0xC8000, SCSI ID=7 i91u: Reset SCSI Bus ... ERROR: SCSI host `INI9100U' has no error handling ERROR: This is not a safe way to run your SCSI host ERROR: The error handling must be added to this driver Call Trace: [<c01f5056>] scsi_host_alloc+0x67/0x262 [<c01f5261>] scsi_register+0x10/0x51 [<c01fcfbd>] i91u_detect+0x1d3/0x372 [<c034a892>] init_this_scsi_driver+0x50/0xe0 [<c0336619>] do_initcalls+0x32/0x80 [<c01050a6>] init+0x2f/0x109 [<c0105077>] init+0x0/0x109 [<c01083ed>] kernel_thread_helper+0x5/0xb scsi0 : Initio INI-9X00U/UW SCSI device driver; Revision: 1.03g Vendor: IBM Model: DDYS-T36950M Rev: SC4D Type: Direct-Access ANSI SCSI revision: 03 SCSI device sda: 71687340 512-byte hdwr sectors (36704 MB) SCSI device sda: drive cache: write back /dev/scsi/host0/bus0/target1/lun0:<6>scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 1 lun 0 SCSI error : <0 0 1 0> return code = 0x6000000 end_request: I/O error, dev sda, sector 0 Buffer I/O error on device sda, logical block 0 Buffer I/O error on device sda, logical block 1 scsi0 (1:0): rejecting I/O to offline device Buffer I/O error on device sda, logical block 0 Buffer I/O error on device sda, logical block 1 scsi0 (1:0): rejecting I/O to offline device Buffer I/O error on device sda, logical block 17921834 scsi0 (1:0): rejecting I/O to offline device Buffer I/O error on device sda, logical block 17921834 scsi0 (1:0): rejecting I/O to offline device Buffer I/O error on device sda, logical block 0 Buffer I/O error on device sda, logical block 1 ldm_validate_partition_table(): Disk read failed. scsi0 (1:0): rejecting I/O to offline device Buffer I/O error on device sda, logical block 0 Buffer I/O error on device sda, logical block 1 unable to read partition table Attached scsi disk sda at scsi0, channel 0, id 1, lun 0 Additionally, while removing the initio module (when it was built as one): Initio INI-9X00U/UW SCSI device driver; Revision: 1.03g did not call scsi_unregister Call Trace: [<c88b6327>] exit_this_scsi_driver+0xa7/0xec [initio] [<c012d547>] sys_delete_module+0x145/0x166 [<c013f897>] do_munmap+0x139/0x145 [<c0109fc7>] syscall_call+0x7/0xb After the SCSI device sda: drive cache: write back message, the disk access LED comes on, and does not turn off. (To see the timing of what happens, please see the initio-report.tar.bz2 attachment; it contains an extract from syslog with timestamps.) The accompanying attachment initio-report.tar.bz2 contains information pulled from /proc, /sys, syslog and dmesg in four situations: 2.6.0 with the driver built into the kernel, 2.6.0 with the driver built as a module, but not yet loaded, 2.6.0 with the driver built and loaded as a module, and 2.4.23 with Con Kolivas' scheduler patches with the driver built into the kernel. It also incorporates the kernel configuration used in each case. The hardware being used is: FIC 586IPVG motherboard (uses Intel 430VX chipset: PIIX3) with 512 MB direct-mapped L2 cache AMD K6-2 400 MHz CPU at 66 MHz system bus 128MB FPM DRAM (4 72-pin SIMMs of 32MB each; non-parity) Koutech KW-910UW HBA (Initio INI-9100UW clone) IBM Ultrastar 36LZX (36GB model) SIIG-branded Silicon Image SiI680-based ATA-133 controller card Maxtor DiamondMax D740X (6L080L4) ATA hard disk (80GB) on SiI680 controller; carries root filesystem Western Digital AC34300 ATA hard disk on SiI680 controller Two ATAPI CD-ROM drives set as secondary master and slave on PIIX3 onboard IDE controller 3.5" floppy disk drive on onboard FDC STLab-branded RealTek 8139C 10/100 Ethernet controller card Cirrus Logic CLGD5430 PCI VGA display adapter SoundBlaster 16 ISA non-PnP jumpered (one of the full-length ones from 1994) Prolink-branded Rockwell K56flex ISA PnP internal modem, flashed for V.90 operation I hope this information helps you. Dear Mr Gurdasani, Please try it with the newer patch from Mr Christie ( http://bugme.osdl.org/attachment.cgi?id=1307&action=view ). As it seems you use an older version. Thanks, GCS I used the patch mentioned here: http://marc.theaimsgroup.com/?l=linux-scsi&m=107118845311085&w=2 This seems to be similar to the attachment (and, in fact, the patch I used earlier adds a check). Nevertheless, I'll try it out and report the results. (I was surprised to see the version being reported as 1.03g, even though the source code for ini9100u.c sets it to 1.04.) Thanks. --- drivers/scsi/ini9100u.c 2003-12-25 20:10:31.000000000 +0400 +++ ini9100u.c 2003-12-25 20:10:12.000000000 +0400 @@ -307,6 +307,12 @@ if (((dRegValue & 0xFF00) >> 8) == 0xFF) dRegValue = 0; wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8)); + if (pci_set_dma_mask(pDev, 0xffffffff)) { + printk(KERN_WARNING + "i91u: Could not set 32 bit DMA mask\n"); + continue; + } + if (Addi91u_into_Adapter_table(wBIOS, (pDev->resource[0].start), pDev->irq, Using the patch GCS indicated, the behavior was similar to my earlier runs. During this trial run, I noticed that loading the initio module allows the drive to be detected just fine. It's when I load the sd_mod.ko (SCSI disk driver) module that the I/O errors occur and the LED comes and stays on. Season's greetings, Amit Hi Amit and all, I am pretty sure we solved this bug. Look here for the newest-newest :) patch: http://marc.theaimsgroup.com/?l=linux-scsi&m=107183277605352&w=2 It is in the SCSI maintainer's tree so hopefully it will be in the next release. I am currently working on the error handling. I should be able to get something out after the holiday vacation for everyone to test. That newest patch worked wonderfully, thank you. (Serves me right for not having searched linux-scsi archives thoroughly.) It appears the code is broken for 2.6.4 now: drivers/scsi/ini9100u.c: In function `i91u_intr': drivers/scsi/ini9100u.c:281: error: `hreg' undeclared (first use in this function) drivers/scsi/ini9100u.c:281: error: (Each undeclared identifier is reported only once drivers/scsi/ini9100u.c:281: error: for each function it appears in.) drivers/scsi/ini9100u.c: At top level: drivers/scsi/ini9100u.c:183: warning: `i91u_intr0' declared `static' but never defined drivers/scsi/ini9100u.c:184: warning: `i91u_intr1' declared `static' but never defined drivers/scsi/ini9100u.c:185: warning: `i91u_intr2' declared `static' but never defined drivers/scsi/ini9100u.c:186: warning: `i91u_intr3' declared `static' but never defined drivers/scsi/ini9100u.c:187: warning: `i91u_intr4' declared `static' but never defined drivers/scsi/ini9100u.c:188: warning: `i91u_intr5' declared `static' but never defined drivers/scsi/ini9100u.c:189: warning: `i91u_intr6' declared `static' but never defined drivers/scsi/ini9100u.c:190: warning: `i91u_intr7' declared `static' but never defined make[2]: *** [drivers/scsi/ini9100u.o] Error 1 make[1]: *** [drivers/scsi] Error 2 make: *** [drivers] Error 2 This was fixed, but did not make it to 2.6.4. It should be in th next rc release. You can grab the patch here until then. http://linux-scsi.bkbits.net:8080/scsi-for-linus-2.6/cset@1.1612.10.4 Definitively fixed, should be closed this bug? Thanks for everyone that tested these patches. Closing Bug. |