]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
hwrng: omap - write registers after enabling the clock
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 7 Mar 2017 14:14:46 +0000 (15:14 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:17:54 +0000 (14:17 -0600)
commit9c0865c377d87868edec2afd2e60264d82a578ed
tree46c6837db6ea6c62a2a71317504bcc3c65979d5b
parentfeb6104d481963650f03186d6e429f0905fdb9d8
hwrng: omap - write registers after enabling the clock

BugLink: http://bugs.launchpad.net/bugs/1676429
commit 45c2fdde01299b02a6e3225e848598a3c1e55539 upstream.

Commit 383212425c926 ("hwrng: omap - Add device variant for SafeXcel
IP-76 found in Armada 8K") added support for the SafeXcel IP-76 variant
of the IP. This modification included getting a reference and enabling a
clock. Unfortunately, this was done *after* writing to the
RNG_INTMASK_REG register. This generally works fine when the driver is
built-in because the clock might have been left enabled by the
bootloader, but fails short when the driver is built as a module: it
causes a system hang because a register is being accessed while the
clock is not enabled.

This commit fixes that by making the register access *after* enabling
the clock.

This issue was found by the kernelci.org testing effort.

Fixes: 383212425c926 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/char/hw_random/omap-rng.c