Skip to content

Commit 7499bfe

Browse files
Amit Kumar Mahapatramiquelraynal
authored andcommitted
mtd: rawnand: arasan: Update NAND bus clock instead of system clock
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: 197b88f ("mtd: rawnand: arasan: Add new Arasan NAND controller") CC: stable@vger.kernel.org # 5.8+ Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220628154824.12222-2-amit.kumar-mahapatra@xilinx.com
1 parent 431eae2 commit 7499bfe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mtd/nand/raw/arasan-nand-controller.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ static int anfc_select_target(struct nand_chip *chip, int target)
347347

348348
/* Update clock frequency */
349349
if (nfc->cur_clk != anand->clk) {
350-
clk_disable_unprepare(nfc->controller_clk);
351-
ret = clk_set_rate(nfc->controller_clk, anand->clk);
350+
clk_disable_unprepare(nfc->bus_clk);
351+
ret = clk_set_rate(nfc->bus_clk, anand->clk);
352352
if (ret) {
353353
dev_err(nfc->dev, "Failed to change clock rate\n");
354354
return ret;
355355
}
356356

357-
ret = clk_prepare_enable(nfc->controller_clk);
357+
ret = clk_prepare_enable(nfc->bus_clk);
358358
if (ret) {
359359
dev_err(nfc->dev,
360-
"Failed to re-enable the controller clock\n");
360+
"Failed to re-enable the bus clock\n");
361361
return ret;
362362
}
363363

0 commit comments

Comments
 (0)