From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 18 10:11:56 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 32E6A106564A; Sun, 18 Dec 2011 10:11:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C855E8FC14; Sun, 18 Dec 2011 10:11:55 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so5922588vbb.13 for ; Sun, 18 Dec 2011 02:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=kF1qU4trrf85/UFdhf9Y0cwkCtZ/2CUzrF/+VRkxonk=; b=cDl3IQ8Uv0DKdeq2s2VsM0L/cLzLo+lBa9iMy0GW+7UFjHyp96b8U2wlxxrll8+9MY o/yGBFCdpOUMMCmpsIRqWH6gQMzyzhlwpx38jHm3M9Qv7vVDl9KppfjQHlKk9voMzl+O PpOEIHZdLHyat4wjJNVW/JGyV6RjEA3V25hKk= MIME-Version: 1.0 Received: by 10.52.67.111 with SMTP id m15mr9314664vdt.96.1324203115054; Sun, 18 Dec 2011 02:11:55 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.26.50 with HTTP; Sun, 18 Dec 2011 02:11:55 -0800 (PST) In-Reply-To: References: <0F6CC18F-6973-42A2-AC03-F01BF59458AE@lassitu.de> <1100F70E-9DA9-4163-AC9A-423ECE5AA9A3@lassitu.de> Date: Sun, 18 Dec 2011 02:11:55 -0800 X-Google-Sender-Auth: tcB9fISVbYyE_cUjoDW5xhr1yPk Message-ID: From: Adrian Chadd To: Stefan Bethke , Oleksandr Tymoshenko Content-Type: text/plain; charset=ISO-8859-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: Sun, 18 Dec 2011 10:11:56 -0000 On 18 December 2011 01:54, Adrian Chadd wrote: > Just as a side note - reducing the udelay value from 10 to 1 in my git > tree doesn't stop the huge CPU use. I'm going to next try removing the > locking, as I note that each GPIO access involves a mutex lock and I > bet the witness code is taking a freaking beating here. .. yup. Not compiling in witness helps hugely. I wish I had PMC working at this point - I bet lots of lock overhead would creep up. Basically, a lock is acquired for each GPIO pin set, clear and reconfigure. The gpiobus code itself doesn't do this - that's what gpiobus_lock_bus and gpiobus_unlock_bus is for - but the ar71xx gpio code however does. And so does the gpioiic code - it's locking and unlocking the bus for each scl/sda line operation. Erm, surely that's a bit ridiculous.. surely the locking doesn't need to be that fine grained _and_ multi-levelled. There has to be a better way to do this. :) Adrian