Skip to content
  • Rick Altherr's avatar
    hwrng: timeriomem - Improve performance for sub-jiffie update periods · ca3bff70
    Rick Altherr authored
    
    
    Some hardware RNGs provide a single register for obtaining random data.
    Instead of signaling when new data is available, the reader must wait a
    fixed amount of time between reads for new data to be generated.
    timeriomem_rng implements this scheme with the period specified in
    platform data or device tree.  While the period is specified in
    microseconds, the implementation used a standard timer which has a
    minimum delay of 1 jiffie and caused a significant bottleneck for
    devices that can update at 1us.  By switching to an hrtimer, 1us periods
    now only delay at most 2us per read.
    
    Signed-off-by: default avatarRick Altherr <raltherr@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    ca3bff70