From owner-freebsd-current@freebsd.org Sun Nov 4 14:02:23 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F3201102DE3 for ; Sun, 4 Nov 2018 14:02:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id DD2F370CE6 for ; Sun, 4 Nov 2018 14:02:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id A1C221102DE0; Sun, 4 Nov 2018 14:02:22 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF801102DDF for ; Sun, 4 Nov 2018 14:02:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C090770CDE for ; Sun, 4 Nov 2018 14:02:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd29.google.com with SMTP id f12-v6so4643014iog.0 for ; Sun, 04 Nov 2018 06:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E0HZ7DivyPXefU7ZbNibM9eI6qsk96qQ0niBiFmMjj8=; b=WcAP4/8eBDt5VkCIfT/R6WE5isunON9/TkgcnG2Pe5q1xyZlbZfdQgXHYHucrkQxIo frA/+Eoef1nB0PN/nZjPh36byAlUV9OuiAlbBlxkko1jQg0pEpInhSQ4Ue3sX1nJLbsf TKcQfQsrsqmvTTvjYXXhs5FjR70GEm9stVAy1YfX3LcvWcn1nFRtQi6/VbmgzPutgEhR 5CsOHGHrJ0vsjZkTA9/vOlEJZGHCp3IARQrU1uKxRTJyIhGXCPAVfN0I89jwhwk7EfWv Srg5nM+Ey2kc4P9LBYkWIwLvi9+0iA8efJOPr6ExrjlCh9TKZZJ3e8dZm9N2F/sGiVsU eY1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E0HZ7DivyPXefU7ZbNibM9eI6qsk96qQ0niBiFmMjj8=; b=qKToyxVeMw4KS2atWqsashXCX5SffcCjXcfXjgjOcpUjN8tP/5EwUGYrwEbPBFYaWY q46wzI9ydWMGdSAYyP02p42UThIamvLv/bp8zlLe+gMg2sji1NB/a9gwA1rQ+8PXPfXG g6+42Ia2RAIE2WK+sHmoipCYp3Bg//HMi7P1g9HfG8TnRvzP9lpJEAnFf7hUA6cX1UpU hkIESASr9mvH5OnV6O42bsamUN0nb1Otu3BrRamoh3cw8SHItlNoT7WN+wQfawRIpBPh uKkI5gNRBdKw2sXV2IoVpAGsfgWHlpafZfrMpJzEbAmxfANdH8XxyllnamgHMZ3Ct9yl 66kw== X-Gm-Message-State: AGRZ1gLl0HuRJmOF+mqa7+vQzJxu3f77+3JPVMEd+fGbLTbvMsBldit6 kmtgkmGgELRJcYW9z65RFIM2WSbN55A3IBmmHDobMV0a X-Google-Smtp-Source: AJdET5dPxjuQAzoKoyXvG3zGljJCRaPJaYjdCQo95TohEr8UBtuU3bwracHckdnNhv71IMxHmuXbqQ/5GOQGNBMBV6w= X-Received: by 2002:a6b:e710:: with SMTP id b16-v6mr11672011ioh.37.1541340140654; Sun, 04 Nov 2018 06:02:20 -0800 (PST) MIME-Version: 1.0 References: <22774.1541314393@critter.freebsd.dk> In-Reply-To: <22774.1541314393@critter.freebsd.dk> From: Warner Losh Date: Sun, 4 Nov 2018 07:02:09 -0700 Message-ID: Subject: Re: armv7 BETA3 panics when usb-disk inserted To: Poul-Henning Kamp Cc: FreeBSD Current X-Rspamd-Queue-Id: DD2F370CE6 X-Spamd-Result: default: False [-4.79 / 200.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; FORWARDED(0.00)[current@mailman.ysv.freebsd.org]; FORGED_SENDER_FORWARDING(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[bsdimp.com]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_NO_TLS_LAST(0.10)[]; IP_SCORE(-2.95)[ip: (-9.27), ipnet: 2001:1900:2254::/48(-3.15), asn: 10310(-2.25), country: US(-0.07)]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FORGED_RECIPIENTS(0.00)[phk@phk.freebsd.dk ..,freebsd-current@freebsd.org] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 14:02:23 -0000 On Sun, Nov 4, 2018 at 12:55 AM Poul-Henning Kamp wrote: > With the 12.0-BETA3 BEAGLEBONE image, I very often see this panic > when I plug a USB attached SSD disk in. > ... > umass0 on uhub0 > umass0: > on usbus1 > umass0: SCSI over Bulk-Only; quirks = 0x8100 > umass0:0:0: Attached to scbus0 > da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 > da0: Fixed Direct Access SPC-2 SCSI > device > da0: Serial Number 2HC015KJ > da0: 40.000MB/s transfers > da0: 38166MB (78165359 512 byte sectors) > da0: quirks=0x2 > panic: _mtx_lock_sleep: recursed on non-recursive mutex CAM device > lock @ /usr/src/sys/cam/scsi/scsi_da.c:2123 > ... > db_trace_self() at db_trace_self > db_trace_self_wrapper() at db_trace_self_wrapper+0x30 > vpanic() at vpanic+0x16c > doadump() at doadump > __mtx_unlock_flags() at __mtx_unlock_flags > __mtx_lock_flags() at __mtx_lock_flags+0xec > daasync() at daasync+0x5c > This is line 2123 > xpt_async_process_dev() at xpt_async_process_dev+0x220 > xptdevicetraverse() at xptdevicetraverse+0xa4 > xpttargettraverse() at xpttargettraverse+0x7c > $a.10() at $a.10+0x148 > I love our new kang overlords. Glad I didn't vote for kodos... > xpt_done_process() at xpt_done_process+0x3c4 > xpt_done_td() at xpt_done_td+0xec > So we're doing a walk of the scsi/sata namespace for the umass SIM and we're calling daasync with a lock it expects to take out. The whole locking stuff here is "a bit complicated" so I'll see why we're hitting this case and at the same time simplify. I'll see if I can recreate this bug here... Warner