public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Stas Sergeev <stsp@list.ru>
Cc: "Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	"Linux kernel" <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	"Gregory Clément" <gregory.clement@free-electrons.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>
Subject: Re: [PATCH] n_tty: use kmalloc() instead of vmalloc() to avoid crash on armada-xp
Date: Wed, 11 Mar 2015 19:11:18 +0100	[thread overview]
Message-ID: <20150311191118.1edb2ed8@free-electrons.com> (raw)
In-Reply-To: <550081E2.5030807@list.ru>

Dear Stas Sergeev,

On Wed, 11 Mar 2015 20:56:50 +0300, Stas Sergeev wrote:

> It doesn't look like it works as intended.
> Got the crash below.
> Please note the mappings beyond 0xe0000000, so I wonder if
> the option worked as expected?

Are you sure you're not confusing virtual addresses and physical
addresses? I'm not sure where you see mappings beyond 0xe0000000,
except virtual addresses, which are not relevant here, as we are
talking about physical addresses.

> [    6.122188] Unable to handle kernel NULL pointer dereference at
> virtual address 000002d4
> [    6.130298] pgd = c0004000
> [    6.133022] [000002d4] *pgd=00000000
> [    6.136617] Internal error: Oops: 5 [#1] SMP ARM
> [    6.141244] Modules linked in:
> [    6.144317] CPU: 0 PID: 6 Comm: kworker/u8:0 Not tainted
> 4.0.0-rc2-00137-gb672c98-dirty #2
> [    6.152600] Hardware name: Marvell Armada 370/XP (Device Tree)
> [    6.158452] Workqueue: events_unbound async_run_entry_fn
> [    6.163786] task: ed426c00 ti: ed452000 task.ti: ed452000
> [    6.169196] PC is at 0x0
> [    6.171734] LR is at 0xfafeff5c
> [    6.174883] pc : [<00000000>]    lr : [<fafeff5c>]    psr: 00000000
> [    6.174883] sp : ffd6d7ff  ip : 00000000  fp : 00000200
> [    6.186388] r10: ed453d90  r9 : 00000001  r8 : 00000000
> [    6.191624] r7 : ed5857c0  r6 : 00000000  r5 : ed80c60a  r4 : 00000000
> [    6.198166] r3 : 76c06305  r2 : c200f010  r1 : 00000000  r0 : 00000000
> [    6.204709] Flags: nzcv  IRQs on  FIQs on  Mode USER_26  ISA ARM 
> Segment kernel
> [    6.212121] Control: 10c5387d  Table: 0000406a  DAC: 00000015
> [    6.217880] Process kworker/u8:0 (pid: 6, stack limit = 0xed452220)
> [    6.224183] ---[ end trace 93bf56ab1670c925 ]---
> [    6.228824] Unable to handle kernel NULL pointer dereference at
> virtual address 000002d4

This looks indeed weird.

What I did to work around this problem is to:

 1/ Boot in appended DT mode so that the bootloader doesn't mess up
    with the DTB

 2/ Disable CONFIG_ARM_ATAG_DTB_COMPAT so that the kernel doesn't
    update the /memory/reg DT node with the (bogus) ATAGS passed by the
    bootloader.

Of course, this means you'll have to have a proper /memory/reg value in
your DT, and a correct /chosen/bootargs value, since all info passed by
the bootloader will essentially be ignored.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-03-11 18:11 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 16:54 [PATCH] n_tty: use kmalloc() instead of vmalloc() to avoid crash on armada-xp Stas Sergeev
2015-03-10 17:17 ` Catalin Marinas
2015-03-10 17:27   ` Stas Sergeev
2015-03-10 17:38     ` Russell King - ARM Linux
2015-03-10 18:31       ` Stas Sergeev
2015-03-10 18:54         ` Russell King - ARM Linux
2015-03-11 12:30       ` Stas Sergeev
2015-03-11 12:47         ` Russell King - ARM Linux
2015-03-11 14:24           ` Stas Sergeev
2015-03-11 16:30             ` Peter Hurley
2015-03-11 16:39               ` Stas Sergeev
2015-03-12 12:33             ` Peter Hurley
2015-03-12 12:47               ` Stas Sergeev
2015-03-12 13:04                 ` Russell King - ARM Linux
2015-03-12 13:11                   ` Stas Sergeev
2015-03-12 15:34                     ` Vladimir Murzin
2015-03-12 12:59               ` Russell King - ARM Linux
2015-03-10 17:29 ` Russell King - ARM Linux
2015-03-10 17:35 ` Peter Hurley
2015-03-10 17:51   ` Stas Sergeev
2015-03-10 18:45     ` Peter Hurley
2015-03-11 12:44 ` Gregory CLEMENT
2015-03-11 12:57   ` Stas Sergeev
2015-03-11 13:14   ` Russell King - ARM Linux
2015-03-11 14:33     ` Stas Sergeev
2015-03-11 15:01     ` Stas Sergeev
2015-03-11 15:13       ` Gregory CLEMENT
2015-03-11 15:22         ` Stas Sergeev
2015-03-12 13:06           ` Russell King - ARM Linux
2015-03-11 16:52 ` Thomas Petazzoni
2015-03-11 17:26   ` Stas Sergeev
2015-03-11 17:46     ` Russell King - ARM Linux
2015-03-11 17:56       ` Stas Sergeev
2015-03-11 18:11         ` Thomas Petazzoni [this message]
2015-03-11 18:38           ` Stas Sergeev
2015-03-11 18:41             ` Russell King - ARM Linux
2015-03-11 18:08       ` Stas Sergeev
2015-03-11 18:33         ` Thomas Petazzoni
2015-03-12 12:44           ` Stas Sergeev
2015-03-12 12:47             ` Thomas Petazzoni
2015-03-12 13:03               ` Stas Sergeev
2015-03-12 13:12                 ` Russell King - ARM Linux
2015-03-12 13:16                   ` Stas Sergeev
2015-03-12 13:55                 ` Thomas Petazzoni

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=20150311191118.1edb2ed8@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=catalin.marinas@arm.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=stsp@list.ru \
    /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