From owner-freebsd-scsi@freebsd.org Fri Jun 2 17:13:33 2017 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C10E5BFB9B4 for ; Fri, 2 Jun 2017 17:13:33 +0000 (UTC) (envelope-from stephen.mcconnell@broadcom.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480546E518 for ; Fri, 2 Jun 2017 17:13:33 +0000 (UTC) (envelope-from stephen.mcconnell@broadcom.com) Received: by mail-it0-x234.google.com with SMTP id m47so24457677iti.0 for ; Fri, 02 Jun 2017 10:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc:content-transfer-encoding; bh=vJS3QhRxfN4wT97HS+WcmKIRr693hp/xUijSidn6lOw=; b=bKZ6gGLLBCXOawDIvewP8NqNwzIPOME8UYW91OegBWNWOCpO8NKxtI4jBkxotfuLjf VgpTwHrVvMtn4Op4kRtQapqOsVjCetElJEiGoNjeWrAnHfcgBxM8RPLsl1bbarremLWe cPiEwG4dIK1hmZ4X2D3j4h1x5H5sSIYf5BMC8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc :content-transfer-encoding; bh=vJS3QhRxfN4wT97HS+WcmKIRr693hp/xUijSidn6lOw=; b=O+yqu59mL9SFvAfdgVGfJpBUcoNpFonGbtYm3/VA2B65TEGPQsXSEZ0kZUzy/mwGnG 59bavFxR3Hl4K4XjnYL0bb5GvNAYUg3QEkJflSAIrHXB6M7Mys2bXv3I7l4s5gcAZL2T p6VwMjh6q8CelViovnPtU3hud9m1zFh/jAsq7UQx+O4yKZgQXJ34dgvW05crps7JG1dB Nfe47fbtBZX8jjg+i+St3IU5oQHKOn5nG/+axEaJyN0DGYDrYPyufQc8arunusfg4ipI IVpFX5UtQGMNlLEy3yUoWR5AJDVvoTKRoFntJzNmD1QdiR7z+UblAXOVhFDnaX96/bl0 wlgw== X-Gm-Message-State: AODbwcBi5lZDvAes7UCUQEZZqrMLVbbgDhaEuL8g7Eep4eYChcIkYdjO +ln0XnD9yDa+BUYBxsrsBY6Yx4ZtzVU2 X-Received: by 10.107.181.68 with SMTP id e65mr10598044iof.156.1496423612543; Fri, 02 Jun 2017 10:13:32 -0700 (PDT) From: Stephen Mcconnell References: <592FDE8C.1090609@omnilan.de> <59303484.1040609@omnilan.de> <59306503.4010007@omnilan.de> <59315A74.9050506@omnilan.de> <20170602153705.GA56018@mithlond.kdm.org> <593198C3.2080902@omnilan.de> <59319917.1050301@omnilan.de> In-Reply-To: <59319917.1050301@omnilan.de> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQK5uw9AxlTbZs3SRUL7gsvMDeNX4QK127o/Aqh6HjgB6++7AwFsXC9MAdL6oGEBmtNDxAIdfU1yAZuZqeyfxSSoQA== Date: Fri, 2 Jun 2017 11:13:31 -0600 Message-ID: <86a38661813a20d3b349920c2de8962e@mail.gmail.com> Subject: RE: mps(4) blocks panic-reboot To: Harry Schmalzbauer , "Kenneth D. Merry" Cc: freebsd-scsi@freebsd.org, Scott Long Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 17:13:33 -0000 Thanks Harry. I'll need to do some testing here to see if I can figure it out. Steve > -----Original Message----- > From: Harry Schmalzbauer [mailto:freebsd@omnilan.de] > Sent: Friday, June 02, 2017 10:58 AM > To: Kenneth D. Merry > Cc: Stephen Mcconnell; freebsd-scsi@FreeBSD.ORG; Scott Long > Subject: Re: mps(4) blocks panic-reboot > > Bez=C3=BCglich Harry Schmalzbauer's Nachricht vom 02.06.2017 18:56 (localtime): > > Bez=C3=BCglich Kenneth D. Merry's Nachricht vom 02.06.2017 17:37 (localtime): > >> On Fri, Jun 02, 2017 at 14:30:44 +0200, Harry Schmalzbauer wrote: > > =E2=80=A6 > >>> KDB: stack backtrace: > >>> #0 0xffffffff805df4f7 at kdb_backtrace+0x67 > >>> #1 0xffffffff8059df96 at vpanic+0x186 > >>> #2 0xffffffff8059de03 at panic+0x43 > >>> #3 0xffffffff808a1892 at trap_fatal+0x322 > >>> #4 0xffffffff808a18e9 at trap_pfault+0x49 > >>> #5 0xffffffff808a1126 at trap+0x286 > >>> #6 0xffffffff80887401 at calltrap+0x8 > >>> #7 0xffffffff805800f2 at __mtx_unlock_sleep+0x72 > >>> #8 0xffffffff8029a7dc at xpt_polled_action+0x31c > >>> #9 0xffffffff80416c2b at mpssas_ir_shutdown+0x51b > >>> #10 0xffffffff8059db9a at kern_reboot+0x49a > >>> #11 0xffffffff8059d6f8 at sys_reboot+0x458 > >>> #12 0xffffffff808a23f4 at amd64_syscall+0x6c4 > >>> #13 0xffffffff808876eb at Xfast_syscall+0xfb > >>> > >>> (kgdb) list *0xffffffff805f43ec > >>> 0xffffffff805f43ec is in turnstile_broadcast > >>> (/usr/local/share/deploy- > tools/RELENG_11/src/sys/kern/subr_turnstile.c:837). > >>> 832 > >>> 833 /* > >>> 834 * Transfer the blocked list to the pending list. > >>> 835 */ > >>> 836 mtx_lock_spin(&td_contested_lock); > >>> 837 TAILQ_CONCAT(&ts->ts_pending, &ts->ts_blocked[queue], > >>> td_lockq); > >>> 838 mtx_unlock_spin(&td_contested_lock); > >>> 839 > >>> 840 /* > >>> 841 * Give a turnstile to each thread. The last thread gets > >>> > >>> I haven't looked at the code at all and only very briefly lokked at > >>> the diff, just out of curiosity, like pigs staring at clockworks ;-) > >>> > >>> But at least I hope this report does help. > >> Thanks for testing it! > >> > >> My guess is that the problem is that the problem is > >> xpt_polled_action() releases the device mutex, but > >> mpssas_SSU_to_SATA_devices() isn't acquiring the mutex. > >> > >> You could try putting the following around the call to xpt_polled_action(): > >> > >> mtx_lock(xpt_path_mtx(ccb->ccb_h.path)); > >> xpt_polled_action(ccb); > >> mtx_unlock(xpt_path_mtx(ccb->ccb_h.path)); > >> > >> See if that fixes things. One other thing to put in there -- after > >> the if (target->stop_at_shutdown) { } statement, but still inside the > >> for loop, add these two lines: > >> > >> xpt_free_path(ccb->ccb_h.path); > >> xpt_free_ccb(ccb); > > > > Jope I didn't mess up with text editing, pleas see the attached hunk > > if it corresponds to the (additional) chages to Stephen's diff. > > Sorry, now really with attachment...