From owner-svn-src-head@freebsd.org Sun Apr 10 04:52:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F016FB01EB2 for ; Sun, 10 Apr 2016 04:52:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F5D1E08 for ; Sun, 10 Apr 2016 04:52:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E266FB94A; Sun, 10 Apr 2016 00:52:03 -0400 (EDT) From: John Baldwin To: Steven Hartland Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r297762 - head/sys/dev/ichiic Date: Sat, 09 Apr 2016 14:00:42 -0700 Message-ID: <1865392.rtXenzib4K@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <57096645.5060105@multiplay.co.uk> References: <201604092018.u39KIYf3096159@repo.freebsd.org> <57096645.5060105@multiplay.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 10 Apr 2016 00:52:04 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 04:52:05 -0000 On Saturday, April 09, 2016 09:29:57 PM Steven Hartland wrote: > Hi John, it would be nice if the commit message clarified why the change > was made, as well as what was changed. This would allow others like > myself to learn about the reasons for changes like this, which aren't > self explanatory. Sleeping with a timeout doesn't (currently) work during the initial device time probe. All sleep requests used to just return immediately without any delay. I recently changed it so that infinite sleeps (no timeout) now work in preparation for ongoing work to start APs earlier during the boot. However, we still can't manage timeouts until we have timers and interrupts from timers, so sleeps with timeouts will now panic (instead of just returning instantly which the code here probably did not expect). The assertion highlighted that this driver was using a tight spin loop during boot-time attach instead of polling the device periodically (as the author probably thought they were doing). > On 09/04/2016 21:18, John Baldwin wrote: > > Author: jhb > > Date: Sat Apr 9 20:18:34 2016 > > New Revision: 297762 > > URL: https://svnweb.freebsd.org/changeset/base/297762 > > > > Log: > > Use DELAY() instead of sleeping during boot-time attach. > > > > Tested by: Wolfgang Zenker > > > > Modified: > > head/sys/dev/ichiic/ig4_iic.c > > > > Modified: head/sys/dev/ichiic/ig4_iic.c > > ============================================================================== > > --- head/sys/dev/ichiic/ig4_iic.c Sat Apr 9 20:05:39 2016 (r297761) > > +++ head/sys/dev/ichiic/ig4_iic.c Sat Apr 9 20:18:34 2016 (r297762) > > @@ -117,7 +117,10 @@ set_controller(ig4iic_softc_t *sc, uint3 > > error = 0; > > break; > > } > > - mtx_sleep(sc, &sc->io_lock, 0, "i2cslv", 1); > > + if (cold) > > + DELAY(1000); > > + else > > + mtx_sleep(sc, &sc->io_lock, 0, "i2cslv", 1); > > } > > return (error); > > } > > > -- John Baldwin