From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 11 15:42:42 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99F5716A420 for ; Sat, 11 Feb 2006 15:42:42 +0000 (GMT) (envelope-from iedowse@iedowse.com) Received: from nowhere.iedowse.com (nowhere.iedowse.com [82.195.144.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 4BFF243D5C for ; Sat, 11 Feb 2006 15:42:40 +0000 (GMT) (envelope-from iedowse@iedowse.com) Received: from localhost ([127.0.0.1] helo=iedowse.com) by nowhere.iedowse.com via local-iedowse id ; 11 Feb 2006 15:42:40 +0000 (GMT) To: Scott Long In-Reply-To: Your message of "Sat, 11 Feb 2006 00:13:05 MST." <43ED8E81.2060907@samsco.org> Date: Sat, 11 Feb 2006 15:42:35 +0000 From: Ian Dowse Message-ID: <200602111542.aa07502@nowhere.iedowse.com> Cc: freebsd-hackers@freebsd.org, nielsen@memberwebs.com Subject: Re: Panic Kernel Dump to umass device? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2006 15:42:42 -0000 In message <43ED8E81.2060907@samsco.org>, Scott Long writes: >You're correct that dumping is meant to be done with interrupts and task >switching disabled. The first thing that the umass driver is missing is >a working CAM poll handler. Without this, there is no way for command >completions to be seen when interrupts are disabled. Beyond that, I >somewhat suspect that the USB stack expects to be able to push command >completion work off to worker threads, at least for some situations, and >that also will not work in the kernel dump environment. So, there is a >lot of work needed to make this happen. The USB stack supports polled operations, so it's actually not to hard to make this work. Below is a patch I had in one of my local trees that adds a CAM poll handler to the umass driver. I've just tested this and it does seem to make kernel dumping work, but I guess it might not be as reliable as dumping to other devices. Ian Index: umass.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/umass.c,v retrieving revision 1.128 diff -u -r1.128 umass.c --- umass.c 9 Jan 2006 01:33:53 -0000 1.128 +++ umass.c 11 Feb 2006 12:57:43 -0000 @@ -2627,21 +2627,17 @@ } } -/* umass_cam_poll - * all requests are handled through umass_cam_action, requests - * are never pending. So, nothing to do here. - */ Static void umass_cam_poll(struct cam_sim *sim) { -#ifdef USB_DEBUG struct umass_softc *sc = (struct umass_softc *) sim->softc; DPRINTF(UDMASS_SCSI, ("%s: CAM poll\n", USBDEVNAME(sc->sc_dev))); -#endif - /* nop */ + usbd_set_polling(sc->sc_udev, 1); + usbd_dopoll(sc->iface); + usbd_set_polling(sc->sc_udev, 0); }