* Re: [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 13:16 [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response Ronald Monthero
@ 2023-11-13 13:44 ` Miquel Raynal
2023-11-13 15:17 ` Ronald Monthero
2023-11-13 15:53 ` [PATCH v2] mtd: rawnand: " Ronald Monthero
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2023-11-13 13:44 UTC (permalink / raw)
To: Ronald Monthero
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, andriy.shevchenko,
jaimeliao.tw, linux-mtd, linux-kernel,
Philippe Mathieu-Daudé
Hi Ronald,
Thanks for the patch, here are a couple of comments I'd like you to
address before taking the fix.
debug.penguin32@gmail.com wrote on Mon, 13 Nov 2023 23:16:28 +1000:
The title prefix needs to be aligned with today's policy, you can check
it with git log --oneline -- <your file>.
> The nand controller not responding scenario occurs causing blocked tasks
> and rcu_prempt warnings of stall on cpus. Incrementing the
> IFC_TIMEOUT_MSECS appears to solve the nand controller not responding
> issue.
I would rephrase a bit this paragraph with more confidence. Under heavy
load it is likely that the controller is done with its own task but the
thread unlocking the wait look is never scheduled (or not in time)
resulting in such kind of error. Maybe there is something else wrong in
the code which stalls the CPU in this case, (hence the first message).
Enlarging the timeout to 1s in this case is fine, but maybe there is
still something wrong aside.
> ** ID_531 main/smrcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> (detected by 1, t=2102 jiffies, g=12653, q=518)
> task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> [<8064bb01>] (schedule) from [<8064fa65>] (schedule_timeout+0x6d/0xa0)
> [<8064fa65>] (schedule_timeout) from [<804ba353>] (fsl_ifc_run_command+0x6f/0x178)
> [<804ba353>] (fsl_ifc_run_command) from [<804ba72f>] (fsl_ifc_cmdfunc+0x203/0x2b8)
> [<804ba72f>] (fsl_ifc_cmdfunc) from [<804b135f>] (nand_status_op+0xaf/0xe0)
> [<804b135f>] (nand_status_op) from [<804b13b3>] (nand_check_wp+0x23/0x48)
> [<804b13b3>] (nand_check_wp) from [<804b231d>] (nand_do_write_ops+0x99/0x2b8)
> [<804b231d>] (nand_do_write_ops) from [<804b5355>] (nand_write_oob+0x3b/0x4a)
> [<804b5355>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
> [<804c047b>] (ubi_eba_write_leb) from [<804bf62d>] (ubi_leb_write+0x75/0x90)
> [<804bf62d>] (ubi_leb_write) from [<803745b7>] (ubifs_leb_write+0x4b/0x8c)
> [<803745b7>] (ubifs_leb_write) from [<80374bbb>] (ubifs_wbuf_sync_nolock+0x10f/0x1a4)
> [<80374bbb>] (ubifs_wbuf_sync_nolock) from [<8036c6dd>] (ubifs_jnl_update+0x1e9/0x36c)
> [<8036c6dd>] (ubifs_jnl_update) from [<80370933>] (ubifs_create+0xb3/0x130)
> [<80370933>] (ubifs_create) from [<802cf0c7>] (lookup_open+0x173/0x1c4)
> [<802cf0c7>] (lookup_open) from [<802cf8a3>] (open_last_lookups+0xd7/0x16c)
> [<802cf8a3>] (open_last_lookups) from [<802d08e5>] (path_openat+0x91/0x104)
> [<802d08e5>] (path_openat) from [<802d0989>] (do_filp_open+0x31/0x74)
> [<802d0989>] (do_filp_open) from [<802c4fb3>] (file_open_name+0x33/0x48)
> [<802c4fb3>] (file_open_name) from [<802c4fe9>] (filp_open+0x21/0x2e)
> [<802c4fe9>] (filp_open) from [<80490bd3>] (irq1_handler+0x53/0xa4)
> [<80490bd3>] (irq1_handler) from [<80247dd7>] (irq_forced_thread_fn+0x1f/0x4c)
> [<80247dd7>] (irq_forced_thread_fn) from [<80247cd9>] (irq_thread+0x89/0x114)
> [<80247cd9>] (irq_thread) from [<8022ca67>] (kthread+0xcf/0xe4)
> [<8022ca67>] (kthread) from [<80200149>] (ret_from_fork+0x11/0x28)
> Exception stack(0x822bbfb0 to 0x822bbff8)
> bfa0: 00000000 00000000 00000000 00000000
> bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
>
> fsl,ifc-nand 7e800000.nand: Controller is not responding
> ID_531 main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs:
> rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> (detected by 1, t=2102 jiffies, g=7729, q=754)
> task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> [<8064bb01>] (schedule) from [<8064dacd>] (rt_mutex_slowlock_block.con)
> [<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
> [<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
> [<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
> [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
> [<804c047b>] (ubi_eba_write_leb) from [<804bf62d>] (ubi_leb_write+0x75/0x90)
> [<804bf62d>] (ubi_leb_write) from [<803745b7>] (ubifs_leb_write+0x4b/0x8c)
> [<803745b7>] (ubifs_leb_write) from [<80374bbb>] (ubifs_wbuf_sync_nolock+0x10f/0x1a4)
> [<80374bbb>] (ubifs_wbuf_sync_nolock) from [<8036c6dd>] (ubifs_jnl_update+0x1e9/0x36c)
You can trim down the traces to only show the interesting part.
Here you need a Fixes: and Cc: stable tag.
> Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
> ---
> drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
> drivers/mtd/nand/raw/nand_base.c | 5 ++++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> index 20bb1e0cb5eb..42f8ea46b6a8 100644
> --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> @@ -21,7 +21,7 @@
>
> #define ERR_BYTE 0xFF /* Value returned for read
> bytes when read failed */
> -#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
> +#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
> for IFC NAND Machine */
>
> struct fsl_ifc_ctrl;
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index 9e24bedffd89..05b52ed41f4c 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -363,8 +363,11 @@ static int nand_check_wp(struct nand_chip *chip)
> int ret;
>
> /* Broken xD cards report WP despite being writable */
> - if (chip->options & NAND_BROKEN_XD)
> + if (chip->options & NAND_BROKEN_XD) {
> + pr_info("nand_chip->options indicates NAND_BROKEN_XD %d\n",
> + (chip->options & NAND_BROKEN_XD));
> return 0;
> + }
This is an unrelated debug message and should be dropped.
>
> /* Check the WP bit */
> ret = nand_status_op(chip, &status);
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 13:44 ` Miquel Raynal
@ 2023-11-13 15:17 ` Ronald Monthero
0 siblings, 0 replies; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 15:17 UTC (permalink / raw)
To: Miquel Raynal
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, andriy.shevchenko,
jaimeliao.tw, linux-mtd, linux-kernel,
Philippe Mathieu-Daudé
On Mon, Nov 13, 2023 at 11:44 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> Hi Ronald,
>
> Thanks for the patch, here are a couple of comments I'd like you to
> address before taking the fix.
>
> debug.penguin32@gmail.com wrote on Mon, 13 Nov 2023 23:16:28 +1000:
>
> The title prefix needs to be aligned with today's policy, you can check
> it with git log --oneline -- <your file>.
>
> > The nand controller not responding scenario occurs causing blocked tasks
> > and rcu_prempt warnings of stall on cpus. Incrementing the
> > IFC_TIMEOUT_MSECS appears to solve the nand controller not responding
> > issue.
>
> I would rephrase a bit this paragraph with more confidence. Under heavy
> load it is likely that the controller is done with its own task but the
> thread unlocking the wait look is never scheduled (or not in time)
> resulting in such kind of error. Maybe there is something else wrong in
> the code which stalls the CPU in this case, (hence the first message).
>
> Enlarging the timeout to 1s in this case is fine, but maybe there is
> still something wrong aside.
>
> > ** ID_531 main/smrcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> > rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> > (detected by 1, t=2102 jiffies, g=12653, q=518)
> > task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> > [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> > [<8064bb01>] (schedule) from [<8064fa65>] (schedule_timeout+0x6d/0xa0)
> > [<8064fa65>] (schedule_timeout) from [<804ba353>] (fsl_ifc_run_command+0x6f/0x178)
> > [<804ba353>] (fsl_ifc_run_command) from [<804ba72f>] (fsl_ifc_cmdfunc+0x203/0x2b8)
> > [<804ba72f>] (fsl_ifc_cmdfunc) from [<804b135f>] (nand_status_op+0xaf/0xe0)
> > [<804b135f>] (nand_status_op) from [<804b13b3>] (nand_check_wp+0x23/0x48)
> > [<804b13b3>] (nand_check_wp) from [<804b231d>] (nand_do_write_ops+0x99/0x2b8)
> > [<804b231d>] (nand_do_write_ops) from [<804b5355>] (nand_write_oob+0x3b/0x4a)
> > [<804b5355>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> > [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> > [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
> > [<804c047b>] (ubi_eba_write_leb) from [<804bf62d>] (ubi_leb_write+0x75/0x90)
> > [<804bf62d>] (ubi_leb_write) from [<803745b7>] (ubifs_leb_write+0x4b/0x8c)
> > [<803745b7>] (ubifs_leb_write) from [<80374bbb>] (ubifs_wbuf_sync_nolock+0x10f/0x1a4)
> > [<80374bbb>] (ubifs_wbuf_sync_nolock) from [<8036c6dd>] (ubifs_jnl_update+0x1e9/0x36c)
> > [<8036c6dd>] (ubifs_jnl_update) from [<80370933>] (ubifs_create+0xb3/0x130)
> > [<80370933>] (ubifs_create) from [<802cf0c7>] (lookup_open+0x173/0x1c4)
> > [<802cf0c7>] (lookup_open) from [<802cf8a3>] (open_last_lookups+0xd7/0x16c)
> > [<802cf8a3>] (open_last_lookups) from [<802d08e5>] (path_openat+0x91/0x104)
> > [<802d08e5>] (path_openat) from [<802d0989>] (do_filp_open+0x31/0x74)
> > [<802d0989>] (do_filp_open) from [<802c4fb3>] (file_open_name+0x33/0x48)
> > [<802c4fb3>] (file_open_name) from [<802c4fe9>] (filp_open+0x21/0x2e)
> > [<802c4fe9>] (filp_open) from [<80490bd3>] (irq1_handler+0x53/0xa4)
> > [<80490bd3>] (irq1_handler) from [<80247dd7>] (irq_forced_thread_fn+0x1f/0x4c)
> > [<80247dd7>] (irq_forced_thread_fn) from [<80247cd9>] (irq_thread+0x89/0x114)
> > [<80247cd9>] (irq_thread) from [<8022ca67>] (kthread+0xcf/0xe4)
> > [<8022ca67>] (kthread) from [<80200149>] (ret_from_fork+0x11/0x28)
> > Exception stack(0x822bbfb0 to 0x822bbff8)
> > bfa0: 00000000 00000000 00000000 00000000
> > bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> > bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
> >
> > fsl,ifc-nand 7e800000.nand: Controller is not responding
> > ID_531 main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs:
> > rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> > (detected by 1, t=2102 jiffies, g=7729, q=754)
> > task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> > [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> > [<8064bb01>] (schedule) from [<8064dacd>] (rt_mutex_slowlock_block.con)
> > [<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
> > [<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
> > [<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
> > [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> > [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> > [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> > [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
> > [<804c047b>] (ubi_eba_write_leb) from [<804bf62d>] (ubi_leb_write+0x75/0x90)
> > [<804bf62d>] (ubi_leb_write) from [<803745b7>] (ubifs_leb_write+0x4b/0x8c)
> > [<803745b7>] (ubifs_leb_write) from [<80374bbb>] (ubifs_wbuf_sync_nolock+0x10f/0x1a4)
> > [<80374bbb>] (ubifs_wbuf_sync_nolock) from [<8036c6dd>] (ubifs_jnl_update+0x1e9/0x36c)
>
> You can trim down the traces to only show the interesting part.
>
> Here you need a Fixes: and Cc: stable tag.
>
> > Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
> > ---
> > drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
> > drivers/mtd/nand/raw/nand_base.c | 5 ++++-
> > 2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> > index 20bb1e0cb5eb..42f8ea46b6a8 100644
> > --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
> > +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> > @@ -21,7 +21,7 @@
> >
> > #define ERR_BYTE 0xFF /* Value returned for read
> > bytes when read failed */
> > -#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
> > +#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
> > for IFC NAND Machine */
> >
> > struct fsl_ifc_ctrl;
> > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > index 9e24bedffd89..05b52ed41f4c 100644
> > --- a/drivers/mtd/nand/raw/nand_base.c
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -363,8 +363,11 @@ static int nand_check_wp(struct nand_chip *chip)
> > int ret;
> >
> > /* Broken xD cards report WP despite being writable */
> > - if (chip->options & NAND_BROKEN_XD)
> > + if (chip->options & NAND_BROKEN_XD) {
> > + pr_info("nand_chip->options indicates NAND_BROKEN_XD %d\n",
> > + (chip->options & NAND_BROKEN_XD));
> > return 0;
> > + }
>
> This is an unrelated debug message and should be dropped.
>
> >
> > /* Check the WP bit */
> > ret = nand_status_op(chip, &status);
>
> Thanks,
> Miquèl
Hi Miquel,
Thanks for the review and suggestions, I will send out a v2 patch shortly.
BR,
Ronald
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 13:16 [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response Ronald Monthero
2023-11-13 13:44 ` Miquel Raynal
@ 2023-11-13 15:53 ` Ronald Monthero
2023-11-13 16:04 ` Andy Shevchenko
2023-11-13 16:07 ` [PATCH v2] " Ronald Monthero
2023-11-17 23:03 ` [PATCH] mtd:nand: " kernel test robot
3 siblings, 1 reply; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 15:53 UTC (permalink / raw)
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, debug.penguin32, AVKrasnov, r.czerwinski,
andriy.shevchenko, jaimeliao.tw, linux-mtd, linux-kernel, stable,
Miquel Raynal
Under heavy load it is likely that the controller is done
with its own task but the thread unlocking the wait is not
scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
controller to respond within allowable timeslice of 1 sec
fsl,ifc-nand 7e800000.nand: Controller is not responding
main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs/tasks:
rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
(detected by 1, t=2102 jiffies, g=7729, q=754)
task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
[<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
[<8064bb01>] (schedule) from [<8064dacd>]
[<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
[<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
[<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
[<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
[<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
[<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
---
drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 20bb1e0cb5eb..42f8ea46b6a8 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -21,7 +21,7 @@
#define ERR_BYTE 0xFF /* Value returned for read
bytes when read failed */
-#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
for IFC NAND Machine */
struct fsl_ifc_ctrl;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 15:53 ` [PATCH v2] mtd: rawnand: " Ronald Monthero
@ 2023-11-13 16:04 ` Andy Shevchenko
2023-11-13 16:11 ` Ronald Monthero
2023-11-13 17:32 ` [PATCH v3] " Ronald Monthero
0 siblings, 2 replies; 14+ messages in thread
From: Andy Shevchenko @ 2023-11-13 16:04 UTC (permalink / raw)
To: Ronald Monthero
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, jaimeliao.tw, linux-mtd,
linux-kernel, stable, Miquel Raynal
You are too quick with v2, below my comments (new and old).
On Tue, Nov 14, 2023 at 01:53:51AM +1000, Ronald Monthero wrote:
> Under heavy load it is likely that the controller is done
> with its own task but the thread unlocking the wait is not
> scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
> controller to respond within allowable timeslice of 1 sec
Missing period at the end?
> fsl,ifc-nand 7e800000.nand: Controller is not responding
> main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs/tasks:
> rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> (detected by 1, t=2102 jiffies, g=7729, q=754)
> task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> [<8064bb01>] (schedule) from [<8064dacd>]
> [<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
> [<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
> [<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
At least above 9 lines are not important and may be removed.
> [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
...
> -#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
> +#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
> for IFC NAND Machine */
While at it, you may improve the comment, e.g.,
"Maximum timeout to wait for IPC NAND Machine"
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 16:04 ` Andy Shevchenko
@ 2023-11-13 16:11 ` Ronald Monthero
2023-11-13 17:32 ` [PATCH v3] " Ronald Monthero
1 sibling, 0 replies; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 16:11 UTC (permalink / raw)
To: Andy Shevchenko
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, jaimeliao.tw, linux-mtd,
linux-kernel, stable, Miquel Raynal
Hi Andy,
Thanks for the feedback, I had not seen your response by then. I will
modify and send it again.
BR,
Ron
On Tue, Nov 14, 2023 at 2:04 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> You are too quick with v2, below my comments (new and old).
>
> On Tue, Nov 14, 2023 at 01:53:51AM +1000, Ronald Monthero wrote:
> > Under heavy load it is likely that the controller is done
> > with its own task but the thread unlocking the wait is not
> > scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
> > controller to respond within allowable timeslice of 1 sec
>
> Missing period at the end?
>
> > fsl,ifc-nand 7e800000.nand: Controller is not responding
>
> > main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs/tasks:
> > rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
> > (detected by 1, t=2102 jiffies, g=7729, q=754)
> > task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
> > [<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
> > [<8064bb01>] (schedule) from [<8064dacd>]
> > [<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
> > [<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
> > [<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
>
> At least above 9 lines are not important and may be removed.
>
> > [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> > [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> > [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> > [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
>
> ...
>
> > -#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
> > +#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
> > for IFC NAND Machine */
>
> While at it, you may improve the comment, e.g.,
>
> "Maximum timeout to wait for IPC NAND Machine"
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v3] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 16:04 ` Andy Shevchenko
2023-11-13 16:11 ` Ronald Monthero
@ 2023-11-13 17:32 ` Ronald Monthero
2023-11-14 8:13 ` Miquel Raynal
1 sibling, 1 reply; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 17:32 UTC (permalink / raw)
To: miquel.raynal, andriy.shevchenko
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, debug.penguin32, AVKrasnov, r.czerwinski,
jaimeliao.tw, linux-mtd, linux-kernel, stable, Roger Quadros,
Thierry Reding
Under heavy load it is likely that the controller is done
with its own task but the thread unlocking the wait is not
scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
controller to respond within allowable timeslice of 1 sec.
fsl,ifc-nand 7e800000.nand: Controller is not responding
[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
[<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
[<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
[<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
Cc: stable@vger.kernel.org
Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
---
drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 20bb1e0cb5eb..f0e2318ce088 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -21,7 +21,7 @@
#define ERR_BYTE 0xFF /* Value returned for read
bytes when read failed */
-#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS 1000 /* Maximum timeout to wait
for IFC NAND Machine */
struct fsl_ifc_ctrl;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v3] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 17:32 ` [PATCH v3] " Ronald Monthero
@ 2023-11-14 8:13 ` Miquel Raynal
2023-11-18 8:31 ` [PATCH v4] " Ronald Monthero
0 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2023-11-14 8:13 UTC (permalink / raw)
To: Ronald Monthero
Cc: andriy.shevchenko, richard, vigneshr, heiko, martin.blumenstingl,
paul, robh, u.kleine-koenig, AVKrasnov, r.czerwinski,
jaimeliao.tw, linux-mtd, linux-kernel, stable, Roger Quadros,
Thierry Reding
Hi Ronald,
debug.penguin32@gmail.com wrote on Tue, 14 Nov 2023 03:32:49 +1000:
> Under heavy load it is likely that the controller is done
> with its own task but the thread unlocking the wait is not
> scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
> controller to respond within allowable timeslice of 1 sec.
>
> fsl,ifc-nand 7e800000.nand: Controller is not responding
>
> [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
>
> Cc: stable@vger.kernel.org
I believe the Fixes tag is the latest missing piece?
> Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
> ---
> drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> index 20bb1e0cb5eb..f0e2318ce088 100644
> --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
> @@ -21,7 +21,7 @@
>
> #define ERR_BYTE 0xFF /* Value returned for read
> bytes when read failed */
> -#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
> +#define IFC_TIMEOUT_MSECS 1000 /* Maximum timeout to wait
> for IFC NAND Machine */
>
> struct fsl_ifc_ctrl;
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-14 8:13 ` Miquel Raynal
@ 2023-11-18 8:31 ` Ronald Monthero
2023-11-20 10:46 ` Miquel Raynal
0 siblings, 1 reply; 14+ messages in thread
From: Ronald Monthero @ 2023-11-18 8:31 UTC (permalink / raw)
To: miquel.raynal, andriy.shevchenko
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, debug.penguin32, AVKrasnov, r.czerwinski,
jaimeliao.tw, linux-mtd, linux-kernel, Roger Quadros,
Tudor Ambarus, Poonam Aggrwal, Dipen Dudhat, Kumar Gala, Li Yang,
Liu Shuo
Under heavy load it is likely that the controller is done
with its own task but the thread unlocking the wait is not
scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
controller to respond within allowable timeslice of 1 sec.
fsl,ifc-nand 7e800000.nand: Controller is not responding
[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
[<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
[<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
[<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
Fixes: 82771882d960 ("NAND Machine support for Integrated Flash Controller")
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
---
drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 20bb1e0cb5eb..f0e2318ce088 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -21,7 +21,7 @@
#define ERR_BYTE 0xFF /* Value returned for read
bytes when read failed */
-#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS 1000 /* Maximum timeout to wait
for IFC NAND Machine */
struct fsl_ifc_ctrl;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-18 8:31 ` [PATCH v4] " Ronald Monthero
@ 2023-11-20 10:46 ` Miquel Raynal
0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2023-11-20 10:46 UTC (permalink / raw)
To: Ronald Monthero, miquel.raynal, andriy.shevchenko
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, jaimeliao.tw, linux-mtd,
linux-kernel, Roger Quadros, Tudor Ambarus, Poonam Aggrwal,
Dipen Dudhat, Kumar Gala, Li Yang, Liu Shuo
On Sat, 2023-11-18 at 08:31:51 UTC, Ronald Monthero wrote:
> Under heavy load it is likely that the controller is done
> with its own task but the thread unlocking the wait is not
> scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
> controller to respond within allowable timeslice of 1 sec.
>
> fsl,ifc-nand 7e800000.nand: Controller is not responding
>
> [<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
> [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
> [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
> [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
>
> Fixes: 82771882d960 ("NAND Machine support for Integrated Flash Controller")
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 13:16 [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response Ronald Monthero
2023-11-13 13:44 ` Miquel Raynal
2023-11-13 15:53 ` [PATCH v2] mtd: rawnand: " Ronald Monthero
@ 2023-11-13 16:07 ` Ronald Monthero
2023-11-13 16:15 ` Andy Shevchenko
2023-11-17 23:03 ` [PATCH] mtd:nand: " kernel test robot
3 siblings, 1 reply; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 16:07 UTC (permalink / raw)
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, debug.penguin32, AVKrasnov, r.czerwinski,
andriy.shevchenko, jaimeliao.tw, linux-mtd, linux-kernel, stable,
Miquel Raynal, Philippe Mathieu-Daudé, Nicolas Ferre
Under heavy load it is likely that the controller is done
with its own task but the thread unlocking the wait is not
scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
controller to respond within allowable timeslice of 1 sec
fsl,ifc-nand 7e800000.nand: Controller is not responding
main/smp_fsm.c:1884 <inrcu: rcu_preempt detected stalls on CPUs/tasks:
rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P116/2:b..l
(detected by 1, t=2102 jiffies, g=7729, q=754)
task:irq/31-arm-irq1 state:D stack: 0 pid: 116 ppid: 2 flags:0x00000000
[<8064b97f>] (__schedule) from [<8064bb01>] (schedule+0x8d/0xc2)
[<8064bb01>] (schedule) from [<8064dacd>]
[<8064dacd>] (rt_mutex_slowlock_block.constprop.0) from [<8064db57>]
[<8064db57>] (__rt_mutex_slowlock.constprop.0) from [<8064dbf7>]
[<8064dbf7>] (rt_mutex_slowlock.constprop.0) from [<804b2047>]
[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
[<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
[<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
[<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)
Cc: stable@vger.kernel.org
Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
---
drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 20bb1e0cb5eb..42f8ea46b6a8 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -21,7 +21,7 @@
#define ERR_BYTE 0xFF /* Value returned for read
bytes when read failed */
-#define IFC_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS 1000 /* Maximum number of mSecs to wait
for IFC NAND Machine */
struct fsl_ifc_ctrl;
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 16:07 ` [PATCH v2] " Ronald Monthero
@ 2023-11-13 16:15 ` Andy Shevchenko
2023-11-13 16:21 ` Ronald Monthero
0 siblings, 1 reply; 14+ messages in thread
From: Andy Shevchenko @ 2023-11-13 16:15 UTC (permalink / raw)
To: Ronald Monthero
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, jaimeliao.tw, linux-mtd,
linux-kernel, stable, Miquel Raynal, Philippe Mathieu-Daudé,
Nicolas Ferre
On Tue, Nov 14, 2023 at 02:07:49AM +1000, Ronald Monthero wrote:
I'm not sure if it's a dup email of the previously sent v2. In any case I have
commented on v1 and v2, please consider addressing them.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 16:15 ` Andy Shevchenko
@ 2023-11-13 16:21 ` Ronald Monthero
0 siblings, 0 replies; 14+ messages in thread
From: Ronald Monthero @ 2023-11-13 16:21 UTC (permalink / raw)
To: Andy Shevchenko
Cc: richard, vigneshr, heiko, martin.blumenstingl, paul, robh,
u.kleine-koenig, AVKrasnov, r.czerwinski, jaimeliao.tw, linux-mtd,
linux-kernel, stable, Miquel Raynal, Philippe Mathieu-Daudé,
Nicolas Ferre
On Tue, Nov 14, 2023 at 2:15 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Nov 14, 2023 at 02:07:49AM +1000, Ronald Monthero wrote:
>
> I'm not sure if it's a dup email of the previously sent v2. In any case I have
> commented on v1 and v2, please consider addressing them.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Andy jfyi, the 2 emails of v2 are the same except that the latter has
the stable tag, which was missed.
I will address the review comments and send it.
BR,
Ron
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response
2023-11-13 13:16 [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response Ronald Monthero
` (2 preceding siblings ...)
2023-11-13 16:07 ` [PATCH v2] " Ronald Monthero
@ 2023-11-17 23:03 ` kernel test robot
3 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2023-11-17 23:03 UTC (permalink / raw)
To: Ronald Monthero
Cc: llvm, oe-kbuild-all, richard, vigneshr, heiko,
martin.blumenstingl, paul, robh, u.kleine-koenig, debug.penguin32,
AVKrasnov, r.czerwinski, andriy.shevchenko, jaimeliao.tw,
linux-mtd, linux-kernel, Miquel Raynal,
Philippe Mathieu-Daudé
Hi Ronald,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mtd/nand/next]
[also build test WARNING on linus/master v6.7-rc1 next-20231117]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ronald-Monthero/mtd-nand-Increment-IFC_TIMEOUT_MSECS-for-nand-controller-response/20231113-212730
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
patch link: https://lore.kernel.org/r/20231113131634.614467-1-debug.penguin32%40gmail.com
patch subject: [PATCH] mtd:nand: Increment IFC_TIMEOUT_MSECS for nand controller response
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20231118/202311180630.FuB77L6v-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311180630.FuB77L6v-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311180630.FuB77L6v-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/mtd/nand/raw/nand_base.c:40:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/mtd/nand/raw/nand_base.c:40:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/mtd/nand/raw/nand_base.c:40:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> drivers/mtd/nand/raw/nand_base.c:368:4: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
368 | pr_info("nand_chip->options indicates NAND_BROKEN_XD %d\n",
| ~~
| %lu
369 | (chip->options & NAND_BROKEN_XD));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:528:34: note: expanded from macro 'pr_info'
528 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:455:60: note: expanded from macro 'printk'
455 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:427:19: note: expanded from macro 'printk_index_wrap'
427 | _p_func(_fmt, ##__VA_ARGS__); \
| ~~~~ ^~~~~~~~~~~
7 warnings generated.
vim +368 drivers/mtd/nand/raw/nand_base.c
352
353 /**
354 * nand_check_wp - [GENERIC] check if the chip is write protected
355 * @chip: NAND chip object
356 *
357 * Check, if the device is write protected. The function expects, that the
358 * device is already selected.
359 */
360 static int nand_check_wp(struct nand_chip *chip)
361 {
362 u8 status;
363 int ret;
364
365 /* Broken xD cards report WP despite being writable */
366 if (chip->options & NAND_BROKEN_XD) {
367 pr_info("nand_chip->options indicates NAND_BROKEN_XD %d\n",
> 368 (chip->options & NAND_BROKEN_XD));
369 return 0;
370 }
371
372 /* Check the WP bit */
373 ret = nand_status_op(chip, &status);
374 if (ret)
375 return ret;
376
377 return status & NAND_STATUS_WP ? 0 : 1;
378 }
379
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread