Re: [PATCH v3] ath9k: use hw_random API instead of directly dumping into random.c
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: 2022-02-22 10:14:01
Also in:
linux-crypto, linux-wireless, lkml
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: 2022-02-22 10:14:01
Also in:
linux-crypto, linux-wireless, lkml
On 2/22/22, Ard Biesheuvel [off-list ref] wrote:
On Mon, 21 Feb 2022 at 11:57, Kalle Valo [off-list ref] wrote:quoted
"Jason A. Donenfeld" [off-list ref] wrote:quoted
Hardware random number generators are supposed to use the hw_random framework. This commit turns ath9k's kthread-based design into a proper hw_random driver. Cc: Toke Høiland-Jørgensen <redacted> Cc: Kalle Valo <kvalo@kernel.org> Cc: Rui Salvaterra <redacted> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Tested-by: Rui Salvaterra <redacted> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Signed-off-by: Kalle Valo <redacted>Patch applied to ath-next branch of ath.git, thanks. fcd09c90c3c5 ath9k: use hw_random API instead of directly dumping into random.cWith this patch, it seems we end up registering the hw_rng every time the link goes up, and unregister it again when the link goes down, right? Wouldn't it be better to split off this driver from the 802.11 link state handling?
I really have no idea how this thing works, and I tried hard to change as little as possible in converting it to the API. You may want to send some follow-up patches if you have hardware to experiment with. One consideration does leap out, which is that in my experience wifi cards use a lot less power when they're set "down", as though a decent amount of hardware is being switched off. I think this ath9k rng call might be using the ADC to gather samples of ether from somewhere. I imagine this gets shutdown too as part of that dame circuitry.