Error using DC315U to drive ScanJet 4c
Subsystems (2)
Hi!
I just connected my old HP ScanJet 4c to my new DC315U SCSI adapter (connected to an ASRock 939Dual-SATA2 motherboard with AMD Athlon 64 X2) and tried using the dc395x kernel module with Linux 2.6.15 and scan an image using xscanimage.
Sometimes it works, but sometimes xscanimage hangs for a long time and then aborts with a message about I/O error. When that happends, the following is printed in the dmesg output:
drivers/scsi/dc395x.c: Please, contact <[email protected]> to help improve support for your system.
dc395x: reselect: w/o disconnected cmds <02-0>
dc395x: disconnect: Unexpected reselection <02-0>
So, what can I do to help you resolve this? (I'm familiar with kernel programming, in case you need me to check something "complicated".)
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Fredrik Roubert
Hi!
I just connected my old HP ScanJet 4c to my new DC315U SCSI adapter (connected to an ASRock 939Dual-SATA2 motherboard with AMD Athlon 64 X2) and tried using the dc395x kernel module with Linux 2.6.15 and scan an image using xscanimage.
Quoted 7 lines
Sometimes it works, but sometimes xscanimage hangs for a long time and then aborts with a message about I/O error. When that happends, the following is printed in the dmesg output:
drivers/scsi/dc395x.c: Please, contact <[email protected]> to help improve support for your system.
dc395x: reselect: w/o disconnected cmds <02-0>
dc395x: disconnect: Unexpected reselection <02-0>
Wow! Youppy-yey! It worked!!:-)) Oh, how I waited for this email!:-)
Ok, making a long story short - you run into a VERY (I think) rare situation when you controller doesn't transfer all the data per DMA and the driver tries to transfer the rest in PIO mode. And this mode is currently broken. We know that, but because noone could reproduce such a situation, we couldn't test any fixes. So, I just suggested to put this request in the driver and hope that the person with such a setup will indeed notice it and write to the list and will also help debug possible fixes for this situation.
...and your 64-bit dual-core CPU makes it even more fun. On the other hand, it means we won't be able to test it on highmem... Unless you agree to swap it to a 32-bit machine for a test:-)
Now, I hada patch for this. I just have to dig it out, re-diff it against 2.6.15 and send to you. One warning - while debugging we might crash your machine a couple of times, perhaps corrupt some data... Do you have, maybe, a test machine without important data on it for first tests, or at least, backup all your valuables. You've been warned:-)
Quoted 2 lines
So, what can I do to help you resolve this? (I'm familiar with kernel programming, in case you need me to check something "complicated".)
Unless you want to dig out my patch from list-archives and start testing it yourself, please wait until I send you an updated patch. Don't worry, it will be "complicated" enough:-)
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 14 lines · Guennadi Liakhovetski
Quoted 12 lines · Fredrik Roubert
I just connected my old HP ScanJet 4c to my new DC315U SCSI adapter (connected to an ASRock 939Dual-SATA2 motherboard with AMD Athlon 64 X2) and tried using the dc395x kernel module with Linux 2.6.15 and scan an image using xscanimage.
Sometimes it works, but sometimes xscanimage hangs for a long time and then aborts with a message about I/O error. When that happends, the following is printed in the dmesg output:
drivers/scsi/dc395x.c: Please, contact <[email protected]> to help improve support for your system.
dc395x: reselect: w/o disconnected cmds <02-0>
dc395x: disconnect: Unexpected reselection <02-0>
...
Quoted 3 lines
Unless you want to dig out my patch from list-archives and start testing it yourself, please wait until I send you an updated patch. Don't worry, it will be "complicated" enough:-)
Ok, if you feel adventurous, you might try the patch below. Otherwise, you might want to wait until I also test-run it - so far only compile-tested. But even if I run-test it, I will not be able to test those PIO paths, so...
Thanks
Guennadi
---
Guennadi Liakhovetski
Index: drivers/scsi/dc395x.c
===================================================================
RCS file: /usr/src/cvs/linux-2_6/drivers/scsi/dc395x.c,v retrieving revision 1.1.1.9
drivers/scsi/dc395x.c +164 -91
@@ -230,12 +230,8 @@struct scsi_cmnd *cmd;struct SGentry *segment_x;/* Linear array of hw sg entries (up to 64 entries) */ -u32 sg_bus_addr;/* Bus address of sg list (ie, of segment_x) */ - -u8 sg_count;/* No of HW sg entries for this request */ -u8 sg_index;/* Index of HW sg entry for this request */ -u32 total_xfer_length;/* Total number of bytes remaining to be transfered */ -unsigned char *virt_addr;/* Virtual address of current transfer position */ +size_t total_xfer_length;/* Total number of bytes remaining to be transfered */ +size_t request_length;/* Total number of bytes in this request */ /* * The sense buffer handling function, request_sense, uses
@@ -246,7 +242,12 @@* total_xfer_length in xferred. These values are restored in * pci_unmap_srb_sense. This is the only place xferred is used. */ -u32 xferred;/* Saved copy of total_xfer_length */ +size_t xferred;/* Saved copy of total_xfer_length */ + +dma_addr_t sg_bus_addr;/* Bus address of sg list (ie, of segment_x) */ + +u8 sg_count;/* No of HW sg entries for this request */ +u8 sg_index;/* Index of HW sg entry for this request */ u16 state;
@@ -976,17 +977,6 @@ } } -static inline void pio_trigger (void ) -{ -static int feedback_requested; - -if (!feedback_requested) { - feedback_requested =1 ; -printk (KERN_WARNING "%s: Please, contact <[email protected]> " -"to help improve support for your system.\n" , __FILE__); - } -} -/* Prepare SRB for being sent to Device DCB w/ command *cmd */ static void build_srb (struct scsi_cmnd *cmd,struct DeviceCtlBlk *dcb,struct ScsiReqBlk *srb)
@@ -1000,7 +990,6 @@ srb->sg_count =0 ; srb->total_xfer_length =0 ; srb->sg_bus_addr =0 ; - srb->virt_addr =NULL ; srb->sg_index =0 ; srb->adapter_status =0 ; srb->target_status =0 ;
@@ -1031,7 +1020,6 @@ reqlen, cmd->request_buffer, cmd->use_sg, srb->sg_count); - srb->virt_addr =page_address (sl->page);for (i =0 ; i < srb->sg_count; i++) {u32 busaddr = (u32 )sg_dma_address (&sl[i]);u32 seglen = (u32 )sl[i].length;
@@ -1063,7 +1051,7 @@ PCI_DMA_TODEVICE);dprintkdbg (DBG_SG ,"build_srb: [n] map sg %p->%08x(%05x)\n" , - srb->segment_x, srb->sg_bus_addr,SEGMENTX_LEN ); + srb->segment_x, (u32 )srb->sg_bus_addr,SEGMENTX_LEN ); }else { srb->total_xfer_length = cmd->request_bufflen; srb->sg_count =1 ;
@@ -1076,12 +1064,14 @@ srb->total_xfer_length++; srb->segment_x[0 ].length = srb->total_xfer_length; - srb->virt_addr = cmd->request_buffer; +dprintkdbg (DBG_0 ,"build_srb: [1] len=%d buf=%p use_sg=%d map=%08x\n" , srb->total_xfer_length, cmd->request_buffer, cmd->use_sg, srb->segment_x[0 ].address); } + + srb->request_length = srb->total_xfer_length; }
@@ -1975,14 +1965,11 @@/* * Compute the next Scatter Gather list index and adjust its length -* and address if necessary; also compute virt_addr +* and address if necessary */ static void sg_update_list (struct ScsiReqBlk *srb,u32 left) {u8 idx; -struct scatterlist *sg; -struct scsi_cmnd *cmd = srb->cmd; -int segment = cmd->use_sg;u32 xferred = srb->total_xfer_length - left;/* bytes transfered */ struct SGentry *psge = srb->segment_x + srb->sg_index;
@@ -2015,29 +2002,6 @@ psge++; }sg_verify_length (srb); - -/* we need the corresponding virtual address */ -if (!segment) { - srb->virt_addr += xferred; -return ; - } - -/* We have to walk the scatterlist to find it */ - sg = (struct scatterlist *)cmd->request_buffer; -while (segment--) { -unsigned long mask = - ~((unsigned long )sg->length -1 ) &PAGE_MASK ; -if ((sg_dma_address (sg) & mask) == (psge->address & mask)) { - srb->virt_addr = (page_address (sg->page) - + psge->address - - (psge->address &PAGE_MASK )); -return ; - } - ++sg; - } - -dprintkl (KERN_ERR ,"sg_update_list: sg_to_virt failed\n" ); - srb->virt_addr =NULL ; }
@@ -2049,15 +2013,17 @@*/ static void sg_subtract_one (struct ScsiReqBlk *srb) { +struct SGentry *psge = srb->segment_x + srb->sg_index; + srb->total_xfer_length--; - srb->segment_x[srb->sg_index].length--; + psge->length--;if (srb->total_xfer_length && - !srb->segment_x[srb->sg_index].length) { + !psge->length) {if (debug_enabled (DBG_PIO ))printk (" (next segment)" ); srb->sg_index++; -sg_update_list (srb, srb->total_xfer_length); - } + }else + psge->address++; }
@@ -2216,7 +2182,6 @@ srb->total_xfer_length - diff;sg_update_list (srb, d_left_counter);/*srb->total_xfer_length -= diff; */ -/*srb->virt_addr += diff; */ /*if (srb->cmd->use_sg) */ /* srb->sg_index++; */ }
@@ -2238,12 +2203,52 @@data_io_transfer (acb, srb,XFERDATAOUT ); } +/** +* dc395_kmap_atomic_sg - find and atomically map an sg-elemnt +* @sg: scatter-gather list +* @sg_count: number of segments in sg +* @offset: offset in bytes into sg, on return offset into the mapped area +* @len: on return number of bytes mapped +* +* Returns virtual address of the start of the mapped page +*/ +static void *dc395x_kmap_atomic_sg (struct scatterlist *sg,int sg_count,size_t *offset,size_t *len) +{ +int i; +size_t sg_len =0 , l2 =0 ; +struct page *page; + +for (i =0 ; i < sg_count; i++) { + l2 = sg_len;/* Complete sg-entries */ + sg_len += sg[i].length; +if (sg_len > *offset) +break ; + } + +BUG_ON (i == sg_count); + +/* Offset starting from the beginning of first page in this sg-entry */ + *offset = *offset - l2 + sg[i].offset; + +/* Assumption: contiguous pages can be accessed as "page + i" */ + page = sg[i].page + (*offset >>PAGE_SHIFT ); + *offset &= ~PAGE_MASK ; + +/* Bytes in this sg-entry from *offset to the end of the page */ + *len =PAGE_SIZE - *offset; + +return kmap_atomic (page,KM_BIO_SRC_IRQ ); +} + +static void dc395x_kunmap_atomic_sg (void *virt) +{ +kunmap_atomic (virt,KM_BIO_SRC_IRQ ); +}static void data_in_phase0 (struct AdapterCtlBlk *acb,struct ScsiReqBlk *srb,u16 *pscsi_status) {u16 scsi_status = *pscsi_status; -u32 d_left_counter =0 ;dprintkdbg (DBG_0 ,"data_in_phase0: (pid#%li) <%02i-%i>\n" , srb->cmd->pid, srb->cmd->device->id, srb->cmd->device->lun);
@@ -2261,6 +2266,7 @@* seem to be a bad idea, actually. */ if (!(srb->state &SRB_XFERPAD )) { +unsigned int d_left_counter, max_left;if (scsi_status &PARITYERROR ) {dprintkl (KERN_INFO ,"data_in_phase0: (pid#%li) " "Parity Error\n" , srb->cmd->pid);
@@ -2313,44 +2319,85 @@DC395x_read32 (acb,TRM_S1040_DMA_CXCNT ), srb->total_xfer_length, d_left_counter);#if DC395x_LASTPIO + max_left =max (d_left_counter, srb->total_xfer_length);/* KG: Less than or equal to 4 bytes can not be transfered via DMA, it seems. */ if (d_left_counter && srb->total_xfer_length <= DC395x_LASTPIO) { +size_t left_io = srb->total_xfer_length; +/*u32 addr = (srb->segment_x[srb->sg_index].address); */ /*sg_update_list (srb, d_left_counter); */ -dprintkdbg (DBG_PIO ,"data_in_phase0: PIO (%i %s) to " -"%p for remaining %i bytes:" , +dprintkdbg (DBG_PIO ,"data_in_phase0: PIO (%i %s) " +"for remaining %i bytes:" ,DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ) &0x1f , (srb->dcb->sync_period &WIDE_SYNC ) ?"words" :"bytes" , - srb->virt_addr, srb->total_xfer_length);if (srb->dcb->sync_period &WIDE_SYNC )DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,CFG2_WIDEFIFO ); -while (DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ) !=0x40 ) { -u8 byte =DC395x_read8 (acb,TRM_S1040_SCSI_FIFO ); -pio_trigger (); - *(srb->virt_addr)++ = byte; -if (debug_enabled (DBG_PIO )) -printk (" %02x" , byte); - d_left_counter--; -sg_subtract_one (srb); - } -if (srb->dcb->sync_period &WIDE_SYNC ) { -#if 1 -/* Read the last byte ... */ -if (srb->total_xfer_length >0 ) { -u8 byte =DC395x_read8 (acb,TRM_S1040_SCSI_FIFO ); -pio_trigger (); - *(srb->virt_addr)++ = byte; - srb->total_xfer_length--; + +while (left_io) { +unsigned char *virt, *base =NULL ; +unsigned long flags =0 ; +size_t len; +u8 fifocnt =0 ; + +if (srb->cmd->use_sg) { +size_t offset = srb->request_length - left_io; +local_irq_save (flags); +/* Assumption: it's inside one page as it's at most 4 bytes and +I just assume it's on a 4-byte boundary */ + base =dc395x_kmap_atomic_sg ((struct scatterlist *)srb->cmd->request_buffer, + srb->sg_count, &offset, &len); + virt = base + offset; + }else { + virt = srb->cmd->request_buffer + srb->cmd->request_bufflen - left_io; + len = left_io; + } + left_io -= len; + +while (len) { +u8 byte; + fifocnt =DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ); + +if (fifocnt ==0x40 ) { + left_io =0 ; +break ; + } + + byte =DC395x_read8 (acb,TRM_S1040_SCSI_FIFO ); + *virt++ = byte; +if (debug_enabled (DBG_PIO ))printk (" %02x" , byte); + + d_left_counter--; +sg_subtract_one (srb); + + len--; } + +if (fifocnt ==0x40 && (srb->dcb->sync_period &WIDE_SYNC )) { +#if 1 +/* Read the last byte ... */ +if (srb->total_xfer_length >0 ) { +u8 byte =DC395x_read8 (acb,TRM_S1040_SCSI_FIFO ); + *virt++ = byte; + srb->total_xfer_length--; +if (debug_enabled (DBG_PIO )) +printk (" %02x" , byte); + }#endif -DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,0 ); +DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,0 ); + } + +if (srb->cmd->use_sg) { +dc395x_kunmap_atomic_sg (base); +local_irq_restore (flags); + } } +/*printk(" %08x", *(u32*)(bus_to_virt (addr))); */ /*srb->total_xfer_length = 0; */ if (debug_enabled (DBG_PIO ))
@@ -2463,7 +2510,7 @@if (srb->cmd->use_sg) {/* with S/G */ io_dir |=DMACMD_SG ;DC395x_write32 (acb,TRM_S1040_DMA_XLOWADDR , - srb->sg_bus_addr + + (u32 )srb->sg_bus_addr +sizeof (struct SGentry ) * srb->sg_index);/* load how many bytes in the sg list table */
@@ -2508,23 +2555,45 @@ SCMD_FIFO_IN); }else {/* write */ int ln = srb->total_xfer_length; +size_t left_io = srb->total_xfer_length; +if (srb->dcb->sync_period &WIDE_SYNC )DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,CFG2_WIDEFIFO ); -dprintkdbg (DBG_PIO , -"data_io_transfer: PIO %i bytes from %p:" , - srb->total_xfer_length, srb->virt_addr); - -while (srb->total_xfer_length) { -if (debug_enabled (DBG_PIO )) -printk (" %02x" , (unsigned char ) *(srb->virt_addr)); - -pio_trigger (); -DC395x_write8 (acb,TRM_S1040_SCSI_FIFO , - *(srb->virt_addr)++); -sg_subtract_one (srb); +while (left_io) { +unsigned char *virt, *base =NULL ; +unsigned long flags =0 ; +size_t len; + +if (srb->cmd->use_sg) { +size_t offset = srb->request_length - left_io; +local_irq_save (flags); +/* Again, max 4 bytes */ + base =dc395x_kmap_atomic_sg ((struct scatterlist *)srb->cmd->request_buffer, + srb->sg_count, &offset, &len); + virt = base + offset; + }else { + virt = srb->cmd->request_buffer + srb->cmd->request_bufflen - left_io; + len = left_io; + } + left_io -= len; + +while (len--) { +if (debug_enabled (DBG_PIO )) +printk (" %02x" , *virt); + +DC395x_write8 (acb,TRM_S1040_SCSI_FIFO , *virt++); + +sg_subtract_one (srb); + } + +if (srb->cmd->use_sg) { +dc395x_kunmap_atomic_sg (base); +local_irq_restore (flags); + } } +if (srb->dcb->sync_period &WIDE_SYNC ) {if (ln %2 ) {DC395x_write8 (acb,TRM_S1040_SCSI_FIFO ,0 );
@@ -3282,7 +3351,7 @@if (cmd->use_sg && dir !=PCI_DMA_NONE ) {/* unmap DC395x SG list */ dprintkdbg (DBG_SG ,"pci_unmap_srb: list=%08x(%05x)\n" , - srb->sg_bus_addr,SEGMENTX_LEN ); + (u32 )srb->sg_bus_addr,SEGMENTX_LEN );pci_unmap_single (acb->dev, srb->sg_bus_addr,SEGMENTX_LEN ,PCI_DMA_TODEVICE );
@@ -4820,6 +4889,7 @@unsigned long io_port_base;unsigned int io_port_len;unsigned int irq; +int ret = -ENODEV ;dprintkdbg (DBG_0 ,"Init one instance (%s)\n" ,pci_name (dev));banner_display ();
@@ -4834,6 +4904,9 @@ irq = dev->irq;dprintkdbg (DBG_0 ,"IO_PORT=0x%04lx, IRQ=0x%x\n" , io_port_base, dev->irq); +if ((ret =pci_set_dma_mask (dev,DMA_32BIT_MASK ))) + goto fail; +/* allocate scsi host information (includes out adapter) */ scsi_host =scsi_host_alloc (&dc395x_driver_template,sizeof (struct AdapterCtlBlk ));
@@ -4869,7 +4942,7 @@if (scsi_host !=NULL )scsi_host_put (scsi_host);pci_disable_device (dev); -return -ENODEV ; +return ret; }
Quoted 2 lines · Guennadi Liakhovetski
We know that, but because noone could reproduce such a situation, we couldn't test any fixes.
;-)
Quoted 3 lines
...and your 64-bit dual-core CPU makes it even more fun. On the other hand, it means we won't be able to test it on highmem... Unless you agree to swap it to a 32-bit machine for a test:-)
I actually have an old Pentium machine standing by that I could use for testing (when the driver seems to work).
Quoted 3 lines
Do you have, maybe, a test machine without important data on it for first tests, or at least, backup all your valuables. You've been warned:-)
;-) I depend on ReiserFS and good luck ... That's enough most of the time.
Quoted 1 line · Guennadi Liakhovetski
Ok, if you feel adventurous, you might try the patch below.
OK, that patch compiles with the following warnings:
drivers/scsi/dc395x.c: In function ‘dump_register_info’:drivers/scsi/dc395x.c:1226: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘size_t’ drivers/scsi/dc395x.c: In function ‘data_in_phase0’:drivers/scsi/dc395x.c:2322: warning: comparison of distinct pointer types lacks a cast drivers/scsi/dc395x.c: In function ‘dc395x_init_one’:drivers/scsi/dc395x.c:4357: warning: ‘ptr’ may be used uninitialized in this function
Then it gives the following syslog output when I load the module and try to scan an image:
Feb 13 18:00:39 skalman kernel: dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 13 18:00:39 skalman kernel: ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 Feb 13 18:00:39 skalman kernel: dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 Feb 13 18:00:39 skalman kernel: dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s Feb 13 18:00:39 skalman kernel: dc395x: Connectors: Termination: Auto Low High Feb 13 18:00:39 skalman kernel: dc395x: Performing initial SCSI bus reset Feb 13 18:00:39 skalman kernel: scsi3 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 13 18:00:41 skalman kernel: Vendor: HP Model: C2520A Rev: 3503 Feb 13 18:00:41 skalman kernel: Type: Processor ANSI SCSI revision: 02 Feb 13 18:00:41 skalman kernel: 3:0:2:0: Attached scsi generic sg2 type 3 Feb 13 18:02:57 skalman kernel: dc395x: reselect: w/o disconnected cmds <02-0> Feb 13 18:02:57 skalman kernel: dc395x: disconnect: Unexpected reselection <02-0> Feb 13 18:04:57 skalman kernel: dc395x: eh_abort: (pid#751) target=<02-0> cmd=ffff81007eb64080 Feb 13 18:04:57 skalman kernel: dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#751) target=<02-0> cmd=ffff81007eb64080 Feb 13 18:04:57 skalman kernel: dc395x: doing_srb_done: pids G:751(02-0)
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Fredrik Roubert
Quoted 3 lines · Guennadi Liakhovetski
...and your 64-bit dual-core CPU makes it even more fun. On the other hand, it means we won't be able to test it on highmem... Unless you agree to swap it to a 32-bit machine for a test:-)
I actually have an old Pentium machine standing by that I could use for testing (when the driver seems to work).
...and you still use your presumably main desktop PC for testing... brave man:-)
Quoted 8 lines
Quoted 1 line
Ok, if you feel adventurous, you might try the patch below.
OK, that patch compiles with the following warnings:
drivers/scsi/dc395x.c: In function ‘dump_register_info’:drivers/scsi/dc395x.c:1226: warning: format ‘%i’ expects type ‘int’, but argument 5 has type ‘size_t’drivers/scsi/dc395x.c: In function ‘data_in_phase0’:drivers/scsi/dc395x.c:2322: warning: comparison of distinct pointer types lacks a cast
64 bit... the first one might be fixed with the attached, the second one I removed altogether.
Quoted 2 lines
drivers/scsi/dc395x.c: In function ‘dc395x_init_one’:drivers/scsi/dc395x.c:4357: warning: ‘ptr’ may be used uninitialized in this function
Actually, even a compiler can guess, that it cannot be used uninitialised here. Mine, actually, doesn't complain. What version are you using?
Quoted 18 lines
Then it gives the following syslog output when I load the module and try to scan an image:
Feb 13 18:00:39 skalman kernel: dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 13 18:00:39 skalman kernel: ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 Feb 13 18:00:39 skalman kernel: dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 Feb 13 18:00:39 skalman kernel: dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s Feb 13 18:00:39 skalman kernel: dc395x: Connectors: Termination: Auto Low High Feb 13 18:00:39 skalman kernel: dc395x: Performing initial SCSI bus reset Feb 13 18:00:39 skalman kernel: scsi3 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 13 18:00:41 skalman kernel: Vendor: HP Model: C2520A Rev: 3503 Feb 13 18:00:41 skalman kernel: Type: Processor ANSI SCSI revision: 02 Feb 13 18:00:41 skalman kernel: 3:0:2:0: Attached scsi generic sg2 type 3 Feb 13 18:02:57 skalman kernel: dc395x: reselect: w/o disconnected cmds <02-0> Feb 13 18:02:57 skalman kernel: dc395x: disconnect: Unexpected reselection <02-0> Feb 13 18:04:57 skalman kernel: dc395x: eh_abort: (pid#751) target=<02-0> cmd=ffff81007eb64080 Feb 13 18:04:57 skalman kernel: dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#751) target=<02-0> cmd=ffff81007eb64080 Feb 13 18:04:57 skalman kernel: dc395x: doing_srb_done: pids G:751(02-0)
It might indeed be a hardware error in the end... Please, try the attached patch. It only adds a couple of printk's on the top of the previous one. As the problem happens only ones, hopefully, nothing bad will happen. The only thing I am not entirely sure about - you might get a warning for calling printk under spinlock_irqsave, if you have respective debugging enabled, I think. Then we'll hopefully see if at least for you the original patch does the right thing...
Thanks
Guennadi
---
Guennadi Liakhovetski
drivers/scsi/dc395x.c +11 -3
@@ -1221,7 +1221,7 @@ srb, srb->cmd, srb->cmd->pid, srb->cmd->cmnd[0 ], srb->cmd->device->id, srb->cmd->device->lun); -printk (" sglist=%p cnt=%i idx=%i len=%i\n" , +printk (" sglist=%p cnt=%i idx=%i len=%u\n" , srb->segment_x, srb->sg_count, srb->sg_index, srb->total_xfer_length); printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n",
@@ -2227,6 +2227,9 @@BUG_ON (i == sg_count); +printk (KERN_DEBUG "dc395x: Found sg-entry #%d[%u] of %d, offset %u after %u bytes for offset %u\n" , + i, sg[i].length, sg_count, sg[i].offset, l2, *offset); +/* Offset starting from the beginning of first page in this sg-entry */ *offset = *offset - l2 + sg[i].offset;
@@ -2266,7 +2269,7 @@* seem to be a bad idea, actually. */ if (!(srb->state &SRB_XFERPAD )) { -unsigned int d_left_counter, max_left; +unsigned int d_left_counter;if (scsi_status &PARITYERROR ) {dprintkl (KERN_INFO ,"data_in_phase0: (pid#%li) " "Parity Error\n" , srb->cmd->pid);
@@ -2319,7 +2322,6 @@DC395x_read32 (acb,TRM_S1040_DMA_CXCNT ), srb->total_xfer_length, d_left_counter);#if DC395x_LASTPIO - max_left =max (d_left_counter, srb->total_xfer_length);/* KG: Less than or equal to 4 bytes can not be transfered via DMA, it seems. */ if (d_left_counter && srb->total_xfer_length <= DC395x_LASTPIO) {
@@ -2351,6 +2353,8 @@ base =dc395x_kmap_atomic_sg ((struct scatterlist *)srb->cmd->request_buffer, srb->sg_count, &offset, &len); virt = base + offset; +printk (KERN_DEBUG "dc395x: Needed %u bytes in, mapped %u at %p\n" , + left_io, len, base); }else { virt = srb->cmd->request_buffer + srb->cmd->request_bufflen - left_io; len = left_io;
@@ -2395,6 +2399,7 @@if (srb->cmd->use_sg) {dc395x_kunmap_atomic_sg (base);local_irq_restore (flags); +printk (KERN_DEBUG "dc395x: Unmapped at %p\n" , base); } }
@@ -2573,6 +2578,8 @@ base =dc395x_kmap_atomic_sg ((struct scatterlist *)srb->cmd->request_buffer, srb->sg_count, &offset, &len); virt = base + offset; +printk (KERN_DEBUG "dc395x: Needed %u bytes out, mapped %u at %p\n" , + left_io, len, base); }else { virt = srb->cmd->request_buffer + srb->cmd->request_bufflen - left_io; len = left_io;
@@ -2591,6 +2598,7 @@if (srb->cmd->use_sg) {dc395x_kunmap_atomic_sg (base);local_irq_restore (flags); +printk (KERN_DEBUG "dc395x: Unmapped at %p\n" , base); } }
A message that is not in the archive (sent off-list or not yet received): [email protected]
I think, it is better to keep linux-scsi in CC, if you don't mind.
Quoted 7 lines · Fredrik Roubert
Feb 14 01:55:12 skalman kernel: dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 14 01:55:12 skalman kernel: ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 Feb 14 01:55:12 skalman kernel: dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 Feb 14 01:55:12 skalman kernel: dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s Feb 14 01:55:12 skalman kernel: dc395x: Connectors: Termination: Auto Low High Feb 14 01:55:12 skalman kernel: dc395x: Performing initial SCSI bus reset Feb 14 01:55:12 skalman kernel: scsi4 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08
Quoted 8 lines
Feb 14 01:55:13 skalman kernel: Vendor: HP Model: C2520A Rev: 3503 Feb 14 01:55:13 skalman kernel: Type: Processor ANSI SCSI revision: 02 Feb 14 01:55:13 skalman kernel: 4:0:2:0: Attached scsi generic sg2 type 3 Feb 14 01:56:11 skalman kernel: dc395x: reselect: w/o disconnected cmds <02-0> Feb 14 01:56:11 skalman kernel: dc395x: disconnect: Unexpected reselection <02-0> Feb 14 01:58:11 skalman kernel: dc395x: eh_abort: (pid#669) target=<02-0> cmd=ffff810009067cc0 Feb 14 01:58:11 skalman kernel: dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#669) target=<02-0> cmd=ffff810009067cc0 Feb 14 01:58:11 skalman kernel: dc395x: doing_srb_done: pids G:669(02-0)
Hm, is it from /var/log/messages? Looks like your KERN_DEBUG messages do not come there. Perhaps in /var/log/kern.log or similar? Please have a look if you find them. Alternatively, I think, dmesg should also output them.
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 18 lines · Guennadi Liakhovetski
Quoted 7 lines · Fredrik Roubert
Feb 14 01:55:12 skalman kernel: dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 Feb 14 01:55:12 skalman kernel: ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 Feb 14 01:55:12 skalman kernel: dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 Feb 14 01:55:12 skalman kernel: dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s Feb 14 01:55:12 skalman kernel: dc395x: Connectors: Termination: Auto Low High Feb 14 01:55:12 skalman kernel: dc395x: Performing initial SCSI bus reset Feb 14 01:55:12 skalman kernel: scsi4 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08Quoted 8 lines
Feb 14 01:55:13 skalman kernel: Vendor: HP Model: C2520A Rev: 3503 Feb 14 01:55:13 skalman kernel: Type: Processor ANSI SCSI revision: 02 Feb 14 01:55:13 skalman kernel: 4:0:2:0: Attached scsi generic sg2 type 3 Feb 14 01:56:11 skalman kernel: dc395x: reselect: w/o disconnected cmds <02-0> Feb 14 01:56:11 skalman kernel: dc395x: disconnect: Unexpected reselection <02-0> Feb 14 01:58:11 skalman kernel: dc395x: eh_abort: (pid#669) target=<02-0> cmd=ffff810009067cc0 Feb 14 01:58:11 skalman kernel: dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#669) target=<02-0> cmd=ffff810009067cc0 Feb 14 01:58:11 skalman kernel: dc395x: doing_srb_done: pids G:669(02-0)
Quoted 4 lines
Hm, is it from
/var/log/messages? Looks like yourKERN_DEBUGmessages do not come there. Perhaps in/var/log/kern.logor similar? Please have a look if you find them. Alternatively, I think, dmesg should also output them.
Fredrik, do you still have the detailed kernel-log from that test? It really might give a hint. If not - you could additionally turn SCSI-logging on and send that.
Here I also have an old AGFA scanner connected to a dc315(U) card in an SMP - works without a glitch. Well, it is 32bit though. But my scanner reports itself properly as a scanner, not as a processor. Is the problem 100% reproducible? What settings do you use for your scanning program? What program?
Interesting also - my scanner is only supposed to work with the supplied Adaptec ISA SCSI card - works with dc315 here...
Thanks
Guennadi
---
Guennadi Liakhovetski
Hi!
Now I applied your two patches to a fresh kernel source tree, added "Verbose SCSI error reporting" and "Show timing information on printks" to the configuration and rebooted with the newly built kernel and modules. Then I ran "xscanimage hp:/dev/sg2" (using xscanimage from the sane_1.0.14-1_amd64.deb Debian package), and scanned the same image a few times, so that the driver hung two times.
Scanning an image doesn't fail every time, but almost every time. So if one try succeeds, I just need to scan again to make the driver hang.
This is the output from dmesg, from boot until second failed scan:
[ 0.000000] Bootdata ok (command line is auto BOOT_IMAGE=Linux ro root=fd00) [ 0.000000] Linux version 2.6.15 (Version: skalman.5.dev) (roubert@skalman) (gcc version 4.0.3 20060128 (prerelease) (Debian 4.0.2-8)) #1 SMP Wed Feb 15 22:08:56 CET 2006 [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) [ 0.000000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) [ 0.000000] BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved) [ 0.000000] BIOS-e820: 0000000000100000 - 000000007ffb0000 (usable) [ 0.000000] BIOS-e820: 000000007ffb0000 - 000000007ffc0000 (ACPI data) [ 0.000000] BIOS-e820: 000000007ffc0000 - 000000007fff0000 (ACPI NVS) [ 0.000000] BIOS-e820: 000000007fff0000 - 0000000080000000 (reserved) [ 0.000000] BIOS-e820: 00000000ff7c0000 - 0000000100000000 (reserved) [ 0.000000] ACPI: RSDP (v000 ACPIAM ) @ 0x00000000000f9bb0 [ 0.000000] ACPI: RSDT (v001 A M I OEMRSDT 0x12000506 MSFT 0x00000097) @ 0x000000007ffb0000 [ 0.000000] ACPI: FADT (v002 A M I OEMFACP 0x12000506 MSFT 0x00000097) @ 0x000000007ffb0200 [ 0.000000] ACPI: MADT (v001 A M I OEMAPIC 0x12000506 MSFT 0x00000097) @ 0x000000007ffb0390 [ 0.000000] ACPI: OEMB (v001 A M I AMI_OEM 0x12000506 MSFT 0x00000097) @ 0x000000007ffc0040 [ 0.000000] ACPI: DSDT (v001 939M2 939M2150 0x00000150 INTL 0x02002026) @ 0x0000000000000000 [ 0.000000] No NUMA configuration found [ 0.000000] Faking a node at 0000000000000000-000000007ffb0000 [ 0.000000] Bootmem setup node 0 0000000000000000-000000007ffb0000 [ 0.000000] On node 0 totalpages: 513614 [ 0.000000] DMA zone: 612 pages, LIFO batch:0 [ 0.000000] DMA32 zone: 513002 pages, LIFO batch:31 [ 0.000000] Normal zone: 0 pages, LIFO batch:0 [ 0.000000] HighMem zone: 0 pages, LIFO batch:0 [ 0.000000] ACPI: PM-Timer IO Port: 0x808 [ 0.000000] ACPI: Local APIC address 0xfee00000 [ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) [ 0.000000] Processor #0 15:11 APIC version 16 [ 0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) [ 0.000000] Processor #1 15:11 APIC version 16 [ 0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23 [ 0.000000] ACPI: IOAPIC (id[0x03] address[0xfec10000] gsi_base[24]) [ 0.000000] IOAPIC[1]: apic_id 3, version 17, address 0xfec10000, GSI 24-39 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level) [ 0.000000] ACPI: IRQ0 used by override. [ 0.000000] ACPI: IRQ2 used by override. [ 0.000000] ACPI: IRQ9 used by override. [ 0.000000] Setting APIC routing to flat [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] Allocating PCI resources starting at 88000000 (gap: 80000000:7f7c0000) [ 0.000000] Built 1 zonelists [ 0.000000] Kernel command line: auto BOOT_IMAGE=Linux ro root=fd00 [ 0.000000] Initializing CPU#0 [ 0.000000] PID hash table entries: 4096 (order: 12, 131072 bytes) [ 0.000000] time.c: Using 3.579545 MHz PM timer. [ 0.000000] time.c: Detected 2000.109 MHz processor. [ 40.640391] Console: colour VGA+ 80x25 [ 40.644038] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes) [ 40.647571] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes) [ 40.679328] Memory: 2051108k/2096832k available (1587k kernel code, 45336k reserved, 821k data, 176k init) [ 40.756066] Calibrating delay using timer specific routine.. 4004.81 BogoMIPS (lpj=8009629) [ 40.756224] Mount-cache hash table entries: 256 [ 40.756389] CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) [ 40.756438] CPU: L2 Cache: 512K (64 bytes/line) [ 40.756485] CPU 0(2) -> Node 0 -> Core 0 [ 40.756537] mtrr: v2.0 (20020519) [ 40.804885] Using local APIC timer interrupts. [ 40.854835] Detected 12.500 MHz APIC timer. [ 40.854995] Booting processor 1/2 APIC 0x1 [ 40.864627] Initializing CPU#1 [ 40.943053] Calibrating delay using timer specific routine.. 4000.41 BogoMIPS (lpj=8000825) [ 40.943060] CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) [ 40.943062] CPU: L2 Cache: 512K (64 bytes/line) [ 40.943064] CPU 1(2) -> Node 0 -> Core 1 [ 40.943145] AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ stepping 01 [ 40.943154] CPU 1: Syncing TSC to CPU 0. [ 40.943915] CPU 1: synchronized TSC with CPU 0 (last diff -77 cycles, maxerr 565 cycles) [ 40.943921] Brought up 2 CPUs [ 40.944433] Disabling vsyscall due to use of PM timer [ 40.944480] time.c: Using PM based timekeeping. [ 40.944525] testing NMI watchdog ... OK. [ 40.984717] checking if image is initramfs... it is [ 41.859424] NET: Registered protocol family 16 [ 41.859502] ACPI: bus type pci registered [ 41.859552] PCI: Using configuration type 1 [ 41.860130] ACPI: Subsystem revision 20050902 [ 41.866093] ACPI: Interpreter enabled [ 41.866139] ACPI: Using IOAPIC for interrupt routing [ 41.866837] ACPI: PCI Root Bridge [PCI0] (0000:00) [ 41.866884] PCI: Probing PCI hardware (bus 00) [ 41.869317] PCI quirk: region 0800-083f claimed by ali7101 ACPI [ 41.869748] Boot video device is 0000:01:00.0 [ 41.870029] PCI: Transparent bridge - 0000:00:06.0 [ 41.870109] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] [ 41.884201] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.P0P4._PRT] [ 41.884441] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HTT_._PRT] [ 41.890416] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEB1._PRT] [ 41.890616] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEB2._PRT] [ 41.891283] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 11 12 14 *15), disabled. [ 41.892004] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 *10 11 12 14 15) [ 41.892682] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 *6 7 10 11 12 14 15) [ 41.893356] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *10 11 12 14 15) [ 41.894028] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 10 *11 12 14 15) [ 41.894707] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 *10 11 12 14 15) [ 41.895381] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 10 *11 12 14 15) [ 41.896056] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 10 11 12 14 15) *9 [ 41.896767] ACPI: PCI Interrupt Link [LNKP] (IRQs 3 4 5 6 7 *10 11 12 14 15) [ 41.897252] Linux Plug and Play Support v0.97 (c) Adam Belay [ 41.897313] pnp: PnP ACPI init [ 41.897379] pnp: ACPI device : hid PNP0200 [ 41.897418] pnp: ACPI device : hid PNP0B00 [ 41.897453] pnp: ACPI device : hid PNP0800 [ 41.897487] pnp: ACPI device : hid PNP0C04 [ 41.897735] pnp: ACPI device : hid PNP0510 [ 41.898489] pnp: ACPI device : hid PNP0401 [ 41.899377] pnp: ACPI device : hid PNPB02F [ 41.899785] pnp: ACPI device : hid PNPB006 [ 41.900034] pnp: ACPI device : hid PNP0C02 [ 41.900191] pnp: ACPI device : hid PNP0C02 [ 41.900347] pnp: ACPI device : hid PNP0303 [ 41.900426] pnp: ACPI device : hid PNP0F03 [ 41.900712] pnp: ACPI device : hid PNP0501 [ 41.901033] pnp: ACPI device : hid PNP0C02 [ 41.901211] pnp: ACPI device : hid PNP0C01 [ 41.901774] pnp: PnP ACPI: found 15 devices [ 41.901836] PCI: Using ACPI for IRQ routing [ 41.901883] PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report [ 41.902577] pnp: the driver 'system' has been registered [ 41.902606] pnp: match found with the PnP device '00:08' and the driver 'system' [ 41.902610] pnp: match found with the PnP device '00:09' and the driver 'system' [ 41.902615] pnp: match found with the PnP device '00:0d' and the driver 'system' [ 41.902620] pnp: 00:0d: ioport range 0x290-0x29f has been reserved [ 41.902670] pnp: match found with the PnP device '00:0e' and the driver 'system' [ 41.902854] PCI: Bridge: 0000:00:01.0 [ 41.902899] IO window: disabled. [ 41.902946] MEM window: f4700000-fe7fffff [ 41.902993] PREFETCH window: c7e00000-d7dfffff [ 41.903040] PCI: Bridge: 0000:00:02.0 [ 41.903084] IO window: disabled. [ 41.903130] MEM window: fe800000-fe8fffff [ 41.903176] PREFETCH window: disabled. [ 41.903223] PCI: Bridge: 0000:00:05.0 [ 41.903267] IO window: disabled. [ 41.903315] MEM window: fe900000-fe9fffff [ 41.903361] PREFETCH window: disabled. [ 41.903413] PCI: Bridge: 0000:00:06.0 [ 41.903459] IO window: c000-cfff [ 41.903506] MEM window: fea00000-feafffff [ 41.903554] PREFETCH window: d7e00000-d7efffff [ 41.903612] GSI 16 sharing vector 0xA9 and IRQ 16 [ 41.903660] ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 29 (level, low) -> IRQ 16 [ 41.903751] PCI: Setting latency timer of device 0000:00:01.0 to 64 [ 41.903759] GSI 17 sharing vector 0xB1 and IRQ 17 [ 41.903805] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 34 (level, low) -> IRQ 17 [ 41.903895] PCI: Setting latency timer of device 0000:00:02.0 to 64 [ 41.903903] PCI: Setting latency timer of device 0000:00:05.0 to 64 [ 41.903910] PCI: Setting latency timer of device 0000:00:06.0 to 64 [ 41.904180] IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $ [ 41.904647] io scheduler noop registered [ 41.904728] io scheduler anticipatory registered [ 41.953277] ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 29 (level, low) -> IRQ 16 [ 41.953373] PCI: Setting latency timer of device 0000:00:01.0 to 64 [ 41.953397] assign_interrupt_mode Found MSI capability [ 41.953444] Allocate Port Service[pcie00] [ 41.953482] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 34 (level, low) -> IRQ 17 [ 41.953573] PCI: Setting latency timer of device 0000:00:02.0 to 64 [ 41.953596] assign_interrupt_mode Found MSI capability [ 41.953643] Allocate Port Service[pcie00] [ 41.954984] pnp: the driver 'i8042 kbd' has been registered [ 41.955012] pnp: match found with the PnP device '00:0a' and the driver 'i8042 kbd' [ 41.955021] pnp: the driver 'i8042 aux' has been registered [ 41.955047] pnp: match found with the PnP device '00:0b' and the driver 'i8042 aux' [ 41.955057] PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12 [ 41.956645] serio: i8042 AUX port at 0x60,0x64 irq 12 [ 41.956789] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 41.957169] RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize [ 41.957272] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 [ 41.957322] ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx [ 41.957425] ALI15X3: IDE controller at PCI slot 0000:00:12.0 [ 41.957481] GSI 18 sharing vector 0xB9 and IRQ 18 [ 41.957528] ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 19 (level, low) -> IRQ 18 [ 41.957626] ALI15X3: chipset revision 199 [ 41.957671] ALI15X3: not 100% native mode: will probe irqs later [ 41.957730] ide0: BM-DMA at 0xff00-0xff07, BIOS settings: hda:DMA, hdb:pio [ 41.957863] ide1: BM-DMA at 0xff08-0xff0f, BIOS settings: hdc:pio, hdd:pio [ 41.957988] Probing IDE interface ide0... [ 42.695555] hda: BENQ DVD DD DW1640, ATAPI CD/DVD-ROM drive [ 43.366504] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 [ 43.366619] Probing IDE interface ide1... [ 43.937041] mice: PS/2 mouse device common for all mice [ 43.937382] NET: Registered protocol family 2 [ 43.962495] input: AT Translated Set 2 keyboard as /class/input/input0 [ 43.972964] IP route cache hash table entries: 65536 (order: 7, 524288 bytes) [ 43.973562] TCP established hash table entries: 262144 (order: 10, 4194304 bytes) [ 43.978388] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes) [ 43.979619] TCP: Hash tables configured (established 262144 bind 65536) [ 43.979671] TCP reno registered [ 43.979779] TCP bic registered [ 43.979842] NET: Registered protocol family 1 [ 43.980244] Freeing unused kernel memory: 176k freed [ 44.107514] usbcore: registered new driver usbfs [ 44.107585] usbcore: registered new driver hub [ 44.109254] ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) [ 44.109291] GSI 19 sharing vector 0xC1 and IRQ 19 [ 44.109344] ACPI: PCI Interrupt 0000:00:13.0[A] -> GSI 20 (level, low) -> IRQ 19 [ 44.109755] ohci_hcd 0000:00:13.0: OHCI Host Controller [ 44.109919] ohci_hcd 0000:00:13.0: new USB bus registered, assigned bus number 1 [ 44.109990] ohci_hcd 0000:00:13.0: irq 19, io mem 0xfebfd000 [ 44.145627] SCSI subsystem initialized [ 44.149684] libata version 1.20 loaded. [ 44.150943] sata_uli 0000:00:12.1: version 0.5 [ 44.151008] ACPI: PCI Interrupt 0000:00:12.1[A] -> GSI 19 (level, low) -> IRQ 18 [ 44.151158] ata1: SATA max UDMA/133 cmd 0xEC00 ctl 0xE082 bmdma 0xD880 irq 18 [ 44.170724] hub 1-0:1.0: USB hub found [ 44.170786] hub 1-0:1.0: 3 ports detected [ 44.205168] ata2: SATA max UDMA/133 cmd 0xE000 ctl 0xDC02 bmdma 0xD888 irq 18 [ 44.276441] GSI 20 sharing vector 0xC9 and IRQ 20 [ 44.276495] ACPI: PCI Interrupt 0000:00:13.1[B] -> GSI 21 (level, low) -> IRQ 20 [ 44.276866] ohci_hcd 0000:00:13.1: OHCI Host Controller [ 44.276977] ohci_hcd 0000:00:13.1: new USB bus registered, assigned bus number 2 [ 44.277049] ohci_hcd 0000:00:13.1: irq 20, io mem 0xfebfc000 [ 44.334350] hub 2-0:1.0: USB hub found [ 44.334411] hub 2-0:1.0: 3 ports detected [ 44.420250] ata1: dev 0 cfg 49:2f00 82:746b 83:7f01 84:4023 85:7468 86:3c01 87:4023 88:40ff [ 44.420256] ata1: dev 0 ATA-7, max UDMA7, 488397168 sectors: LBA48 [ 44.420405] ata1: dev 0 configured for UDMA/133 [ 44.420458] scsi0 : sata_uli [ 44.440679] GSI 21 sharing vector 0xD1 and IRQ 21 [ 44.440732] ACPI: PCI Interrupt 0000:00:13.2[C] -> GSI 22 (level, low) -> IRQ 21 [ 44.440967] ohci_hcd 0000:00:13.2: OHCI Host Controller [ 44.441081] ohci_hcd 0000:00:13.2: new USB bus registered, assigned bus number 3 [ 44.441152] ohci_hcd 0000:00:13.2: irq 21, io mem 0xfebfb000 [ 44.501994] hub 3-0:1.0: USB hub found [ 44.502051] hub 3-0:1.0: 3 ports detected [ 44.607891] GSI 22 sharing vector 0xD9 and IRQ 22 [ 44.607945] ACPI: PCI Interrupt 0000:00:13.3[D] -> GSI 23 (level, low) -> IRQ 22 [ 44.608224] ehci_hcd 0000:00:13.3: EHCI Host Controller [ 44.608972] ehci_hcd 0000:00:13.3: debug port 1 [ 44.636773] ehci_hcd 0000:00:13.3: new USB bus registered, assigned bus number 4 [ 44.636859] ehci_hcd 0000:00:13.3: irq 22, io mem 0xfebfe800 [ 44.636914] ehci_hcd 0000:00:13.3: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 [ 44.637050] hub 4-0:1.0: USB hub found [ 44.637101] hub 4-0:1.0: 8 ports detected [ 44.640916] ata2: dev 0 cfg 49:2f00 82:746b 83:7f01 84:4023 85:7468 86:3c01 87:4023 88:40ff [ 44.640922] ata2: dev 0 ATA-7, max UDMA7, 488397168 sectors: LBA48 [ 44.641074] ata2: dev 0 configured for UDMA/133 [ 44.641121] scsi1 : sata_uli [ 44.641298] Vendor: ATA Model: SAMSUNG SP2504C Rev: VT10 [ 44.642261] Type: Direct-Access ANSI SCSI revision: 05 [ 44.642449] Vendor: ATA Model: SAMSUNG SP2504C Rev: VT10 [ 44.643412] Type: Direct-Access ANSI SCSI revision: 05 [ 44.744928] ACPI: PCI Interrupt 0000:04:07.0[A] -> GSI 22 (level, low) -> IRQ 21 [ 44.745021] 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html [ 44.745083] 0000:04:07.0: 3Com PCI 3c900 Boomerang 10baseT at 000000000001cc00. Vers LK1.1.19 [ 44.759178] dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [ 44.759260] ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 [ 45.001435] dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 [ 45.001495] dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s [ 45.001545] dc395x: Connectors: Termination: Auto Low High [ 45.001763] dc395x: Performing initial SCSI bus reset [ 45.002336] scsi2 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [ 46.505989] Vendor: HP Model: C2520A Rev: 3503 [ 46.506957] Type: Processor ANSI SCSI revision: 02 [ 49.521068] SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) [ 49.521134] SCSI device sda: drive cache: write back [ 49.521310] SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) [ 49.521368] SCSI device sda: drive cache: write back [ 49.521418] sda: sda1 sda2 sda3 [ 49.532840] sd 0:0:0:0: Attached scsi disk sda [ 49.532954] SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB) [ 49.533015] SCSI device sdb: drive cache: write back [ 49.538723] SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB) [ 49.538788] SCSI device sdb: drive cache: write back [ 49.538836] sdb: sdb1 sdb2 sdb3 [ 49.546372] sd 1:0:0:0: Attached scsi disk sdb [ 50.245898] hda: ATAPI 48X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33) [ 50.246211] Uniform CD-ROM driver Revision: 3.20 [ 50.285481] md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27 [ 50.285536] md: bitmap version 4.39 [ 50.288382] md: raid1 personality registered as nr 3 [ 50.295375] md: raid0 personality registered as nr 2 [ 50.371093] md: md0 stopped. [ 50.372014] md: bind<sdb1> [ 50.372233] md: bind<sda1> [ 50.372363] raid1: raid set md0 active with 2 out of 2 mirrors [ 50.384641] md: md1 stopped. [ 50.385487] md: bind<sdb2> [ 50.385702] md: bind<sda2> [ 50.385761] md1: setting max_sectors to 128, segment boundary to 32767 [ 50.385814] raid0: looking at sda2 [ 50.385858] raid0: comparing sda2(8787456) with sda2(8787456) [ 50.385936] raid0: END [ 50.385979] raid0: ==> UNIQUE [ 50.386023] raid0: 1 zones [ 50.386075] raid0: looking at sdb2 [ 50.386120] raid0: comparing sdb2(8787456) with sda2(8787456) [ 50.386198] raid0: EQUAL [ 50.386241] raid0: FINAL 1 zones [ 50.386286] raid0: done. [ 50.386330] raid0 : md_size is 17574912 blocks. [ 50.386376] raid0 : conf->hash_spacing is 17574912 blocks. [ 50.386423] raid0 : nb_zone is 1. [ 50.386467] raid0 : Allocating 8 bytes for hash. [ 50.398699] device-mapper: 4.4.0-ioctl (2005-01-12) initialised: [email protected] [ 50.415941] cdrom: open failed. [ 50.497161] ReiserFS: dm-0: found reiserfs format "3.6" with standard journal [ 51.088548] ReiserFS: dm-0: using ordered data mode [ 51.094115] ReiserFS: dm-0: journal params: device dm-0, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 [ 51.096598] ReiserFS: dm-0: checking transaction log (dm-0) [ 51.138663] ReiserFS: dm-0: Using r5 hash to sort names [ 52.678502] uli526x: ULi M5261/M5263 net driver, version 0.9.3 (2005-7-29) [ 52.678630] GSI 23 sharing vector 0xE1 and IRQ 23 [ 52.678679] ACPI: PCI Interrupt 0000:00:11.0[A] -> GSI 17 (level, low) -> IRQ 23 [ 52.700514] eth1: ULi M5263 at pci0000:00:11.0, 00:13:8f:70:07:df, irq 23. [ 52.737240] pnp: the driver 'parport_pc' has been registered [ 52.737260] pnp: match found with the PnP device '00:05' and the driver 'parport_pc' [ 52.737264] parport: PnPBIOS parport detected. [ 52.737425] parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE,EPP] [ 52.816544] input: PC Speaker as /class/input/input1 [ 52.837764] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 52.837835] sd 1:0:0:0: Attached scsi generic sg1 type 0 [ 52.837896] 2:0:2:0: Attached scsi generic sg2 type 3 [ 52.852344] Real Time Clock Driver v1.12 [ 52.884591] ali1563: SMBus control = 0403 [ 52.884690] ali1563_probe: Returning 0 [ 52.892825] Linux video capture interface: v1.00 [ 52.958455] logips2pp: Detected unknown logitech mouse model 1 [ 53.047483] input: PS/2 Logitech Mouse as /class/input/input2 [ 53.098652] Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled [ 53.114270] GSI 24 sharing vector 0xE9 and IRQ 24 [ 53.114326] ACPI: PCI Interrupt 0000:00:08.0[A] -> GSI 18 (level, low) -> IRQ 24 [ 53.158090] bttv: driver version 0.9.16 loaded [ 53.158145] bttv: using 8 buffers with 2080k (520 pages) each for capture [ 53.354981] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 53.407182] pnp: the driver 'serial' has been registered [ 53.407249] pnp: match found with the PnP device '00:0c' and the driver 'serial' [ 53.407407] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 54.134472] AC'97 1 does not respond - RESET [ 54.135068] AC'97 1 access is not valid [0xffffffff], removing mixer. [ 54.135118] Unable to initialize codec #1 [ 54.194358] intel8x0_measure_ac97_clock: measured 58726 usecs [ 54.194406] intel8x0: clocking to 48000 [ 54.195061] bttv: Bt8xx card found (0). [ 54.195125] ACPI: PCI Interrupt 0000:04:06.0[A] -> GSI 21 (level, low) -> IRQ 20 [ 54.195224] bttv0: Bt848 (rev 18) at 0000:04:06.0, irq: 20, latency: 32, mmio: 0xd7eff000 [ 54.195328] bttv0: using: *** UNKNOWN/GENERIC *** [card=0,autodetected] [ 54.195412] bttv0: gpio: en=00000000, out=00000000 in=00fffffb [init] [ 54.283702] bttv0: detected by eeprom: Hauppauge (bt848) [card=2] [ 54.370868] tveeprom 1-0050: Hauppauge model 60114, rev CV , serial# 541274 [ 54.370919] tveeprom 1-0050: tuner model is Temic 4002FH5 (idx 14, type 0) [ 54.370968] tveeprom 1-0050: TV standards PAL(B/G) (eeprom 0x04) [ 54.371017] tveeprom 1-0050: audio processor is MSP3410D (idx 5) [ 54.371065] tveeprom 1-0050: has no radio [ 54.371110] bttv0: using tuner=0 [ 54.371156] bttv0: i2c: checking for MSP34xx @ 0x80... found [ 54.421132] msp3400 1-0040: chip=MSP3410D-B4 +nicam +simple mode=simple [ 54.421319] msp3400 1-0040: msp3410 daemon started [ 54.441181] bttv0: i2c: checking for TDA9875 @ 0xb0... not found [ 54.443399] bttv0: i2c: checking for TDA7432 @ 0x8a... not found [ 54.476039] bttv0: i2c: checking for TDA9887 @ 0x86... not found [ 54.509062] tuner 1-0061: chip found @ 0xc2 (bt848 #0 [sw]) [ 54.509145] tuner 1-0061: type set to 0 (Temic PAL (4002 FH5)) [ 54.540471] bttv0: registered device video0 [ 54.540534] bttv0: registered device vbi0 [ 55.353395] Adding 1911724k swap on /dev/sda3. Priority:-1 extents:1 across:1911724k [ 55.372582] Adding 1911724k swap on /dev/sdb3. Priority:-2 extents:1 across:1911724k [ 86.145612] ReiserFS: dm-1: found reiserfs format "3.6" with standard journal [ 93.815153] ReiserFS: dm-1: using ordered data mode [ 93.827359] ReiserFS: dm-1: journal params: device dm-1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 [ 93.829927] ReiserFS: dm-1: checking transaction log (dm-1) [ 93.924830] ReiserFS: dm-1: Using r5 hash to sort names [ 94.007660] ReiserFS: md1: found reiserfs format "3.6" with standard journal [ 94.929992] ReiserFS: md1: using ordered data mode [ 94.953085] ReiserFS: md1: journal params: device md1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 [ 94.955592] ReiserFS: md1: checking transaction log (md1) [ 94.966630] ReiserFS: md1: Using r5 hash to sort names [ 96.139055] ACPI: PCI Interrupt 0000:04:07.0[A] -> GSI 22 (level, low) -> IRQ 21 [ 97.173742] NET: Registered protocol family 17 [ 99.159228] ACPI: Power Button (FF) [PWRF] [ 99.159324] ACPI: Power Button (CM) [PWRB] [ 100.008805] lp0: using parport0 (interrupt-driven). [ 105.609877] nvidia: module license 'NVIDIA' taints kernel. [ 105.614825] GSI 25 sharing vector 0x32 and IRQ 25 [ 105.614832] ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 25 (level, low) -> IRQ 25 [ 105.615205] PCI: Setting latency timer of device 0000:01:00.0 to 64 [ 105.615676] NVRM: loading NVIDIA Linux x86_64 NVIDIA Kernel Module 1.0-8178 Wed Dec 14 16:58:07 PST 2005 [ 344.852017] dc395x: reselect: w/o disconnected cmds <02-0> [ 344.852038] dc395x: disconnect: Unexpected reselection <02-0> [ 464.630090] dc395x: eh_abort: (pid#2002) target=<02-0> cmd=ffff8100743c04c0 [ 464.630096] dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#2002) target=<02-0> cmd=ffff8100743c04c0 [ 464.630623] dc395x: doing_srb_done: pids G:2002(02-0) [ 528.066303] dc395x: reselect: w/o disconnected cmds <02-0> [ 528.066324] dc395x: disconnect: Unexpected reselection <02-0> [ 647.842343] dc395x: eh_abort: (pid#2130) target=<02-0> cmd=ffff81007cc1b5c0 [ 647.842350] dc395x: eh_abort: Command in progress<6>dc395x: eh_abort: (pid#2131) target=<02-0> cmd=ffff81007cc1b780 [ 647.842356] dc395x: eh_abort: Command was waiting [ 657.823181] dc395x: eh_abort: (pid#2131) target=<02-0> cmd=ffff81007cc1b780 [ 657.823188] dc395x: eh_abort: Command was waiting [ 657.823196] dc395x: eh_bus_reset: (pid#2130) target=<02-0> cmd=ffff81007cc1b5c0 [ 657.823717] dc395x: doing_srb_done: pids G:2130(02-0)
Do you need any other information?
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for the dump.
Quoted 1 line · Fredrik Roubert
This is the output from dmesg, from boot until second failed scan:
...
Quoted 6 lines
[ 344.852017] dc395x: reselect: w/o disconnected cmds <02-0> [ 344.852038] dc395x: disconnect: Unexpected reselection <02-0> [ 464.630090] dc395x: eh_abort: (pid#2002) target=<02-0> cmd=ffff8100743c04c0 [ 464.630096] dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#2002) target=<02-0> cmd=ffff8100743c04c0 [ 464.630623] dc395x: doing_srb_done: pids G:2002(02-0) [ 528.066303] dc395x: reselect: w/o disconnected cmds <02-0>
Quoted 8 lines
[ 528.066324] dc395x: disconnect: Unexpected reselection <02-0> [ 647.842343] dc395x: eh_abort: (pid#2130) target=<02-0> cmd=ffff81007cc1b5c0 [ 647.842350] dc395x: eh_abort: Command in progress<6>dc395x: eh_abort: (pid#2131) target=<02-0> cmd=ffff81007cc1b780 [ 647.842356] dc395x: eh_abort: Command was waiting [ 657.823181] dc395x: eh_abort: (pid#2131) target=<02-0> cmd=ffff81007cc1b780 [ 657.823188] dc395x: eh_abort: Command was waiting [ 657.823196] dc395x: eh_bus_reset: (pid#2130) target=<02-0> cmd=ffff81007cc1b5c0 [ 657.823717] dc395x: doing_srb_done: pids G:2130(02-0)
Ok, I will assume that this dump includes the KERN_DEBUG messages too now. Still, could you, please, just verify that you don't have anything else from dc395x in your /var/log/kern.log (if you have one)? If there's nothing new there you don't have to send it.
This means, PIO is not entered now any more, although the same "reselect without disconnect" events happen. The only reason for this I can think about is my addition of dma_mask to drivers/scsi/dc395x.c:
@@ -4834,6 +4904,9 @@
irq = dev->irq;
dprintkdbg(DBG_0, "IO_PORT=0x%04lx, IRQ=0x%x\n", io_port_base, dev->irq);
+ if ((ret = pci_set_dma_mask(dev, DMA_32BIT_MASK)))
+ goto fail;
+
/* allocate scsi host information (includes out adapter) */ scsi_host = scsi_host_alloc(&dc395x_driver_template,
sizeof(struct AdapterCtlBlk));
Could you, please, remove / comment out these 2 lines and try again? If then PIO comes back, I would first try to verify / debug / fix it, and then, as it sems not to be the main problem, we'll study the 2nd problem.
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 1 line · Guennadi Liakhovetski
Ok, I will assume that this dump includes the
KERN_DEBUGmessages too now.
So would I, or else the "reselect: w/o disconnected cmds" wouldn't be there.
Quoted 2 lines
Still, could you, please, just verify that you don't have anything else from dc395x in your
/var/log/kern.log(if you have one)?
There is nothing else there, or in /var/log/debug.
Quoted 1 line
Could you, please, remove / comment out these 2 lines and try again?
OK, this is the log from loading the new module until the second failed scan:
[49712.862170] dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [49712.862190] ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 [49713.104766] dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 [49713.104772] dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s [49713.104778] dc395x: Connectors: Termination: Auto Low High [49713.080481] dc395x: Performing initial SCSI bus reset [49713.081006] scsi3 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [49714.608526] Vendor: HP Model: C2520A Rev: 3503 [49714.608566] Type: Processor ANSI SCSI revision: 02 [49714.608654] 3:0:2:0: Attached scsi generic sg2 type 3 [49787.196864] dc395x: reselect: w/o disconnected cmds <02-0> [49787.196886] dc395x: disconnect: Unexpected reselection <02-0> [49906.975135] dc395x: eh_abort: (pid#899) target=<02-0> cmd=ffff81006cbd6d40 [49906.975148] dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#899) target=<02-0> cmd=ffff81006cbd6d40 [49906.975675] dc395x: doing_srb_done: pids G:899(02-0) [50083.137467] dc395x: reselect: w/o disconnected cmds <02-0> [50083.137487] dc395x: disconnect: Unexpected reselection <02-0> [50202.914281] dc395x: eh_abort: (pid#3210) target=<02-0> cmd=ffff81006cbd6640 [50202.914288] dc395x: eh_abort: Command in progress<6>dc395x: eh_bus_reset: (pid#3210) target=<02-0> cmd=ffff81006cbd6640 [50202.914816] dc395x: doing_srb_done: pids G:3210(02-0)
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Fredrik
Thanks for your help so far, and, please, don't give up - I know it's, probably, much easier for you to just through away the damn thing (dc315) and get something modern, but - what about the fun?:-)
Quoted 1 line · Fredrik Roubert
On Wed 15 Feb 23:33 CET 2006, Guennadi Liakhovetski wrote:
...
Quoted 4 lines
Quoted 1 line
Could you, please, remove / comment out these 2 lines and try again?
OK, this is the log from loading the new module until the second failed scan:
Looks like all those lengths / counters are somewhat less consistent than what I'd hoped for. Please, try the patch below on the top of your current version - it MUST trigger. With the vanilla 2.6.15 the first "reselect w/o disconnect" message, after each boot / insmod dc395x, was _always_ accompanied by requests to contact linux-scsi, right?
Thanks
Guennadi
---
Guennadi Liakhovetski
drivers/scsi/dc395x.c +14 -8
@@ -2269,7 +2269,7 @@* seem to be a bad idea, actually. */ if (!(srb->state &SRB_XFERPAD )) { -unsigned int d_left_counter; +unsigned int d_left_counter, sc, fc;if (scsi_status &PARITYERROR ) {dprintkl (KERN_INFO ,"data_in_phase0: (pid#%li) " "Parity Error\n" , srb->cmd->pid);
@@ -2306,18 +2306,18 @@ DC395x_read8(acb, TRM_S1040_DMA_FIFOSTAT)); }/* Now: Check remainig data: The SCSI counters should tell us ... */ - d_left_counter =DC395x_read32 (acb,TRM_S1040_SCSI_COUNTER ) - + ((DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ) &0x1f ) - << ((srb->dcb->sync_period &WIDE_SYNC ) ?1 : -0 )); + sc =DC395x_read32 (acb,TRM_S1040_SCSI_COUNTER ); + fc =DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ); + d_left_counter = sc + ((fc &0x1f ) << + ((srb->dcb->sync_period &WIDE_SYNC ) ?1 :0 ));dprintkdbg (DBG_KG ,"data_in_phase0: " "SCSI{fifocnt=0x%02x%s ctr=0x%08x} " "DMA{fifocnt=0x%02x fifostat=0x%02x ctr=0x%08x} " "Remain{totxfer=%i scsi_fifo+ctr=%i}\n" , -DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ), + fc, (srb->dcb->sync_period &WIDE_SYNC ) ?"words" :"bytes" ,DC395x_read32 (acb,TRM_S1040_SCSI_COUNTER ), -DC395x_read8 (acb,TRM_S1040_DMA_FIFOCNT ), + fc,DC395x_read8 (acb,TRM_S1040_DMA_FIFOSTAT ),DC395x_read32 (acb,TRM_S1040_DMA_CXCNT ), srb->total_xfer_length, d_left_counter);
@@ -2331,7 +2331,7 @@/*sg_update_list (srb, d_left_counter); */ dprintkdbg (DBG_PIO ,"data_in_phase0: PIO (%i %s) " "for remaining %i bytes:" , -DC395x_read8 (acb,TRM_S1040_SCSI_FIFOCNT ) &0x1f , + fc &0x1f , (srb->dcb->sync_period &WIDE_SYNC ) ?"words" :"bytes" , srb->total_xfer_length);
@@ -2339,6 +2339,9 @@DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,CFG2_WIDEFIFO ); +printk (KERN_INFO "%s[%d]: %u, %u, %u, %u, %x, %d\n" , __FILE__, __LINE__, + left_io, d_left_counter, sc, fc, srb->dcb->sync_period &WIDE_SYNC , srb->cmd->use_sg); +while (left_io) {unsigned char *virt, *base =NULL ;unsigned long flags =0 ;
@@ -2566,6 +2569,9 @@DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,CFG2_WIDEFIFO ); +printk (KERN_INFO "%s[%d]: %u, %x, %d\n" , __FILE__, __LINE__, + left_io, srb->dcb->sync_period &WIDE_SYNC , srb->cmd->use_sg); +while (left_io) {unsigned char *virt, *base =NULL ;unsigned long flags =0 ;
Quoted 2 lines · Guennadi Liakhovetski
I know it's, probably, much easier for you to just through away the damn thing (dc315) and get something modern, but - what about the fun?:-)
Oh, just changing hardware to avoid having to solve a software problem isn't really my style ... ;-)
Quoted 2 lines
Please, try the patch below on the top of your current version - it MUST trigger.
Here is the dmesg output from that test run:
[262653.162293] dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262653.162314] ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 [262653.404392] dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 [262653.404398] dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s [262653.404403] dc395x: Connectors: Termination: Auto Low High [262653.404466] dc395x: Performing initial SCSI bus reset [262653.404985] scsi4 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262655.033158] Vendor: HP Model: C2520A Rev: 3503 [262655.033171] Type: Processor ANSI SCSI revision: 02 [262655.034138] 4:0:2:0: Attached scsi generic sg2 type 3 [262675.061545] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262676.044080] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.073044] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.102258] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.131515] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.353526] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.402529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.418709] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.434949] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.451199] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.467416] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.483808] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.500094] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.520097] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.536219] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.599101] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.615137] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.631210] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.647318] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.663580] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.683896] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.747918] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.774339] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.810508] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.813529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.838307] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.864369] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.936742] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.952765] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.968897] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.985074] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262677.001171] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.504018] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.530334] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.566400] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.569421] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.594330] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.620404] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262687.173095] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262687.198697] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262713.038424] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262713.064027] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262725.911499] dc395x: reselect: w/o disconnected cmds <02-0> [262725.911521] dc395x: disconnect: Unexpected reselection <02-0> [262845.687267] dc395x: eh_abort: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262845.687274] dc395x: eh_abort: Command in progress<6>dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262845.687280] dc395x: eh_abort: Command was waiting [262855.668103] dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262855.668111] dc395x: eh_abort: Command was waiting [262855.668119] dc395x: eh_bus_reset: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262855.668640] dc395x: doing_srb_done: pids G:1007(02-0) [262865.663561] drivers/scsi/dc395x.c[2572]: 2, 0, 0
Quoted 3 lines
With the vanilla 2.6.15 the first "reselect w/o disconnect" message, after each boot / insmod dc395x, was _always_ accompanied by requests to contact linux-scsi, right?
Yes, it was. (But I didn't do it many times, so it _could_ have been a coincidence that I got the message each time I tried.)
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 56 lines · Fredrik Roubert
Here is the dmesg output from that test run:
[262653.162293] dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262653.162314] ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 [262653.404392] dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 [262653.404398] dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s [262653.404403] dc395x: Connectors: Termination: Auto Low High [262653.404466] dc395x: Performing initial SCSI bus reset [262653.404985] scsi4 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262655.033158] Vendor: HP Model: C2520A Rev: 3503 [262655.033171] Type: Processor ANSI SCSI revision: 02 [262655.034138] 4:0:2:0: Attached scsi generic sg2 type 3 [262675.061545] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262676.044080] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.073044] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.102258] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.131515] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.353526] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.402529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.418709] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.434949] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.451199] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.467416] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.483808] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.500094] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.520097] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.536219] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.599101] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.615137] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.631210] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.647318] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.663580] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.683896] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.747918] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.774339] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.810508] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.813529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.838307] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.864369] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.936742] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.952765] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.968897] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.985074] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262677.001171] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.504018] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.530334] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.566400] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.569421] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.594330] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.620404] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262687.173095] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262687.198697] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262713.038424] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262713.064027] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262725.911499] dc395x: reselect: w/o disconnected cmds <02-0> [262725.911521] dc395x: disconnect: Unexpected reselection <02-0>
Quoted 8 lines
[262845.687267] dc395x: eh_abort: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262845.687274] dc395x: eh_abort: Command in progress<6>dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262845.687280] dc395x: eh_abort: Command was waiting [262855.668103] dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262855.668111] dc395x: eh_abort: Command was waiting [262855.668119] dc395x: eh_bus_reset: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262855.668640] dc395x: doing_srb_done: pids G:1007(02-0) [262865.663561] drivers/scsi/dc395x.c[2572]: 2, 0, 0
Ok, this tells us, that on your system PIO is triggered only on the "write" path and when scattergather are not used. This means that, 1) we won't be able to test the most interesting part of the proposed PIO fix - scattergather remapping, and 2) your problem might be in hardware rather than in software. For the latter I have to ask you if your cables are ok? Termination? Maybe replace the cable? Do you have any other SCSI card where you also could test your scanner? If you don't think it's a hardware problem, we might try to look more exactly how this error (unexpected reselect) occurs, how it is related to failing DMA (that's when PIO is invoked), and verify if the PIO code is correct / fix it.
After you confirm that your cables and termination are fine, I would ask you to do a few more tests to look more exactly at what's happening, and to verify at least the non-sg path of my patch. So, would you agree to help me further with the tests or would you rather or would you prefer to stop now?
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 4 lines · Guennadi Liakhovetski
2) your problem might be in hardware rather than in software. For the latter I have to ask you if your cables are ok? Termination? Maybe replace the cable? Do you have any other SCSI card where you also could test your scanner?
The scanner works OK when connected to my old AHA1542 controller in my old computer. The two SCSI controllers have different connectors, so the cable I'm using now is also new, and untested. It could, no doubt, be a problem with either the cable or the SCSI controller hardware.
Quoted 1 line
After you confirm that your cables and termination are fine,
It's fine, as far as I know. It's a brand new cable and I just plugged it in replacing the old cable. Do you have any suggestions as to how I could test cable and termination?
Quoted 4 lines
I would ask you to do a few more tests to look more exactly at what's happening, and to verify at least the non-sg path of my patch. So, would you agree to help me further with the tests or would you rather or would you prefer to stop now?
Of course I'd like to help out. (How else would Linux continue to improve?) Just tell me what you want me to do.
Cheers // Fredrik Roubert
Signature · 6 lines
Sörbyplan 5 | +46 8 7609169 / +46 708 776974 SE-163 71 Spånga | http://www.df.lth.se/~roubert/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Fredrik Roubert
Quoted 4 lines · Guennadi Liakhovetski
2) your problem might be in hardware rather than in software. For the latter I have to ask you if your cables are ok? Termination? Maybe replace the cable? Do you have any other SCSI card where you also could test your scanner?
The scanner works OK when connected to my old AHA1542 controller in my old computer. The two SCSI controllers have different connectors, so the cable I'm using now is also new, and untested. It could, no doubt, be a problem with either the cable or the SCSI controller hardware.
Ok, if you could connect the scanner to the same PC but to a different SCSI card, that would with a good probability confirm that the scanner is ok. Still, it is at least theoretically possible, that a bug in the scanner's firmware is triggered by some, e.g., timing pattern specific to the dc315u, though within specs. Just to say I don't see a good way to exclude the scanner as the cause of the problem with 100% probability.
Quoted 5 lines
Quoted 1 line
After you confirm that your cables and termination are fine,
It's fine, as far as I know. It's a brand new cable and I just plugged it in replacing the old cable. Do you have any suggestions as to how I could test cable and termination?
Not really. You have the same problem with the old and the new cable? Then, most probably, it's not the cause of the problem. Termination is switched on on the scanner or is it a passive terminator on the cable? E.g., on my scanner there's no active termination (I think).
Quoted 7 lines
Quoted 4 lines
I would ask you to do a few more tests to look more exactly at what's happening, and to verify at least the non-sg path of my patch. So, would you agree to help me further with the tests or would you rather or would you prefer to stop now?
Of course I'd like to help out. (How else would Linux continue to improve?) Just tell me what you want me to do.
Great! While I am preparing a new debugging patch, could you, perhaps, test your scanner + dc315u + pc with some live Linux CDs? Some 32-bit i386 like Knoppix, also interesting with 2.6 and 2.4 kernel?
Thanks
Guennadi
---
Guennadi Liakhovetski
Quoted 3 lines · Guennadi Liakhovetski
Great! While I am preparing a new debugging patch, could you, perhaps, test your scanner + dc315u + pc with some live Linux CDs? Some 32-bit i386 like Knoppix, also interesting with 2.6 and 2.4 kernel?
While at it, at the bottom of this email there's a new debugging patch. Please, try and send the output back as usual.
One more question to your previous report:
Quoted 12 lines · Fredrik Roubert
Here is the dmesg output from that test run:
[262653.162293] dc395x: Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262653.162314] ACPI: PCI Interrupt 0000:04:05.0[A] -> GSI 20 (level, low) -> IRQ 19 [262653.404392] dc395x: Used settings: AdapterID=07, Speed=0(20.0MHz), dev_mode=0x57 [262653.404398] dc395x: AdaptMode=0x0f, Tags=4(16), DelayReset=1s [262653.404403] dc395x: Connectors: Termination: Auto Low High [262653.404466] dc395x: Performing initial SCSI bus reset [262653.404985] scsi4 : Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040 v2.05, 2004/03/08 [262655.033158] Vendor: HP Model: C2520A Rev: 3503 [262655.033171] Type: Processor ANSI SCSI revision: 02 [262655.034138] 4:0:2:0: Attached scsi generic sg2 type 3
In this 20 seconds, I presume, you started the scan, right?
Quoted 24 lines
[262675.061545] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262676.044080] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.073044] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.102258] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.131515] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.353526] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.402529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.418709] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.434949] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.451199] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.467416] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.483808] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.500094] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.520097] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.536219] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.599101] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.615137] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.631210] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.647318] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.663580] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.683896] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.747918] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.774339] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.810508] drivers/scsi/dc395x.c[2572]: 4, 0, 0
Quoted 8 lines
[262676.813529] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.838307] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.864369] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.936742] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.952765] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.968897] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262676.985074] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262677.001171] drivers/scsi/dc395x.c[2572]: 4, 0, 0
Do you have an idea what happened during these 7 seconds?
Quoted 6 lines
[262683.504018] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.530334] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.566400] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.569421] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.594330] drivers/scsi/dc395x.c[2572]: 4, 0, 0 [262683.620404] drivers/scsi/dc395x.c[2572]: 4, 0, 0
4 more seconds...
Quoted 2 lines
[262687.173095] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262687.198697] drivers/scsi/dc395x.c[2572]: 4, 0, 0
6 more...
Quoted 2 lines
[262713.038424] drivers/scsi/dc395x.c[2572]: 2, 0, 0 [262713.064027] drivers/scsi/dc395x.c[2572]: 4, 0, 0
Now, 12 seconds later - "unexpected reselect".
Quoted 10 lines
[262725.911499] dc395x: reselect: w/o disconnected cmds <02-0> [262725.911521] dc395x: disconnect: Unexpected reselection <02-0> [262845.687267] dc395x: eh_abort: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262845.687274] dc395x: eh_abort: Command in progress<6>dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262845.687280] dc395x: eh_abort: Command was waiting [262855.668103] dc395x: eh_abort: (pid#1008) target=<02-0> cmd=ffff810075fe3880 [262855.668111] dc395x: eh_abort: Command was waiting [262855.668119] dc395x: eh_bus_reset: (pid#1007) target=<02-0> cmd=ffff810075fe3dc0 [262855.668640] dc395x: doing_srb_done: pids G:1007(02-0) [262865.663561] drivers/scsi/dc395x.c[2572]: 2, 0, 0
So, do you have an idea - is it really so that you start the scanning in the first 20-second long interval, and then it just lasts all the time after that, or was there a preview, or something else?
Thanks
Guennadi
---
Guennadi Liakhovetski
drivers/scsi/dc395x.c +7 -4
@@ -64,6 +64,7 @@#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> +#include <scsi/scsi_dbg.h> #include "dc395x.h"
@@ -1403,10 +1404,10 @@ } srb =find_cmd (cmd, &dcb->srb_going_list);if (srb) { -dprintkl (KERN_DEBUG ,"eh_abort: Command in progress" ); +dprintkl (KERN_DEBUG ,"eh_abort: Command in progress\n" );/* XXX: Should abort the command here */ }else { -dprintkl (KERN_DEBUG ,"eh_abort: Command not found" ); +dprintkl (KERN_DEBUG ,"eh_abort: Command not found\n" ); }return FAILED ; }
@@ -2569,8 +2570,10 @@DC395x_write8 (acb,TRM_S1040_SCSI_CONFIG2 ,CFG2_WIDEFIFO ); -printk (KERN_INFO "%s[%d]: %u, %x, %d\n" , __FILE__, __LINE__, - left_io, srb->dcb->sync_period &WIDE_SYNC , srb->cmd->use_sg); +printk (KERN_INFO "%s[%d]: %u/%u, %p, %d\n" , __FILE__, __LINE__, + left_io, srb->request_length, + srb->cmd, srb->cmd->use_sg); +__scsi_print_command (srb->cmd->data_cmnd);while (left_io) {unsigned char *virt, *base =NULL ;