linux-stable/drivers/char
Jason A. Donenfeld 37030f4c6e hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax()
[ Upstream commit 96cb9d0554 ]

Rather than busy looping, yield back to the scheduler and sleep for a
bit in the event that there's no data. This should hopefully prevent the
stalls that Mark reported:

<6>[    3.362859] Freeing initrd memory: 16196K
<3>[   23.160131] rcu: INFO: rcu_sched self-detected stall on CPU
<3>[   23.166057] rcu:  0-....: (2099 ticks this GP) idle=03b4/1/0x40000002 softirq=28/28 fqs=1050
<4>[   23.174895]       (t=2101 jiffies g=-1147 q=2353 ncpus=4)
<4>[   23.180203] CPU: 0 PID: 49 Comm: hwrng Not tainted 6.0.0 #1
<4>[   23.186125] Hardware name: BCM2835
<4>[   23.189837] PC is at bcm2835_rng_read+0x30/0x6c
<4>[   23.194709] LR is at hwrng_fillfn+0x71/0xf4
<4>[   23.199218] pc : [<c07ccdc8>]    lr : [<c07cb841>]    psr: 40000033
<4>[   23.205840] sp : f093df70  ip : 00000000  fp : 00000000
<4>[   23.211404] r10: c3c7e800  r9 : 00000000  r8 : c17e6b20
<4>[   23.216968] r7 : c17e6b64  r6 : c18b0a74  r5 : c07ccd99  r4 : c3f171c0
<4>[   23.223855] r3 : 000fffff  r2 : 00000040  r1 : c3c7e800  r0 : c3f171c0
<4>[   23.230743] Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none
<4>[   23.238426] Control: 50c5387d  Table: 0020406a  DAC: 00000051
<4>[   23.244519] CPU: 0 PID: 49 Comm: hwrng Not tainted 6.0.0 #1

Link: https://lore.kernel.org/all/Y0QJLauamRnCDUef@sirena.org.uk/
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:17:24 +01:00
..
agp IOMMU Updates for Linux v5.20/v6.0: 2022-08-06 10:42:38 -07:00
hw_random hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() 2022-11-10 18:17:24 +01:00
ipmi ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe 2022-05-12 10:00:04 -05:00
mwave char/mwave: Adjust io port register size 2021-12-03 14:27:06 +01:00
pcmcia Char / Misc / Other smaller driver subsystem updates for 5.19-rc1 2022-06-03 11:36:34 -07:00
tpm tpm: Add check for Failure mode for TPM2 modules 2022-08-03 23:56:20 +03:00
xilinx_hwicap xilinx_hwicap: cleanup comments 2022-02-25 12:08:57 +01:00
xillybus char: xillybus: fix a refcount leak in cleanup_dev() 2022-04-24 17:30:45 +02:00
Kconfig Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
Makefile char: remove VR41XX related char driver 2022-07-28 16:12:33 +02:00
adi.c
apm-emulation.c apm-emulation: drop unexpected word "the" in the comments 2022-06-27 16:15:27 +02:00
applicom.c applicom: unneed to initialise statics to 0 2021-12-21 10:14:08 +01:00
applicom.h
bsr.c powerpc/BSR: Make use of the helper macro LIST_HEAD() 2022-02-25 12:10:15 +01:00
ds1620.c
dsp56k.c
dtlk.c
hangcheck-timer.c
hpet.c hpet: remove unused writeq/readq function definitions 2022-02-04 16:45:39 +01:00
lp.c char: lp: remove redundant initialization of err 2022-06-10 15:29:50 +02:00
mem.c random: restore O_NONBLOCK support 2022-10-15 08:02:55 +02:00
misc.c char: misc: remove usage of list iterator past the loop body 2022-04-24 17:15:12 +02:00
mspec.c char: mspec: Use kvzalloc() in mspec_mmap() 2020-08-28 12:10:04 +02:00
nsc_gpio.c
nvram.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c powerpc/powernv: Fix fall-through warning for Clang 2021-07-13 19:21:41 -05:00
ppdev.c
ps3flash.c powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
random.c random: use arch_get_random*_early() in random_init() 2022-11-04 00:00:22 +09:00
scx200_gpio.c
sonypi.c
tlclk.c
toshiba.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
ttyprintk.c char: ttyprintk: register console 2022-04-22 16:24:47 +02:00
uv_mmtimer.c
virtio_console.c Char/Misc and other driver updates for 5.18-rc1 2022-03-28 12:27:35 -07:00