From owner-freebsd-usb@FreeBSD.ORG Thu May 19 19:56:36 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50791065670; Thu, 19 May 2011 19:56:36 +0000 (UTC) (envelope-from Vishal.Shah@netapp.com) Received: from mx2.netapp.com (mx2.netapp.com [216.240.18.37]) by mx1.freebsd.org (Postfix) with ESMTP id AAFEA8FC0C; Thu, 19 May 2011 19:56:36 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.65,238,1304319600"; d="scan'208,217";a="549322631" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 19 May 2011 12:27:48 -0700 Received: from sacrsexc2-prd.hq.netapp.com (sacrsexc2-prd.hq.netapp.com [10.99.115.28]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p4JJRmoP010836; Thu, 19 May 2011 12:27:48 -0700 (PDT) Received: from rtprsexc1-prd.hq.netapp.com ([10.100.161.114]) by sacrsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 May 2011 12:27:48 -0700 Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.111]) by rtprsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 May 2011 15:27:47 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 19 May 2011 15:27:46 -0400 Message-ID: <86FB7D63AF95574BB762C0C3E1F269150D8B14AB@RTPMVEXC1-PRD.hq.netapp.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: System hang in USB umass module while processing panic Thread-Index: AcwWWtTYDoVXYgrST8OTypkGlk+eig== From: "Shah, Vishal" To: , X-OriginalArrivalTime: 19 May 2011 19:27:47.0466 (UTC) FILETIME=[D5AD16A0:01CC165A] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "Ranaweera, Samantha" , "Faylor, Christopher" Subject: System hang in USB umass module while processing panic X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 19:56:36 -0000 Hi Folks, =20 This is regarding the issue we saw in the USB driver of FreeBSD 8, particularly umass driver. We have a USB flash device in our system. =20 The issue is, when the system panics, it gets into the uni-processor mode, and while processing that panic, scsi layer shutdown handler (dashutdown())is called to issue the SYNCHRONIZE_CACHE command to the device. This command is never completed and the system hangs. =20 Details: =20 When the system panics, it gets into the uniprocessor mode and the usb_proc is never scheduled to complete the transfer which was enqueued while executing the SYNCHRONIZE_CACHE command sent by xpt_action() in the below loop. After sending(enqueuing xfer) the command, current process waits in a loop for the command to complete with a very large timeout value.=20 =20 Loop in xpt_polled_action() called by dashutdown(): =20 if (timeout !=3D 0) { xpt_action(start_ccb); while(--timeout > 0) { (*(sim->sim_poll))(sim); camisr_runqueue(&sim->sim_doneq); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) !=3D CAM_REQ_INPROG) break; DELAY(1000); } In FreeBSD 8 USB driver, commands are asynchronously sent from umass layer onto the wire, in other words, multiple threads are involved before the command is sent from the umass layer all the way to the wire. Since the usb_proc is not scheduled current process keeps waiting for the command to complete, hence the hang. =20 Is this a known issue? If yes, is there a fix available? Are there any plans of adding a synchronous path to send the command to the device? =20 Any information regarding this issue is much appreciated. =20 Thanks in advance, Vishal =20