Re: panic with CF drive + USB reader

From: Bernd Walter <ticso_at_cicely12.cicely.de>
Date: Tue, 26 Aug 2003 00:34:18 +0200
On Mon, Aug 25, 2003 at 02:11:45PM -0700, Lars Eggert wrote:
> Here's another, different one:
> 
> (da2:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0
> (da2:umass-sim0:0:0:0): CAM Status: SCSI Status Error
> (da2:umass-sim0:0:0:0): SCSI Status: Check Condition
> (da2:umass-sim0:0:0:0): UNIT ATTENTION asc:0,0
> (da2:umass-sim0:0:0:0): No additional sense information
> (da2:umass-sim0:0:0:0): Retrying Command (per Sense Data)
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED
> (da2:umass-sim0:0:0:0): AutoSense Failed
> umass0: BBB reset failed, STALLED

Seems that handling the stalled condition failed.
Can you try the following patch:
RCS file: /home/ncvs/src/sys/dev/usb/usbdi.c,v
retrieving revision 1.76
diff -u -r1.76 usbdi.c
--- usbdi.c	26 May 2002 22:00:06 -0000	1.76
+++ usbdi.c	15 Jun 2003 04:23:48 -0000
_at__at_ -931,8 +931,17 _at__at_
 usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
 		      void *data, u_int16_t flags, int *actlen, u_int32_t timo)
 {
-	return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req,
-					   data, flags, actlen, timo));
+	int actlen2;
+	usbd_status ret;
+
+	ret = usbd_do_request_flags_pipe(dev, dev->default_pipe, req,
+					   data, flags, &actlen2, timo);
+	if (actlen != NULL)
+		*actlen = actlen2;
+	if (ret == USBD_STALLED && actlen2 == UGETW(req->wLength)) {
+		ret = USBD_NORMAL_COMPLETION;
+	}
+	return (ret);
 }

I'm not shure that this patch will have an effect for your drive, but
it helped in other cases of broken stall conditions.
However not all stall brokeness can be worked around this way.
Why the stall condition was triggered is another question.
 
> /cf: bad dir ino 47104 at offset 0: mangled entry
> panic: ufs_dirbad: bad dir

The panic is also another issue.
I guess someone has told upper layers success without this beeing the
case.

-- 
B.Walter                   BWCT                http://www.bwct.de
ticso_at_bwct.de                                  info_at_bwct.de
Received on Mon Aug 25 2003 - 13:34:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:20 UTC