From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 29 16:56:33 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281FE1065670; Thu, 29 Dec 2011 16:56:33 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id CA60D8FC13; Thu, 29 Dec 2011 16:56:32 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id A77531113BD; Thu, 29 Dec 2011 16:56:31 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Stefan Bethke In-Reply-To: Date: Thu, 29 Dec 2011 17:56:31 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7A8E7854-4696-44B9-B0BE-3D6640BA0A49@lassitu.de> References: <0F6CC18F-6973-42A2-AC03-F01BF59458AE@lassitu.de> <1100F70E-9DA9-4163-AC9A-423ECE5AA9A3@lassitu.de> <18CABB46-9B9A-41CB-8742-6723C5FF4D67@lassitu.de> <2CBD8651-E132-49DC-A082-37A8F5C626EA@bsdimp.com> <267FB3D6-830E-4A2F-8C1C-A96873EDCD31@lassitu.de> <12538AED-175C-4B1E-BF05-6FD05D14CE70@lassitu.de> <2135AD2B-76D4-4B3D-A009-8F3BEC836051@lassitu.de> <2BB71545-7DE9-493D-92FE-AD4CEDCBF2D1@lassitu.de> To: Adrian Chadd X-Mailer: Apple Mail (2.1251.1) Cc: "freebsd-embedded@freebsd.org" Subject: Re: Updated switch/glue patch? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2011 16:56:33 -0000 Am 29.12.2011 um 11:18 schrieb Stefan Bethke: > http://gitorious.org/~stb/freebsd/stb-adrianchadd-freebsd-work (branch = work/ath) > http://www.lassitu.de/freebsd/etherswitch-adrian.patch (patch against = Adrians gitorious repo as of now) > http://www.lassitu.de/freebsd/etherswitch.tbz (all files) I've updated the patch: Improve locking. There is now one lock for the softc. SMI bus access is serialized = through a softc field protected by sc_mtx. All bus access functions can be called with RTL_NOWAIT, making them punt immediately if the bus was already acquired. This allows the callout to try and read all three port status registers, or just abort and wait for the next round. For bus access through the control device, the functions are called with RTL_WAITOK, which will make them sleep until the bus becomes available (through the standard mtx_lock()). With this version, I get no WITNESS warnings, nor panics from the = callout. The retries for I2C select and PHY register access always succeed (100k+ test accesses in a tight loop). Stefan --=20 Stefan Bethke Fon +49 151 14070811