From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 21:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A07E106566B; Fri, 27 Jan 2012 21:49:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 254E58FC12; Fri, 27 Jan 2012 21:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RLn3av061919; Fri, 27 Jan 2012 21:49:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RLn2U3061917; Fri, 27 Jan 2012 21:49:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201272149.q0RLn2U3061917@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jan 2012 21:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230626 - head/sys/dev/pccbb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 21:49:03 -0000 Author: imp Date: Fri Jan 27 21:49:02 2012 New Revision: 230626 URL: http://svn.freebsd.org/changeset/base/230626 Log: Some laptops have weak power controllers that cannot tolerate multiple cards powering up at once. Work around the easy case (multiple cards inserted on boot) with a short sleep and a long comment. This improves reliability on those laptops with power hungry cards. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Fri Jan 27 21:22:07 2012 (r230625) +++ head/sys/dev/pccbb/pccbb.c Fri Jan 27 21:49:02 2012 (r230626) @@ -460,6 +460,13 @@ cbb_event_thread(void *arg) int err; int not_a_card = 0; + /* + * We need to act as a power sequencer on startup. Delay 2s/channel + * to ensure the other channels have had a chance to come up. We likely + * should add a lock that's shared on a per-slot basis so that only + * one power event can happen per slot at a time. + */ + pause("cbbstart", hz * device_get_unit(sc->dev) * 2); mtx_lock(&sc->mtx); sc->flags |= CBB_KTHREAD_RUNNING; while ((sc->flags & CBB_KTHREAD_DONE) == 0) {