linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
@ 2002-09-21 20:41 Marek Michalkiewicz
  2002-09-21 22:53 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Michalkiewicz @ 2002-09-21 20:41 UTC (permalink / raw)
  To: greg, mdharm-usb; +Cc: linux-kernel

Hi,

while getting my Sagatek DCS-CF (aka Datafab KECF-USB) USB/CompactFlash
adapter to work, I got an Oops after adding US_FL_MODE_XLATE to the
drivers/usb/storage/unusual_devs.h entry.  Fortunately, my device does
not require that flag (it just avoids a harmless "test WP failed"
message, but the Oops a while later is worse ;), but I hope you find
the bug report useful (I can also see the same problem under 2.4.19).

See below for the patch I applied (note that US_FL_MODE_XLATE is not
required for the device to work, only required to trigger the Oops),
and the decoded Oops itself.  After the Oops, the system continues
to run, but the scsi_eh_2 process dies, and any process trying to
access the device gets stuck in the D state forever.

Thanks,
Marek


--- orig/linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-21 12:27:12.000000000 +0200
+++ linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-21 18:35:04.000000000 +0200
@@ -485,6 +485,17 @@
 		US_FL_MODE_XLATE ),
 #endif
 
+/* Datafab KECF-USB / Sagatek DCS-CF (Datafab DF-UG-07 chip).
+ * Submitted by Marek Michalkiewicz <marekm@amelek.gda.pl>.
+ * Needed for FIX_INQUIRY.  Only revision 1.13 tested.
+ * See also http://martin.wilck.bei.t-online.de/#kecf .
+ */
+UNUSUAL_DEV(  0x07c4, 0xa400, 0x0000, 0xffff,
+		"Datafab",
+		"KECF-USB",
+		US_SC_SCSI, US_PR_BULK, NULL,
+		US_FL_FIX_INQUIRY | US_FL_MODE_XLATE ),
+
 /* Casio QV 2x00/3x00/4000/8000 digital still cameras are not conformant
  * to the USB storage specification in two ways:
  * - They tell us they are using transport protocol CBI. In reality they


ksymoops 2.4.6 on i686 2.4.20-pre7.  Options used
     -V (default)
     -K (specified)
     -L (specified)
     -o /lib/modules/2.4.20-pre7/ (default)
     -m /boot/System.map-2.4.20-pre7 (default)

No modules in ksyms, skipping objects
Unable to handle kernel paging request at virtual address 00140021
c02a4811
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c02a4811>]    Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010206
eax: 00140005   ebx: cfec2000   ecx: cfc0de70   edx: cff585c0
esi: 0000012c   edi: cfc0c000   ebp: cfc0de70   esp: cfc0de50
ds: 0018   es: 0018   ss: 0018
Process scsi_eh_2 (pid: 29, stackpage=cfc0d000)
Stack: c02a4902 cff585c0 cfec2000 85033b80 cfe22200 cfc0df5c 00000109 cfc0de80 
       cfc0de88 cfc0de88 00000000 00000000 00000000 cfc0c000 cfc0de70 cfc0de70 
       c02a4a63 cff585c0 0000012c cfc0deb0 cfe22200 00000004 00000080 00000004 
Call Trace:    [<c02a4902>] [<c02a4a63>] [<c02a4af3>] [<c02a580e>] [<c02a7f74>]
  [<c02b629d>] [<c0258607>] [<c0258e66>] [<c0259409>] [<c0106ec0>]
Code: 8b 40 1c 85 c0 74 0a 52 8b 40 0c ff d0 83 c4 04 c3 b8 ed ff 


>>EIP; c02a4811 <usb_submit_urb+19/30>   <=====

Trace; c02a4902 <usb_start_wait_urb+8a/18c>
Trace; c02a4a63 <usb_internal_control_msg+5f/74>
Trace; c02a4af3 <usb_control_msg+7b/98>
Trace; c02a580e <usb_get_descriptor+96/b0>
Trace; c02a7f74 <usb_reset_device+18c/311>
Trace; c02b629d <bus_reset+5d/150>
Trace; c0258607 <scsi_try_bus_reset+3b/88>
Trace; c0258e66 <scsi_unjam_host+50a/970>
Trace; c0259409 <scsi_error_handler+13d/19c>
Trace; c0106ec0 <kernel_thread+28/38>

Code;  c02a4811 <usb_submit_urb+19/30>
00000000 <_EIP>:
Code;  c02a4811 <usb_submit_urb+19/30>   <=====
   0:   8b 40 1c                  mov    0x1c(%eax),%eax   <=====
Code;  c02a4814 <usb_submit_urb+1c/30>
   3:   85 c0                     test   %eax,%eax
Code;  c02a4816 <usb_submit_urb+1e/30>
   5:   74 0a                     je     11 <_EIP+0x11> c02a4822 <usb_submit_urb+2a/30>
Code;  c02a4818 <usb_submit_urb+20/30>
   7:   52                        push   %edx
Code;  c02a4819 <usb_submit_urb+21/30>
   8:   8b 40 0c                  mov    0xc(%eax),%eax
Code;  c02a481c <usb_submit_urb+24/30>
   b:   ff d0                     call   *%eax
Code;  c02a481e <usb_submit_urb+26/30>
   d:   83 c4 04                  add    $0x4,%esp
Code;  c02a4821 <usb_submit_urb+29/30>
  10:   c3                        ret    
Code;  c02a4822 <usb_submit_urb+2a/30>
  11:   b8 ed ff 00 00            mov    $0xffed,%eax



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-21 20:41 Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7) Marek Michalkiewicz
@ 2002-09-21 22:53 ` Greg KH
  2002-09-22 16:08   ` Marek Michalkiewicz
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2002-09-21 22:53 UTC (permalink / raw)
  To: Marek Michalkiewicz; +Cc: mdharm-usb, linux-kernel

On Sat, Sep 21, 2002 at 10:41:52PM +0200, Marek Michalkiewicz wrote:
> Hi,
> 
> while getting my Sagatek DCS-CF (aka Datafab KECF-USB) USB/CompactFlash
> adapter to work, I got an Oops after adding US_FL_MODE_XLATE to the
> drivers/usb/storage/unusual_devs.h entry.  Fortunately, my device does
> not require that flag (it just avoids a harmless "test WP failed"
> message, but the Oops a while later is worse ;), but I hope you find
> the bug report useful (I can also see the same problem under 2.4.19).

Could you try the patch at:
	http://marc.theaimsgroup.com/?l=linux-usb-devel&m=103255250215947&w=2
for 2.4.20-pre7 and see if it fixes your problem?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-21 22:53 ` Greg KH
@ 2002-09-22 16:08   ` Marek Michalkiewicz
  2002-09-23 19:27     ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Michalkiewicz @ 2002-09-22 16:08 UTC (permalink / raw)
  To: Greg KH; +Cc: Marek Michalkiewicz, mdharm-usb, linux-kernel

> Could you try the patch at:
> 	http://marc.theaimsgroup.com/?l=linux-usb-devel&m=103255250215947&w=2
> for 2.4.20-pre7 and see if it fixes your problem?

It doesn't - consistent Oops about 40 seconds after boot (all drivers
compiled into the kernel), even if I don't try accessing the device,
disconnecting it, or anything like that.  After the Oops, any process
trying to access /dev/sda gets stuck forever in D state with WCHAN
scsi_block_when_processing_errors.  The rest of the USB subsystem
seems to work fine - the mouse is still working...

Another Oops (not as consistent, happens only sometimes) is in kfree(),
which would indicate a bad pointer somewhere, but I don't have that one
saved, as it happens in swapper task and klogd has no chance to log it.
I can try to write down more details if that would be helpful though.

EIP = 0xc012be28
c012bd54 T kmem_cache_free
c012bdfc T kfree
c012beac T kmem_cache_size

None of this happens without the US_FL_MODE_XLATE flag...
Then I get "test WP failed" instead of "Write Protect is off", none of
the "Command will be truncated to fit in SENSE6 buffer" messages, no
disconnect, and no Oops.

Below are the relevant kernel messages.

Marek

Sep 22 17:36:27 mm kernel: hub.c: new USB device 00:07.2-1, assigned address 2
Sep 22 17:36:27 mm kernel: usb-uhci.c: interrupt, status 2, frame# 1295
Sep 22 17:36:27 mm kernel: usb_control/bulk_msg: timeout
Sep 22 17:36:27 mm kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Sep 22 17:36:27 mm kernel:   Vendor: Datafab   Model: KECF-USB          Rev: 0113
Sep 22 17:36:27 mm kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Sep 22 17:36:27 mm kernel: Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
Sep 22 17:36:27 mm kernel: SCSI device sda: 125185 512-byte hdwr sectors (64 MB)
Sep 22 17:36:27 mm kernel: usb-storage: Command will be truncated to fit in SENSE6 buffer.
Sep 22 17:36:27 mm kernel: sda: Write Protect is off
Sep 22 17:36:27 mm kernel:  sda: sda1
Sep 22 17:36:27 mm kernel: WARNING: USB Mass Storage data integrity not assured
Sep 22 17:36:27 mm kernel: USB Mass Storage device found at 2
Sep 22 17:36:27 mm kernel: hub.c: new USB device 00:07.2-2, assigned address 3
Sep 22 17:36:27 mm kernel: input0: USB HID v1.00 Mouse [KYE Genius USB Wheel Mouse] on usb1:3.0

Sep 22 17:36:31 mm kernel: usb-storage: Command will be truncated to fit in SENSE6 buffer.
Sep 22 17:36:31 mm kernel: usb-storage: Command will be truncated to fit in SENSE6 buffer.
Sep 22 17:37:08 mm kernel: usb.c: USB disconnect on device 00:07.2-1 address 2
Sep 22 17:37:08 mm kernel: Unable to handle kernel paging request at virtual address 00140021
Sep 22 17:37:08 mm kernel:  printing eip:
Sep 22 17:37:08 mm kernel: c02a4811
Sep 22 17:37:08 mm kernel: *pde = 00000000
Sep 22 17:37:08 mm kernel: Oops: 0000
Sep 22 17:37:08 mm kernel: CPU:    0
Sep 22 17:37:08 mm kernel: EIP:    0010:[usb_submit_urb+25/48]    Not tainted
Sep 22 17:37:08 mm kernel: EFLAGS: 00010206
Sep 22 17:37:08 mm kernel: eax: 00140005   ebx: d3cff000   ecx: d3a5be78   edx: d3e43ec0
Sep 22 17:37:08 mm kernel: esi: 0000012c   edi: d3a5a000   ebp: d3a5be78   esp: d3a5be58
Sep 22 17:37:08 mm kernel: ds: 0018   es: 0018   ss: 0018
Sep 22 17:37:08 mm kernel: Process scsi_eh_2 (pid: 29, stackpage=d3a5b000)
Sep 22 17:37:08 mm kernel: Stack: c02a4902 d3e43ec0 d3cff000 85033b80 d3e27320 d3e272c0 00000109 d3a5be88
Sep 22 17:37:08 mm kernel:        d3a5be90 d3a5be90 00000000 00000000 00000000 d3a5a000 d3a5be78 d3a5be78
Sep 22 17:37:08 mm kernel:        c02a4a63 d3e43ec0 0000012c d3a5beb8 d3e27320 00000012 00000080 00000012
Sep 22 17:37:08 mm kernel: Call Trace:    [usb_start_wait_urb+138/396] [usb_internal_control_msg+95/116] [usb_control_msg+123/152] [usb_get_descriptor+150/176] [usb_reset_device+377/809]
Sep 22 17:37:08 mm kernel:   [bus_reset+93/336] [scsi_try_bus_reset+59/136] [scsi_unjam_host+1290/2416] [scsi_error_handler+317/412] [kernel_thread+40/56]
Sep 22 17:37:08 mm kernel:
Sep 22 17:37:08 mm kernel: Code: 8b 40 1c 85 c0 74 0a 52 8b 40 0c ff d0 83 c4 04 c3 b8 ed ff
Sep 22 17:37:08 mm kernel:  <6>hub.c: new USB device 00:07.2-1, assigned address 4
Sep 22 17:37:09 mm kernel: WARNING: USB Mass Storage data integrity not assured
Sep 22 17:37:09 mm kernel: USB Mass Storage device found at 4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-22 16:08   ` Marek Michalkiewicz
@ 2002-09-23 19:27     ` Greg KH
  2002-09-23 19:51       ` Marek Michalkiewicz
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2002-09-23 19:27 UTC (permalink / raw)
  To: Marek Michalkiewicz; +Cc: mdharm-usb, linux-kernel

On Sun, Sep 22, 2002 at 06:08:30PM +0200, Marek Michalkiewicz wrote:
> 
> None of this happens without the US_FL_MODE_XLATE flag...

They don't use that flag. :)

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-23 19:27     ` Greg KH
@ 2002-09-23 19:51       ` Marek Michalkiewicz
  2002-09-23 20:05         ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Michalkiewicz @ 2002-09-23 19:51 UTC (permalink / raw)
  To: Greg KH; +Cc: Marek Michalkiewicz, mdharm-usb, linux-kernel

Greg KH <greg@kroah.com> wrote:
> On Sun, Sep 22, 2002 at 06:08:30PM +0200, Marek Michalkiewicz wrote:
> > None of this happens without the US_FL_MODE_XLATE flag...
> They don't use that flag. :)

OK - "test WP failed" is harmless (unless there are read-only CF
cards...), but it would still be nice to track down that bug as it
might affect other devices (those that require MODE_XLATE).

In the meantime, may I ask you nicely to add this to 2.4.20
drivers/usb/storage/unusual_devs.h ?

/* Datafab KECF-USB / Sagatek DCS-CF (Datafab DF-UG-07 chip).
 * Submitted by Marek Michalkiewicz <marekm@amelek.gda.pl>.
 * Needed for FIX_INQUIRY.  Only revision 1.13 tested.
 * See also http://martin.wilck.bei.t-online.de/#kecf .
 */
UNUSUAL_DEV(  0x07c4, 0xa400, 0x0000, 0xffff,
		"Datafab",
		"KECF-USB",
		US_SC_SCSI, US_PR_BULK, NULL,
		US_FL_FIX_INQUIRY ),

Note that this uses the normal US_PR_BULK protocol (not US_PR_DATAFAB -
tried that one too, didn't work) so this shouldn't be conditional on
CONFIG_USB_STORAGE_DATAFAB, just always included.  It seems that newer
Datafab devices are slightly less broken^Wunusual than the old ones ;)

I say "Datafab" because the name "Sagatek" (http://www.sagatek.com.tw/)
appears only on the packaging.  There is a Datafab chip inside, and
"KECF-USBG" is actually printed on the PCB inside...

Thanks,
Marek


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-23 19:51       ` Marek Michalkiewicz
@ 2002-09-23 20:05         ` Greg KH
  2002-09-23 20:24           ` Marek Michalkiewicz
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2002-09-23 20:05 UTC (permalink / raw)
  To: Marek Michalkiewicz; +Cc: mdharm-usb, linux-kernel

On Mon, Sep 23, 2002 at 09:51:15PM +0200, Marek Michalkiewicz wrote:
> 
> In the meantime, may I ask you nicely to add this to 2.4.20
> drivers/usb/storage/unusual_devs.h ?

That's Matt's call, not mine.  And generating a patch for 2.4.20-pre7
and 2.5.38 would help out in getting it accepted :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-23 20:05         ` Greg KH
@ 2002-09-23 20:24           ` Marek Michalkiewicz
  2002-09-23 20:52             ` Matthew Dharm
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Michalkiewicz @ 2002-09-23 20:24 UTC (permalink / raw)
  To: Greg KH; +Cc: Marek Michalkiewicz, mdharm-usb, linux-kernel

Greg KH <greg@kroah.com> wrote:
> That's Matt's call, not mine.  And generating a patch for 2.4.20-pre7
> and 2.5.38 would help out in getting it accepted :)

Below is the patch for 2.4.20-pre7.  I'm not brave enough to test 2.5.x
kernels just yet...

Thanks,
Marek

--- orig/linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-21 12:27:12.000000000 +0200
+++ linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-23 22:09:18.000000000 +0200
@@ -485,6 +485,17 @@
 		US_FL_MODE_XLATE ),
 #endif
 
+/* Datafab KECF-USB / Sagatek DCS-CF (Datafab DF-UG-07 chip).
+ * Submitted by Marek Michalkiewicz <marekm@amelek.gda.pl>.
+ * Needed for FIX_INQUIRY.  Only revision 1.13 tested.
+ * See also http://martin.wilck.bei.t-online.de/#kecf .
+ */
+UNUSUAL_DEV(  0x07c4, 0xa400, 0x0000, 0xffff,
+		"Datafab",
+		"KECF-USB",
+		US_SC_SCSI, US_PR_BULK, NULL,
+		US_FL_FIX_INQUIRY ),
+
 /* Casio QV 2x00/3x00/4000/8000 digital still cameras are not conformant
  * to the USB storage specification in two ways:
  * - They tell us they are using transport protocol CBI. In reality they



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7)
  2002-09-23 20:24           ` Marek Michalkiewicz
@ 2002-09-23 20:52             ` Matthew Dharm
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Dharm @ 2002-09-23 20:52 UTC (permalink / raw)
  To: Marek Michalkiewicz; +Cc: Greg KH, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

Actually, 2.5 tests would be good... we've re-worked the state machine, so
the behavior might be significantly different.

Not that I can get 2.5.x to boot for me right now, tho...

Matt

On Mon, Sep 23, 2002 at 10:24:44PM +0200, Marek Michalkiewicz wrote:
> Greg KH <greg@kroah.com> wrote:
> > That's Matt's call, not mine.  And generating a patch for 2.4.20-pre7
> > and 2.5.38 would help out in getting it accepted :)
> 
> Below is the patch for 2.4.20-pre7.  I'm not brave enough to test 2.5.x
> kernels just yet...
> 
> Thanks,
> Marek
> 
> --- orig/linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-21 12:27:12.000000000 +0200
> +++ linux-2.4.20-pre7/drivers/usb/storage/unusual_devs.h	2002-09-23 22:09:18.000000000 +0200
> @@ -485,6 +485,17 @@
>  		US_FL_MODE_XLATE ),
>  #endif
>  
> +/* Datafab KECF-USB / Sagatek DCS-CF (Datafab DF-UG-07 chip).
> + * Submitted by Marek Michalkiewicz <marekm@amelek.gda.pl>.
> + * Needed for FIX_INQUIRY.  Only revision 1.13 tested.
> + * See also http://martin.wilck.bei.t-online.de/#kecf .
> + */
> +UNUSUAL_DEV(  0x07c4, 0xa400, 0x0000, 0xffff,
> +		"Datafab",
> +		"KECF-USB",
> +		US_SC_SCSI, US_PR_BULK, NULL,
> +		US_FL_FIX_INQUIRY ),
> +
>  /* Casio QV 2x00/3x00/4000/8000 digital still cameras are not conformant
>   * to the USB storage specification in two ways:
>   * - They tell us they are using transport protocol CBI. In reality they
> 

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

I say, what are all those naked people doing?
					-- Big client to Stef
User Friendly, 12/14/1997

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-23 20:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-21 20:41 Oops in usb_submit_urb with US_FL_MODE_XLATE (2.4.19 and 2.4.20-pre7) Marek Michalkiewicz
2002-09-21 22:53 ` Greg KH
2002-09-22 16:08   ` Marek Michalkiewicz
2002-09-23 19:27     ` Greg KH
2002-09-23 19:51       ` Marek Michalkiewicz
2002-09-23 20:05         ` Greg KH
2002-09-23 20:24           ` Marek Michalkiewicz
2002-09-23 20:52             ` Matthew Dharm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).