pinctrl: tegra: Flush pinctrl writes during resume
authorSowjanya Komatineni <skomatineni@nvidia.com>
Fri, 16 Aug 2019 19:41:47 +0000 (12:41 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 21 Aug 2019 07:00:16 +0000 (09:00 +0200)
This patch adds pinctrl register read to flush all the prior pinctrl
writes and then adds barrier for pinctrl register read to complete
during resume to make sure all pinctrl changes are effective.

Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Link: https://lore.kernel.org/r/1565984527-5272-3-git-send-email-skomatineni@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/tegra/pinctrl-tegra.c

index 5e3c001..e9a7cbb 100644 (file)
@@ -677,6 +677,10 @@ static int tegra_pinctrl_resume(struct device *dev)
                        writel_relaxed(*backup_regs++, regs++);
        }
 
+       /* flush all the prior writes */
+       readl_relaxed(pmx->regs[0]);
+       /* wait for pinctrl register read to complete */
+       rmb();
        return 0;
 }