Date: Tue, 09 May 2006 22:12:04 +0100 From: Ian Dowse <iedowse@iedowse.com> To: Scott Long <scottl@samsco.org> Cc: Peter Jeremy <peterjeremy@optushome.com.au>, Mark Tinguely <tinguely@casselton.net>, freebsd-current@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>, iedowse@iedowse.com Subject: Re: contigmalloc(9) doesn't honour M_NOWAIT. Message-ID: <200605092212.aa03145@nowhere.iedowse.com> In-Reply-To: Your message of "Tue, 09 May 2006 13:36:19 MDT." <4460EF33.8010909@samsco.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605092212.aa03145>