NetBSD Problem Report #57379

From chuq@chuq.com  Wed Apr 26 15:01:26 2023
Return-Path: <chuq@chuq.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D13441A923A
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 26 Apr 2023 15:01:26 +0000 (UTC)
Message-Id: <20230426150122.00BEA3CFFA26@spathi.chuq.com>
Date: Wed, 26 Apr 2023 08:01:22 -0700 (PDT)
From: chuq@chuq.com
Reply-To: chuq@chuq.com
To: gnats-bugs@NetBSD.org
Subject: running "usbdevs" during USB disk access causes hang
X-Send-Pr-Version: 3.95

>Number:         57379
>Category:       kern
>Synopsis:       running "usbdevs" during USB disk access causes hang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 26 15:05:00 +0000 2023
>Originator:     Chuck Silvers
>Release:        NetBSD 10.99.4 as of 2023/04/23 12:09:30
>Organization:
NetBSD
>Environment:
Architecture: x86_64
Machine: amd64
>Description:

While doing a stream of I/O operations to a USB disk, running "usbdevs"
causes all the I/O to hang and start timing out.  The driver code attempts to
reset the hardware but that fails:

[ 2383.8243784] umass1: Invalid CSW: tag 762078582 should be 132562
[ 2513.8444156] umass1: Invalid CSW: tag -1644167167 should be 132602
[ 2513.8532048] umass1: BBB reset failed, IOERROR
[ 2518.8581824] umass1: BBB bulk-in clear stall failed, TIMEOUT
[ 2518.8639908] sd1d: error writing fsbn 3368947648 of 3368947648-3368947775 (sd1 bn 3368947648; cn 1644993 tn 62 sn 0)
[ 2518.8747843] umass1: Invalid CSW: tag 1818435696 should be 132603
[ 2523.8807384] umass1: BBB reset failed, TIMEOUT

Sometimes some I/O operations fail before I/O starts hanging:

[ 1230.9798184] sd0(umass0:0:0:0): generic HBA error
[ 1230.9851010] sd0d: error reading fsbn 1228608 of 1228608-1228735 (sd0 bn 1228608; cn 599 tn 58 sn 0)
[ 1230.9941070] sd0(umass0:0:0:0): generic HBA error
[ 1230.9990025] sd0d: error reading fsbn 1228736 of 1228736-1228863 (sd0 bn 1228736; cn 599 tn 62 sn 0)
[ 1231.0081803] sd0(umass0:0:0:0): generic HBA error
[ 1231.0129036] sd0d: error reading fsbn 1228864 of 1228864-1228991 (sd0 bn 1228864; cn 600 tn 2 sn 0)
[ 1231.0218223] sd0(umass0:0:0:0): generic HBA error
[ 1231.0267177] sd0d: error reading fsbn 1228992 of 1228992-1229119 (sd0 bn 1228992; cn 600 tn 6 sn 0)
...

Sometimes the usbdevs command hangs too:

trace: pid 414 lid 414 at 0xffffc5862c8748a0
sleepq_block() at netbsd:sleepq_block+0x139
cv_wait() at netbsd:cv_wait+0x49
usbd_transfer() at netbsd:usbd_transfer+0x5f0
usbd_do_request_len() at netbsd:usbd_do_request_len+0xff
usbd_get_string_desc() at netbsd:usbd_get_string_desc+0x81
usbd_get_string0() at netbsd:usbd_get_string0+0x90
usbd_get_string() at netbsd:usbd_get_string+0xe
usbd_fill_deviceinfo() at netbsd:usbd_fill_deviceinfo+0x2e7
usbioctl() at netbsd:usbioctl+0xff
cdev_ioctl() at netbsd:cdev_ioctl+0x99
spec_ioctl() at netbsd:spec_ioctl+0x58
VOP_IOCTL() at netbsd:VOP_IOCTL+0x6f
vn_ioctl() at netbsd:vn_ioctl+0xc7
sys_ioctl() at netbsd:sys_ioctl+0x56d
syscall() at netbsd:syscall+0x196


>How-To-Repeat:

Run "usbdevs" while accessing a USB disk.


>Fix:
unknown

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.