On Wed, 12 Jun 2024, Marek BehĂșn wrote: > The 4096 bytes limit in mox_hwrng_read() is due to the DMA buffer being > allocated to one PAGE_SIZE bytes. The PAGE_SIZE macro is used when > allocating the buffer, use it in mox_hwrng_read() as well. > > Signed-off-by: Marek BehĂșn > --- > drivers/firmware/turris-mox-rwtm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c > index 3f4758e03c81..5acdde1bb6d9 100644 > --- a/drivers/firmware/turris-mox-rwtm.c > +++ b/drivers/firmware/turris-mox-rwtm.c > @@ -287,8 +287,8 @@ static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait) > struct armada_37xx_rwtm_tx_msg msg; > int ret; > > - if (max > 4096) > - max = 4096; > + if (max > PAGE_SIZE) > + max = PAGE_SIZE; Wouldn't it be better to bind these to the alloc side with a local define that is set to PAGE_SIZE? -- i.