Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbbB1Tcu (ORCPT ); Sat, 28 Feb 2015 14:32:50 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:51504 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbbB1Tcq (ORCPT ); Sat, 28 Feb 2015 14:32:46 -0500 From: Arnd Bergmann To: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Matt Mackall , Herbert Xu , Grant Likely , Ray Jui , Jonathan Richardson , Dmitry Torokhov , Anatol Pomazao , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver Date: Sat, 28 Feb 2015 20:31:27 +0100 Message-ID: <2555599.AxGoQ20pkj@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <54F1E647.10106@broadcom.com> References: <1424888184-22180-3-git-send-email-sbranden@broadcom.com> <2093191.gujNGSl66k@wuerfel> <54F1E647.10106@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:4PzQV0CHhTy0RwSmt8NkzcFwTSfgl6/8z3+COn6moH01oHxn/3z J2JBLcVlj+6xW/bktRMOMui0SC/ovG1FKCHktWMIvXquQemv/Xpi+oPp1qKJW607Q81a9AJ 1Dml6XhO2XswYB0/j5QEFgK3ElxHCW2OlhsH8mExx305HfOUeX90eiob4CvQdqsXLw/Evtv spQmdkK2JBvFpR2+ZJ7Bw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 20 On Saturday 28 February 2015 08:01:11 Scott Branden wrote: > > The udelay(10) that the other drivers have seems about appropriate then, > > and we can independently think of a way to refine the interface. > > Please add a comment that explains the rate. Also, is there some kind > > of FIFO present in the hwrng device? If it can store close to 1ms work > > of data (1000 bits), you can just use an msleep(1) to wait for the > > pool to recover. > FIFO is 512 bits. I will look as to whether we can live with 1/2 > throughput. In that case, I think usleep_range(min(len * 8, 500), 500)) would be a good compromise: it waits at most until the fifo is full, but might return earlier if enough bits are available to fulfill the request. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/