From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 23 19:07:14 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D799E106567C; Mon, 23 Apr 2012 19:07:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id A956A8FC25; Mon, 23 Apr 2012 19:07:14 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 050A2B96D; Mon, 23 Apr 2012 15:07:14 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 23 Apr 2012 14:22:56 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201204231422.56916.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 23 Apr 2012 15:07:14 -0400 (EDT) Cc: Attilio Rao , FreeBSD Current , Arnaud Lacombe Subject: Re: Disabling an arbitrary 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: Mon, 23 Apr 2012 19:07:14 -0000 On Friday, April 20, 2012 8:50:07 pm Attilio Rao wrote: > Il 20 aprile 2012 19:18, Arnaud Lacombe ha scritto: > > Hi, > > > > On Fri, Apr 20, 2012 at 2:16 PM, Arnaud Lacombe wrote: > >> Hi, > >> > >> I will be bringing up an old thread there, but it would seem the > >> situation did not evolve in the past 9 years. I have a machine running > >> 7.1 whose UHCI controller is generating some interrupt storm: > >> > >> # vmstat -i > >> interrupt total rate > >> irq4: sio0 1328 2 > >> irq19: uhci1+ 63514509 96380 > >> [...] > >> > >> generating useless load on one CPU: > >> > >> # top -SH > >> last pid: 5223; load averages: 0.00, 0.00, 0.00 up 0+00:17:21 13:10:35 > >> 117 processes: 14 running, 79 sleeping, 24 waiting > >> CPU: 0.2% user, 0.0% nice, 0.2% system, 6.6% interrupt, 93.0% idle > >> Mem: 33M Active, 9348K Inact, 67M Wired, 400K Cache, 29M Buf, 2892M Free > >> [...] > >> 57 root -64 - 0K 8K CPU0 0 11:59 86.57% irq19: uhci1+ > >> > >> I thought I could use an hint to forbid uhci(4) attachment, ala: > >> > >> hint.uhci.0.disabled="1" > >> hint.uhci.1.disabled="1" > >> > >> in /boot/loader.conf. However, it would seem that what should be > >> usable with any arbitrary devices, ie. be an integral part of > >> device(9), has to be hardcoded in every driver, sad. > >> > > as for the usual "if you're not happy, please provide a patch": > > > > https://github.com/lacombar/freebsd/commit/30786d09b0cb441890cdc749ee5243238e81d2d8 > > I think a generalized kludge should really belong to > device_probe_child() rather than device_add_child_ordered(). eadler@ has a patch that is a better workaround, (it marks the device disabled after probe but before attach is called). This patch above only disables manually added devices that are added by name, so it wouldn't work for PCI devices (e.g. the uhci devices). -- John Baldwin