Le 13/09/2016 11:48, Herbert Xu a écrit :
On Wed, Sep 07, 2016 at 05:57:38PM +0200, Romain Perier wrote:
+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?


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...

Romain Perier, Free Electrons
Embedded Linux, Kernel and Android engineering
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to