From owner-freebsd-usb@FreeBSD.ORG Wed May 25 17:46:00 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 654AB106566C; Wed, 25 May 2011 17:46:00 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id AA8E08FC0C; Wed, 25 May 2011 17:45:59 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=EsGlCpMeIw85Gy1IHWHJoTo3ieATU4tNmYze/bSqBec= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=4j0xZboyc7kA:10 a=dBRESv0yCI8A:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=b5XoorI1gUE5tkVxrq8A:9 a=Q5NtXNl_RcwuxCAGZRUA:7 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 131419313; Wed, 25 May 2011 19:45:57 +0200 Received-SPF: softfail receiver=mailfe07.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 25 May 2011 19:44:43 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <86FB7D63AF95574BB762C0C3E1F269150D8B14AB@RTPMVEXC1-PRD.hq.netapp.com> <201105251711.09594.hselasky@freebsd.org> <86FB7D63AF95574BB762C0C3E1F269150D986E24@RTPMVEXC1-PRD.hq.netapp.com> In-Reply-To: <86FB7D63AF95574BB762C0C3E1F269150D986E24@RTPMVEXC1-PRD.hq.netapp.com> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105251944.43080.hselasky@freebsd.org> Cc: "Shah, Vishal" , "Ranaweera, Samantha" , "Faylor, Christopher" , Andriy Gapon Subject: Re: 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: Wed, 25 May 2011 17:46:00 -0000 On Wednesday 25 May 2011 19:37:01 Shah, Vishal wrote: > Hi Hans Petter, > > Thanks for looking into this. > The command is not hanging on a USB device. The issue is, command never > reaches the USB device. As I understand it, after receiving the command > from the upper layers, umass layer will just enqueue the xfer at the > USBD layer. And then usb_proc process is supposed to take the xfer from > the queue and give it to the EHCI layer. When the system panics and gets > into the uni-processor environment, the current process issues a > SYNCHRONIZE_CACHE command keeps polling the umass layer for the > completion of that xfer, and won't leave the single running CPU. For > this reason, the usb_proc is never scheduled after that and the xfer > never reaches the USB device. > > Thanks, > Vishal Hi, In UNI processor mode the following function will be called, which will poll the transfers (at the side of the USB processes): static void umass_cam_poll(struct cam_sim *sim) { struct umass_softc *sc = (struct umass_softc *)sim->softc; if (sc == UMASS_GONE) return; DPRINTF(sc, UDMASS_SCSI, "CAM poll\n"); usbd_transfer_poll(sc->sc_xfer, UMASS_T_MAX); } If the umass_cam_poll() is not called, then any pending SCSI commands will not complete. However, if the panic triggers inside the USB stack, this might not work like expected. --HPS