Re: [PATCH v2 3/8] hwrng: omap - Switch to non-obsolete read API implementation
From: Romain Perier <hidden>
Date: 2016-09-16 10:11:39
Hi, Le 13/09/2016 11:48, Herbert Xu a écrit :
On Wed, Sep 07, 2016 at 05:57:38PM +0200, Romain Perier wrote:quoted
+ +static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max, + bool wait) { struct omap_rng_dev *priv; - int data, i; priv = (struct omap_rng_dev *)rng->priv; - for (i = 0; i < 20; i++) { - data = priv->pdata->data_present(priv); - if (data || !wait) - break; - /* RNG produces data fast enough (2+ MBit/sec, even - * during "rngtest" loads, that these delays don't - * seem to trigger. We *could* use the RNG IRQ, but - * that'd be higher overhead ... so why bother? - */ - udelay(10);So in the wait case you're changing the driver's behaviour. Instead of waiting for 1us you'll now wait for 1s if there is no data. Is this what really what you want? Cheers,
Mhhh, you're right, in this specific case it will add more latency... with busy loop, on average, 20 retries will be enough to have data... Thanks! -- Romain Perier, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com