Patch "mtd: rawnand: mtk: Fix WAITRDY break condition and timeout" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mtd: rawnand: mtk: Fix WAITRDY break condition and timeout

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mtd-rawnand-mtk-fix-waitrdy-break-condition-and-time.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 779e097fee552c9b937a94aa86226aa2ce75844a
Author: Hauke Mehrtens <hauke@xxxxxxxxxx>
Date:   Tue Mar 9 01:01:07 2021 +0100

    mtd: rawnand: mtk: Fix WAITRDY break condition and timeout
    
    [ Upstream commit 2fb164f0ce95e504e2688b4f984893c29ebd19ab ]
    
    This fixes NAND_OP_WAITRDY_INSTR operation in the driver. Without this
    change the driver waits till the system is busy, but we should wait till
    the busy flag is cleared. The readl_poll_timeout() function gets a break
    condition, not a wait condition.
    
    In addition fix the timeout. The timeout_ms is given in ms, but the
    readl_poll_timeout() function takes the timeout in us. Multiple the
    given timeout by 1000 to convert it.
    
    Without this change, the driver does not work at all, it doesn't even
    identify the NAND chip.
    
    Fixes: 5197360f9e09 ("mtd: rawnand: mtk: Convert the driver to exec_op()")
    Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
    Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
    Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Link: https://lore.kernel.org/linux-mtd/20210309000107.1368404-1-hauke@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
index 57f1f1708994..5c5c92132287 100644
--- a/drivers/mtd/nand/raw/mtk_nand.c
+++ b/drivers/mtd/nand/raw/mtk_nand.c
@@ -488,8 +488,8 @@ static int mtk_nfc_exec_instr(struct nand_chip *chip,
 		return 0;
 	case NAND_OP_WAITRDY_INSTR:
 		return readl_poll_timeout(nfc->regs + NFI_STA, status,
-					  status & STA_BUSY, 20,
-					  instr->ctx.waitrdy.timeout_ms);
+					  !(status & STA_BUSY), 20,
+					  instr->ctx.waitrdy.timeout_ms * 1000);
 	default:
 		break;
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux