提交 6d268d77 编写于 作者: A Amit Kumar Mahapatra 提交者: Zheng Zengkai

mtd: rawnand: arasan: Update NAND bus clock instead of system clock

stable inclusion
from stable-v5.10.137
commit fb7eea3946d390e246fcb2f8e3b6f17bac4e8118
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fb7eea3946d390e246fcb2f8e3b6f17bac4e8118

--------------------------------

commit 7499bfee upstream.

In current implementation the Arasan NAND driver is updating the
system clock(i.e., anand->clk) in accordance to the timing modes
(i.e., SDR or NVDDR). But as per the Arasan NAND controller spec the
flash clock or the NAND bus clock(i.e., nfc->bus_clk), need to be
updated instead. This patch keeps the system clock unchanged and updates
the NAND bus clock as per the timing modes.

Fixes: 197b88fe ("mtd: rawnand: arasan: Add new Arasan NAND controller")
CC: stable@vger.kernel.org # 5.8+
Signed-off-by: NAmit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220628154824.12222-2-amit.kumar-mahapatra@xilinx.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 ed063418
...@@ -283,17 +283,17 @@ static int anfc_select_target(struct nand_chip *chip, int target) ...@@ -283,17 +283,17 @@ static int anfc_select_target(struct nand_chip *chip, int target)
/* Update clock frequency */ /* Update clock frequency */
if (nfc->cur_clk != anand->clk) { if (nfc->cur_clk != anand->clk) {
clk_disable_unprepare(nfc->controller_clk); clk_disable_unprepare(nfc->bus_clk);
ret = clk_set_rate(nfc->controller_clk, anand->clk); ret = clk_set_rate(nfc->bus_clk, anand->clk);
if (ret) { if (ret) {
dev_err(nfc->dev, "Failed to change clock rate\n"); dev_err(nfc->dev, "Failed to change clock rate\n");
return ret; return ret;
} }
ret = clk_prepare_enable(nfc->controller_clk); ret = clk_prepare_enable(nfc->bus_clk);
if (ret) { if (ret) {
dev_err(nfc->dev, dev_err(nfc->dev,
"Failed to re-enable the controller clock\n"); "Failed to re-enable the bus clock\n");
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册