Thread (42 messages) 42 messages, 5 authors, 2017-12-22

[PATCH v3 0/4] Assorted changes for Exynos PRNG driver

flat view
STALE3236d PENDING · 2 of 4 reviewed

From: Łukasz Stelmach <l.stelmach@samsung.com>
Date: 2017-12-12 16:36:18
Also in: linux-samsung-soc, lkml
Subsystem: crypto api, open firmware and flattened device tree bindings, the rest · Maintainers: Herbert Xu, "David S. Miller", Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Torvalds

Status: Pending, 2 of 4 reviewed.

Revision v3 (3 revisions archived).

Revisions (3)
  1. v1
  2. v2 [diff against previous]
  3. v3 current [diff against previous]
Hello,

This is a series of patches for exynos-rng driver I've decided to
create after adding support for Exynos5250+ chips. They do not
strictly depend on each other, but I think it is better to send them
as a single patch-set.

The driver requires appropriate DT configuration introduced in

    https://patchwork.kernel.org/patch/10106797/

Patch #1 Add support for PRNG in Exynos5250+ SoCs

Patch #2 Improve output performance by using memcpy() rather than a
custom function to retrieve random bytes from registers. Rearrange
the loop for polling the hardware.

Patch #3 Reseed the PRNG after reading 2^16 bytes. Simmilar approach
is implemented in DRBG. (Thanks Stephan Mueller)

Patch #4 Introduce locking to prevent simultaneous access to the
hardware from more than one thread/process.

Changes since v2:

- Remove changes in the loop polling the status register in
  exynos_rng_get_random(). Thanks Krzysztof Kozłowski.
- Remove the check for valid values of rng->type from
  exynos_rng_probe(). The function wouldn't be called with values other
  than mentioned in exynos_rng_dt_match array.
- Applied changes to the commit message of patch #3 requested by Stephan
  Mueller.

Changes since v1:

- Added Patch #4.
- Extended commit message for patch #3.
- Changed exynos_prng_type enum and a define according to Krzysztof Kozłowski's
  recommendations.
- Brought back cpu_relax() in a rearranged loop in
  exynos_rng_get_random().
- Moved an assignment of the read valuea away from an error path.
- Removed dev_info() reporting hardware presence from
  exynos_rng_probe().

Łukasz Stelmach (4):
  crypto: exynos - Support Exynos5250+ SoCs
  crypto: exynos - Improve performance of PRNG
  crypto: exynos - Reseed PRNG after generating 2^16 random bytes
  crypto: exynos - Introduce mutex to prevent concurrent access to
    hardware

 .../bindings/crypto/samsung,exynos-rng4.txt        |  4 +-
 drivers/crypto/exynos-rng.c                        | 94 ++++++++++++++--------
 2 files changed, 62 insertions(+), 36 deletions(-)

-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help