• Thomas Petazzoni's avatar
    hwrng: omap - write registers after enabling the clock · 45c2fdde
    Thomas Petazzoni authored
    Commit 38321242 ("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: 38321242
    
     ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    45c2fdde
omap-rng.c 13.7 KB