crypto: ccree - pm resume first enable the source clk
authorOfir Drang <ofir.drang@arm.com>
Thu, 18 Apr 2019 13:39:06 +0000 (16:39 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 25 Apr 2019 07:38:16 +0000 (15:38 +0800)
On power management resume function first enable the device clk source
to allow access to the device registers.

Signed-off-by: Ofir Drang <ofir.drang@arm.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_pm.c

index 6f278a0d8ee6a2252beb933f2cb1ea955768e050..9a5abe40699690f18541b64efcebb0c586fb2454 100644 (file)
@@ -42,14 +42,15 @@ int cc_pm_resume(struct device *dev)
        struct cc_drvdata *drvdata = dev_get_drvdata(dev);
 
        dev_dbg(dev, "unset HOST_POWER_DOWN_EN\n");
-       cc_iowrite(drvdata, CC_REG(HOST_POWER_DOWN_EN), POWER_DOWN_DISABLE);
-
+       /* Enables the device source clk */
        rc = cc_clk_on(drvdata);
        if (rc) {
                dev_err(dev, "failed getting clock back on. We're toast.\n");
                return rc;
        }
 
+       cc_iowrite(drvdata, CC_REG(HOST_POWER_DOWN_EN), POWER_DOWN_DISABLE);
+
        rc = init_cc_regs(drvdata, false);
        if (rc) {
                dev_err(dev, "init_cc_regs (%x)\n", rc);