[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CACCVKEHwBnP+Q0XtHNJLkWfHN_HG4FYWt8MPW-Qt1SwqihKHng@mail.gmail.com>
Date: Mon, 12 Apr 2021 13:56:42 +0200
From: Bence Csókás <bence98@....bme.hu>
To: <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Usage of get_random_bytes() in i2c-cp2615
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.
Powered by blists - more mailing lists