From owner-freebsd-current@FreeBSD.ORG Tue May 9 21:12:15 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8124316A438; Tue, 9 May 2006 21:12:15 +0000 (UTC) (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 5B78843D49; Tue, 9 May 2006 21:12:13 +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 ; 9 May 2006 22:12:05 +0100 (IST) To: Scott Long In-Reply-To: Your message of "Tue, 09 May 2006 13:36:19 MDT." <4460EF33.8010909@samsco.org> Date: Tue, 09 May 2006 22:12:04 +0100 From: Ian Dowse Message-ID: <200605092212.aa03145@nowhere.iedowse.com> Cc: Peter Jeremy , Mark Tinguely , freebsd-current@freebsd.org, Pawel Jakub Dawidek , iedowse@iedowse.com Subject: Re: contigmalloc(9) doesn't honour M_NOWAIT. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 09 May 2006 21:12:16 -0000 In message <4460EF33.8010909@samsco.org>, Scott Long writes: >Peter Jeremy wrote: >> On Tue, 2006-May-09 16:03:12 +0200, Pawel Jakub Dawidek wrote: >> >>>Using a USB pendrive can lead to kernel panic because of the issue >>>mentioned in the subject. >> >> >> See kern/78179. Mark Tinguely and I have spent a far amount of time >> fighting it. We have made some improvement - bus_dmamem_alloc() >> correctly supports BUS_DMA_NOWAIT so you get a runtime error instead >> of a panic. At this stage, the umass device needs to be re-written so >> that it doesn't issue large contiguous mallocs at interrupt level. >> The way forward would seem to be to make the USB subsystem support >> scatter-gather (skeleton code already exists) to avoid the need for >> contigmalloc(). > >Yes, this is the correct solution. Unfortunately, it looks to require a >significant amount of code for UHCI controllers. But then, the whole >point of UHCI is to have the OS do all the work anyways =-/ I'm very close to being ready to commit full scatter-gather support for UHCI, OHCI and EHCI - I've just been very busy with other things so haven't completed untangling it from some other changes. A diff from my current tree is at http://people.freebsd.org/~iedowse/usb.diff but I'm not sure if it works as-is, and it contains many unrelated and unnecessary changes (e.g. EHCI_SCFLG_CURQTDBUG was a hunch that turned out to make no difference on some problem cases I can reproduce). The bit I was trying to commit first is a set of EHCI changes that make it follow the spec when adding qTDs to an existing QH, and then get to the scatter-gather support. Ian