All of lore.kernel.org
 help / color / mirror / Atom feed
* Usage of get_random_bytes() in i2c-cp2615
@ 2021-04-12 11:56 Bence Csókás
  0 siblings, 0 replies; only message in thread
From: Bence Csókás @ 2021-04-12 11:56 UTC (permalink / raw)
  To: linux-i2c, linux-kernel

Normally, `cp2615_i2c_transfer.tag` is a random number that identifies
a given request-reply pair (the chip sends its response with the same
tag it got in the request). Currently, for the sake of ease, my driver
sends its requests with a fixed tag of 0xDD for all requests. This
defeats the purpose of the tag system. Should I use
`get_random_bytes()` instead? My concerns are that generating a random
value for each I2C transfer may lead to the entropy pool being used
up, especially since - if I understand correctly -
`get_random_bytes()` always generates 32 bit random words and discards
any extra bytes if `length%4 != 0`, and I only need 1 byte each time.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-12 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 11:56 Usage of get_random_bytes() in i2c-cp2615 Bence Csókás

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.