linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* 32-bit Amlogic (ARM) SoC: kernel BUG in kfree()
@ 2019-03-21 20:17 Martin Blumenstingl
  2019-03-21 21:44 ` Matthew Wilcox
  0 siblings, 1 reply; 13+ messages in thread
From: Martin Blumenstingl @ 2019-03-21 20:17 UTC (permalink / raw)
  To: linux-mm, linux-kernel, linux-arm-kernel
  Cc: mhocko, linux, willy, rppt, liang.yang, linux-mtd, linux-amlogic, akpm

Hello,

I am experiencing the following crash:
  ------------[ cut here ]------------
  kernel BUG at mm/slub.c:3950!
  Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
  Modules linked in:
  CPU: 1 PID: 1 Comm: swapper/0 Not tainted
5.1.0-rc1-00080-g37b8cb064293-dirty #4252
  Hardware name: Amlogic Meson platform
  PC is at kfree+0x250/0x274
  LR is at meson_nfc_exec_op+0x3b0/0x408
  ...
my goal is to add support for the 32-bit Amlogic Meson SoCs (ARM
Cortex-A5 / Cortex-A9 cores) in the meson-nand driver.

I have traced this crash to the kfree() in meson_nfc_read_buf().
my observation is as follows:
- meson_nfc_read_buf() is called 7 times without any crash, the
kzalloc() call returns 0xe9e6c600 (virtual address) / 0x29e6c600
(physical address)
- the eight time meson_nfc_read_buf() is called kzalloc() call returns
0xee39a38b (virtual address) / 0x2e39a38b (physical address) and the
final kfree() crashes
- changing the size in the kzalloc() call from PER_INFO_BYTE (= 8) to
PAGE_SIZE works around that crash
- disabling the meson-nand driver makes my board boot just fine
- Liang has tested the unmodified code on a 64-bit Amlogic SoC (ARM
Cortex-A53 cores) and he doesn't see the crash there

in case the selected SLAB allocator is relevant:
  CONFIG_SLUB=y

the following printk statement is used to print the addresses returned
by the kzalloc() call in meson_nfc_read_buf():
  printk("%s 0x%px 0x%08x\n", __func__, info, virt_to_phys(info));

my questions are:
- why does kzalloc() return an unaligned address 0xee39a38b (virtual
address) / 0x2e39a38b (physical address)?
- how can further analyze this issue?
- (I don't know where to start analyzing: in mm/, arch/arm/mm, the
meson-nand driver seems to work fine on the 64-bit SoCs but that
doesn't fully rule it out, ...)


Regards
Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-06-08 20:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 20:17 32-bit Amlogic (ARM) SoC: kernel BUG in kfree() Martin Blumenstingl
2019-03-21 21:44 ` Matthew Wilcox
2019-03-22 21:07   ` Martin Blumenstingl
2019-03-25 10:04     ` Liang Yang
2019-03-25 18:31       ` Martin Blumenstingl
2019-03-27  8:53         ` Liang Yang
2019-03-28 18:03           ` Martin Blumenstingl
2019-03-29  7:44             ` Liang Yang
2019-04-05  4:30               ` Martin Blumenstingl
2019-04-10 11:08                 ` Liang Yang
2019-04-10 17:54                   ` Martin Blumenstingl
2019-04-11  3:00                     ` Liang Yang
2019-06-08 20:00                       ` Martin Blumenstingl

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).