From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel
Date: Thu, 3 Jul 2014 22:52:44 +0200 [thread overview]
Message-ID: <20140703225244.50378fa4@free-electrons.com> (raw)
In-Reply-To: <53B5BB85.2070900@free-electrons.com>
Gregory,
On Thu, 03 Jul 2014 22:22:29 +0200, Gregory CLEMENT wrote:
> > Thanks for reporting the issue. Just to make it easy to reproduce the
> > problem, could post the complete .config that exhibits the issue?
> >
>
> I managed to reproduced the hang with the configuration joined.
> As you can in my .config see I also activated earlyprintk to have more
> trace. The problem seems to come to something at the interaction between
> PCIe and IOMMU:
Thanks for reproducing the problem. In my opinion, the problem is in
drivers/iommu/omap-iommu.c, which gets compiled when
CONFIG_OMAP_IOMMU=y. This file does:
static int __init omap_iommu_init(void)
{
struct kmem_cache *p;
const unsigned long flags = SLAB_HWCACHE_ALIGN;
size_t align = 1 << 10; /* L2 pagetable alignement */
p = kmem_cache_create("iopte_cache", IOPTE_TABLE_SIZE, align, flags,
iopte_cachep_ctor);
if (!p)
return -ENOMEM;
iopte_cachep = p;
bus_set_iommu(&platform_bus_type, &omap_iommu_ops);
return platform_driver_register(&omap_iommu_driver);
}
/* must be ready before omap3isp is probed */
subsys_initcall(omap_iommu_init);
So it calls bus_set_iommu() unconditionally, without caring@all
whether it is running on a platform that actually cares about OMAP
IOMMU. And then later on, a bus notifier of the IOMMU subsystem gets
called, and some NULL pointer gets dereferenced. I'm pretty sure that
if you comment out this subsys_initcall(), you won't see the problem
anymore.
However, this code has been around since a while, so I don't know if
it's actually the change that makes it visible. Maybe some other IOMMU
core internal change makes it actually visible. But this
subsys_initcall() that does random stuff without caring about the
platform it runs on anyway looks incorrect.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-07-03 20:52 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 13:51 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel Paolo Pisati
2014-07-03 14:27 ` Thomas Petazzoni
2014-07-03 14:57 ` Paolo Pisati
2014-07-03 20:22 ` Gregory CLEMENT
2014-07-03 20:52 ` Thomas Petazzoni [this message]
2014-07-03 20:57 ` Gregory CLEMENT
2014-07-03 21:01 ` Thomas Petazzoni
2014-07-03 21:07 ` Gregory CLEMENT
2014-07-03 21:24 ` Gregory CLEMENT
[not found] ` <53B5CA26.7050405-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-07-04 8:47 ` Laurent Pinchart
2014-07-04 8:47 ` Laurent Pinchart
2014-07-05 15:03 ` Ezequiel Garcia
2014-07-05 15:03 ` Ezequiel Garcia
[not found] ` <20140705150308.GA28791-nAQHv47ARr+vIlHkl8J1cg@public.gmane.org>
2014-07-05 20:59 ` Greg Kroah-Hartman
2014-07-05 20:59 ` Greg Kroah-Hartman
2014-07-05 20:59 ` Greg Kroah-Hartman
2014-07-07 10:58 ` Ezequiel Garcia
2014-07-07 10:58 ` Ezequiel Garcia
[not found] ` <20140707105818.GA1101-nAQHv47ARr+vIlHkl8J1cg@public.gmane.org>
2014-07-07 18:30 ` Greg Kroah-Hartman
2014-07-07 18:30 ` Greg Kroah-Hartman
2014-07-07 18:30 ` Greg Kroah-Hartman
2014-07-07 23:37 ` Ezequiel Garcia
2014-07-07 23:37 ` Ezequiel Garcia
[not found] ` <20140707233758.GA1456-nAQHv47ARr+vIlHkl8J1cg@public.gmane.org>
2014-07-07 23:47 ` Greg Kroah-Hartman
2014-07-07 23:47 ` Greg Kroah-Hartman
2014-07-07 23:47 ` Greg Kroah-Hartman
2014-07-08 7:41 ` Thomas Petazzoni
2014-07-08 7:41 ` Thomas Petazzoni
2014-07-08 9:20 ` Paolo Pisati
2014-07-08 9:20 ` Paolo Pisati
2014-07-08 12:01 ` Jason Cooper
2014-07-08 12:01 ` Jason Cooper
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=20140703225244.50378fa4@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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.