From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 20 03:53:53 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 19F781065676; Tue, 20 Dec 2011 03:53:53 +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 AAE078FC0C; Tue, 20 Dec 2011 03:53:52 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so7892655vbb.13 for ; Mon, 19 Dec 2011 19:53:52 -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=qIX5h4guBPOCBGL641U2/6me1tOsfDZyh8fzYNAcqnY=; b=LhHC/uXw89HYCsubjG1FMLzXTnhPZu+flfEnvAj/pXNXayMbvbEts0AtmcE62/hv1K sEBiBQVc6VXkSYxQ40aY7SRxQf3l87oFCindowQ9/N0aJ+g++R5hm0Pty36fxzQqZ45K tzzN5UwDzHgH+/eDUzg4tbP957HY/ShHUKQQY= MIME-Version: 1.0 Received: by 10.52.114.232 with SMTP id jj8mr168413vdb.94.1324353232002; Mon, 19 Dec 2011 19:53:52 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.158.104 with HTTP; Mon, 19 Dec 2011 19:53:51 -0800 (PST) In-Reply-To: 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> Date: Mon, 19 Dec 2011 19:53:51 -0800 X-Google-Sender-Auth: UlTlye0IkZe43S6P-KMfhbQBjlk Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: Oleksandr Tymoshenko , Stefan Bethke , "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: Tue, 20 Dec 2011 03:53:53 -0000 Hi, I've just dumped some more locking fixes into -HEAD. I've also changed iicbb.c a little so it has a configurable udelay. Sorry Stefan, you're going to have to rebase your iicbb changes. :) With the default per-bit sleep of 10uS, a rough calculation is: * 3 sleeps per bit: 30uS per bit * 8 bits per byte * 1 bit for ACK * == 12 bits per byte: 360uS a byte Each transaction is what, 5 bytes or 6 btyes total? I'll say 6 bytes, to be conservative. That's 2.1ms a transaction. Say thirty register accesses a second (for 5 switch PHY ports) - 63mS. I still think that's a bit low. But that's minimum 63mS of DELAY(), each second. Nothing else occurs during that. I've dropped the udelay parameter from 10 to 2 and had things work successfully. It still wastes a significant fraction of 100mS of CPU time each second. Sorry, but there has to be a better way to do this. Is it possible to just only poll a minimal set of PHY registers each second, rather than polling them all? Adrian