* [PATCH] mtd: rawnand: hynix: fixed typo
@ 2024-03-13 10:27 Maxim Korotkov
2024-03-15 11:23 ` Miquel Raynal
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Maxim Korotkov @ 2024-03-13 10:27 UTC (permalink / raw)
To: Boris Brezillon
Cc: Maxim Korotkov, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Hector Palacios, linux-mtd, linux-kernel,
lvc-project
The function hynix_nand_rr_init() should probably return an error code.
Judging by the usage, it seems that the return code is passed up
the call stack.
Right now, it always returns 0 and the function hynix_nand_cleanup()
in hynix_nand_init() has never been called.
Found by RASU JSC and Linux Verification Center (linuxtesting.org)
Fixes: 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
---
drivers/mtd/nand/raw/nand_hynix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c
index 39076735a3fb..9695f07b5eb2 100644
--- a/drivers/mtd/nand/raw/nand_hynix.c
+++ b/drivers/mtd/nand/raw/nand_hynix.c
@@ -402,7 +402,7 @@ static int hynix_nand_rr_init(struct nand_chip *chip)
if (ret)
pr_warn("failed to initialize read-retry infrastructure");
- return 0;
+ return ret;
}
static void hynix_nand_extract_oobsize(struct nand_chip *chip,
--
2.34.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-13 10:27 [PATCH] mtd: rawnand: hynix: fixed typo Maxim Korotkov
@ 2024-03-15 11:23 ` Miquel Raynal
2024-03-15 11:45 ` Maxim Korotkov
2024-03-25 10:18 ` Miquel Raynal
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2024-03-15 11:23 UTC (permalink / raw)
To: Maxim Korotkov
Cc: Boris Brezillon, Richard Weinberger, Vignesh Raghavendra,
Hector Palacios, linux-mtd, linux-kernel, lvc-project
Hi Maxim,
korotkov.maxim.s@gmail.com wrote on Wed, 13 Mar 2024 13:27:20 +0300:
> The function hynix_nand_rr_init() should probably return an error code.
> Judging by the usage, it seems that the return code is passed up
> the call stack.
> Right now, it always returns 0 and the function hynix_nand_cleanup()
> in hynix_nand_init() has never been called.
Isn't it done like that on purpose? Read-retry is not a mandatory
feature.
> Found by RASU JSC and Linux Verification Center (linuxtesting.org)
>
> Fixes: 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
>
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
> ---
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-15 11:23 ` Miquel Raynal
@ 2024-03-15 11:45 ` Maxim Korotkov
2024-03-15 12:14 ` Miquel Raynal
0 siblings, 1 reply; 7+ messages in thread
From: Maxim Korotkov @ 2024-03-15 11:45 UTC (permalink / raw)
To: Miquel Raynal
Cc: Boris Brezillon, Richard Weinberger, Vignesh Raghavendra,
Hector Palacios, linux-mtd, linux-kernel, lvc-project
Hi,
On 15.03.2024 14:23, Miquel Raynal wrote:
> Isn't it done like that on purpose? Read-retry is not a mandatory
> feature.
Works it as designed? I'm not sure about it.
I wouldn't rule it out, but it's a little weird that the
hynix_nand_rr_init() function
is used as if it can return an error but never returns.
Probably checking of value returned from hynix_nand_rr_init()
should be removed in hynix_nand_init()
Best regards, Max
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-15 11:45 ` Maxim Korotkov
@ 2024-03-15 12:14 ` Miquel Raynal
0 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2024-03-15 12:14 UTC (permalink / raw)
To: Maxim Korotkov
Cc: Boris Brezillon, Richard Weinberger, Vignesh Raghavendra,
Hector Palacios, linux-mtd, linux-kernel, lvc-project
Hi Maxim,
korotkov.maxim.s@gmail.com wrote on Fri, 15 Mar 2024 14:45:47 +0300:
> Hi,
>
> On 15.03.2024 14:23, Miquel Raynal wrote:
> > Isn't it done like that on purpose? Read-retry is not a mandatory
> > feature.
>
> Works it as designed? I'm not sure about it.
> I wouldn't rule it out, but it's a little weird that the hynix_nand_rr_init() function
> is used as if it can return an error but never returns.
>
> Probably checking of value returned from hynix_nand_rr_init()
> should be removed in hynix_nand_init()
It is indeed confusing. I'll take it.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-13 10:27 [PATCH] mtd: rawnand: hynix: fixed typo Maxim Korotkov
2024-03-15 11:23 ` Miquel Raynal
@ 2024-03-25 10:18 ` Miquel Raynal
2024-03-25 10:20 ` Miquel Raynal
2024-03-25 15:41 ` Andy Shevchenko
3 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2024-03-25 10:18 UTC (permalink / raw)
To: Maxim Korotkov, Boris Brezillon
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Hector Palacios, linux-mtd, linux-kernel, lvc-project
On Wed, 2024-03-13 at 10:27:20 UTC, Maxim Korotkov wrote:
> The function hynix_nand_rr_init() should probably return an error code.
> Judging by the usage, it seems that the return code is passed up
> the call stack.
> Right now, it always returns 0 and the function hynix_nand_cleanup()
> in hynix_nand_init() has never been called.
>
> Found by RASU JSC and Linux Verification Center (linuxtesting.org)
>
> Fixes: 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
>
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-13 10:27 [PATCH] mtd: rawnand: hynix: fixed typo Maxim Korotkov
2024-03-15 11:23 ` Miquel Raynal
2024-03-25 10:18 ` Miquel Raynal
@ 2024-03-25 10:20 ` Miquel Raynal
2024-03-25 15:41 ` Andy Shevchenko
3 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2024-03-25 10:20 UTC (permalink / raw)
To: Maxim Korotkov, Boris Brezillon
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Hector Palacios, linux-mtd, linux-kernel, lvc-project
On Wed, 2024-03-13 at 10:27:20 UTC, Maxim Korotkov wrote:
> The function hynix_nand_rr_init() should probably return an error code.
> Judging by the usage, it seems that the return code is passed up
> the call stack.
> Right now, it always returns 0 and the function hynix_nand_cleanup()
> in hynix_nand_init() has never been called.
>
> Found by RASU JSC and Linux Verification Center (linuxtesting.org)
>
> Fixes: 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
>
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: hynix: fixed typo
2024-03-13 10:27 [PATCH] mtd: rawnand: hynix: fixed typo Maxim Korotkov
` (2 preceding siblings ...)
2024-03-25 10:20 ` Miquel Raynal
@ 2024-03-25 15:41 ` Andy Shevchenko
3 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2024-03-25 15:41 UTC (permalink / raw)
To: Maxim Korotkov
Cc: Boris Brezillon, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Hector Palacios, linux-mtd, linux-kernel,
lvc-project
On Wed, Mar 13, 2024 at 01:27:20PM +0300, Maxim Korotkov wrote:
> The function hynix_nand_rr_init() should probably return an error code.
> Judging by the usage, it seems that the return code is passed up
> the call stack.
> Right now, it always returns 0 and the function hynix_nand_cleanup()
> in hynix_nand_init() has never been called.
>
> Found by RASU JSC and Linux Verification Center (linuxtesting.org)
> Fixes: 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
>
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s@gmail.com>
FWIW, the tag block shouldn't have blank lines.
--
With Best Regards,
Andy Shevchenko
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-03-25 15:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 10:27 [PATCH] mtd: rawnand: hynix: fixed typo Maxim Korotkov
2024-03-15 11:23 ` Miquel Raynal
2024-03-15 11:45 ` Maxim Korotkov
2024-03-15 12:14 ` Miquel Raynal
2024-03-25 10:18 ` Miquel Raynal
2024-03-25 10:20 ` Miquel Raynal
2024-03-25 15:41 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).