From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755334AbbCBTlx (ORCPT ); Mon, 2 Mar 2015 14:41:53 -0500 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:43618 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbbCBTlv (ORCPT ); Mon, 2 Mar 2015 14:41:51 -0500 X-IronPort-AV: E=Sophos;i="5.09,677,1418112000"; d="scan'208";a="58367165" Message-ID: <54F4BCD1.2020401@broadcom.com> Date: Mon, 2 Mar 2015 11:41:05 -0800 From: Scott Branden User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Arnd Bergmann CC: , Rob Herring , Pawel Moll , Mark Rutland , "Ian Campbell" , Kumar Gala , Matt Mackall , Herbert Xu , Grant Likely , Ray Jui , Jonathan Richardson , Dmitry Torokhov , Anatol Pomazao , , , Subject: Re: [PATCH v2 2/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver References: <1424888184-22180-3-git-send-email-sbranden@broadcom.com> <2093191.gujNGSl66k@wuerfel> <54F1E647.10106@broadcom.com> <2555599.AxGoQ20pkj@wuerfel> In-Reply-To: <2555599.AxGoQ20pkj@wuerfel> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Thanks for the suggested change. On 15-02-28 11:31 AM, Arnd Bergmann wrote: > 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. OK, will change in next version. > > Arnd >