From 9e259c937528ce98f910d256c2f2fddea258a694 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Fri, 21 Aug 2020 16:35:16 +0800 Subject: [PATCH] MLK-24529 nvmem: ocotp: use high bus when programming/reloading fuse There might be chance that after we calculate timing based on the ipg_clk, but ipg_clk was changed by busfreq which cause fuse prog and shadow reload not work stable. So let request high bus to let the ipg clk fixed during the stage programming and reloading. Reviewed-by: Jacky Bai Signed-off-by: Peng Fan --- drivers/nvmem/imx-ocotp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index e6b9ace7bb73..62be4d67ac38 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -14,6 +14,7 @@ * Copyright (C) 2010-2013 Freescale Semiconductor, Inc */ +#include #include #include #include @@ -319,6 +320,8 @@ static int imx_ocotp_write(void *context, unsigned int offset, void *val, return ret; } + request_bus_freq(BUS_FREQ_HIGH); + /* Setup the write timing values */ priv->params->set_timing(priv); @@ -458,6 +461,8 @@ static int imx_ocotp_write(void *context, unsigned int offset, void *val, } write_end: + release_bus_freq(BUS_FREQ_HIGH); + clk_disable_unprepare(priv->clk); mutex_unlock(&ocotp_mutex); if (ret < 0)