From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Jagdish Gediya <jagdish.gediya@nxp.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Subject: Re: Issue while oops and panic message logging to MTD partition
Date: Tue, 15 May 2018 14:07:40 +0200 [thread overview]
Message-ID: <20180515140740.4f58911b@bbrezillon> (raw)
In-Reply-To: <HE1PR0402MB2778B83183DA25027369540A90930@HE1PR0402MB2778.eurprd04.prod.outlook.com>
Hi,
On Tue, 15 May 2018 10:49:15 +0000
Jagdish Gediya <jagdish.gediya@nxp.com> wrote:
> Hi,
>
> Setup details:
> Board - Freescale ls1046ardb(ARM64)
> MTD device - nand(IFC)
>
> CONFIG_MTD_OOPS is enabled to collect oops and panic logs.
> Added bootargs to collect logs : mtdoops.mtddev=3 mtdoops.record_size=16384
>
> Issue:
> Kernel hangs during oops log collection in function :fsl_ifc_run_command".
> Below is the code location where it hangs exactly,
>
> /*
> * execute IFC NAND command and wait for it to complete
> */
> static void fsl_ifc_run_command(struct mtd_info *mtd)
> { .
> .
> .
> .
> .
>
> /* wait for command complete flag or timeout */
> wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
> msecs_to_jiffies(IFC_TIMEOUT_MSECS));
>
> .
> .
> .
> .
> }
>
> "wait_event_timeout" is the exact culrit where kernel hangs. As panic(...) disables the local interrupt by calling local_irq_disable(),
> It looks like behavior is expected because timer interrupts are disabled and because of that "wait_event_timeout" hangs forever.
>
> The odd behaviour is sometimes "wait_event_timeout" does not hang. The reason could be being a multicore processor, some other core would receive the
> timer interrupt and as a result "wait_event_timeout" gets unblocked.
>
> How the other driver accomplish the timer replated work if any during the panic path or in general when local interrupts are disabled?
MTD_OOPS is just a mess, and I'm sure most driver simply don't support
it properly. If you still want to use the feature, you'll probably have
to fallback to status polling instead of using wait_event_timeout().
See what the core does here [1].
Still, I'd recommend not using MTD_OOPS if possible, because I fear
that's not the only problem you'll face. One problem I see is that the
locking is completely bypassed when ->panic_write() is called, and your
->cmdfunc() might be called while another operation is still in
progress (PROGRAM, ERASE, READ...) in order to get the NAND status.
Looking at the ifc code, it seems the driver is not ready to cope with
that.
Regards,
Boris
[1]https://elixir.bootlin.com/linux/v4.17-rc5/source/drivers/mtd/nand/raw/nand_base.c#L648
next prev parent reply other threads:[~2018-05-15 12:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 10:49 Issue while oops and panic message logging to MTD partition Jagdish Gediya
2018-05-15 12:07 ` Boris Brezillon [this message]
2018-05-24 7:22 ` Jagdish Gediya
2018-05-24 9:59 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180515140740.4f58911b@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=jagdish.gediya@nxp.com \
--cc=linux-mtd@lists.infradead.org \
--cc=prabhakar.kushwaha@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox