From: Tom Rini <trini@konsulko.com>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Bin Meng" <bmeng.cn@gmail.com>,
"Marek Behún" <marek.behun@nic.cz>,
"Patrick Wildt" <patrick@blueri.se>,
u-boot@lists.denx.de
Subject: Re: [PATCH] nvme: Do not allocate 8kB buffer on stack
Date: Sat, 15 Jan 2022 07:37:49 -0500 [thread overview]
Message-ID: <20220115123749.GY9207@bill-the-cat> (raw)
In-Reply-To: <20211209100639.21530-1-pali@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
On Thu, Dec 09, 2021 at 11:06:39AM +0100, Pali Rohár wrote:
> Calling 'nvme scan' followed by 'nvme detail' crashes U-Boot on Turris
> Omnia with the following error:
>
> undefined instruction
> pc : [<0a000000>] lr : [<7ff80bfc>]
> reloc pc : [<8a8c0000>] lr : [<00840bfc>]
> sp : 7fb2b908 ip : 0000002a fp : 02000000
> r10: 04000000 r9 : 7fb2fed0 r8 : e1000000
> r7 : 0c000000 r6 : 03000000 r5 : 06000000 r4 : 01000000
> r3 : 7fb30928 r2 : 7fb30928 r1 : 00000000 r0 : 00000000
> Flags: nZCv IRQs off FIQs off Mode SVC_32
> Code: 0f0fb4f0 0f0fb4f0 0f0fb4f0 0f0fb4f0 (f0f04b0f)
> Resetting CPU ...
>
> This happens when nvme_print_info() tries to return to the caller. It
> looks like this error is caused by trying to allocate 8 KiB of memory
> on the stack by the two uses of ALLOC_CACHE_ALIGN_BUFFER().
>
> Use malloc_cache_aligned() to allocate this memory dynamically instead.
>
> This fixes 'nvme detail' on Turris Omnia.
>
> Note that similar change was applied to file drivers/nvme/nvme.c in past by
> commit 2f83481dff9c ("nvme: use page-aligned buffer for identify command").
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2022-01-15 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 10:06 [PATCH] nvme: Do not allocate 8kB buffer on stack Pali Rohár
2022-01-14 10:40 ` Pali Rohár
2022-01-15 12:37 ` Tom Rini [this message]
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=20220115123749.GY9207@bill-the-cat \
--to=trini@konsulko.com \
--cc=bmeng.cn@gmail.com \
--cc=marek.behun@nic.cz \
--cc=pali@kernel.org \
--cc=patrick@blueri.se \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.