From: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Ezequiel Garcia
<ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Thomas Petazzoni
<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Hiroshi.DOYU-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
Paolo Pisati <p.pisati-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Gregory CLEMENT
<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Florian Vaussard <florian.vaussard-p8DiymsW2f8@public.gmane.org>,
Sebastian Hesselbarth
<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel
Date: Mon, 7 Jul 2014 11:30:02 -0700 [thread overview]
Message-ID: <20140707183002.GA5947@kroah.com> (raw)
In-Reply-To: <20140707105818.GA1101-nAQHv47ARr+vIlHkl8J1cg@public.gmane.org>
On Mon, Jul 07, 2014 at 07:58:18AM -0300, Ezequiel Garcia wrote:
> On 05 Jul 01:59 PM, Greg Kroah-Hartman wrote:
> > On Sat, Jul 05, 2014 at 12:03:08PM -0300, Ezequiel Garcia wrote:
> > > After following Gregory's stacktrace (also reproduced here):
> > >
> > > [<c02451f8>] (iommu_bus_notifier) from [<c00512e8>] (notifier_call_chain+0x64/0x9c)
> > > [<c00512e8>] (notifier_call_chain) from [<c00514cc>] (__blocking_notifier_call_chain+0x40/0x58)
> > > [<c00514cc>] (__blocking_notifier_call_chain) from [<c00514f8>] (blocking_notifier_call_chain+0x14/0x1c)
> > > [<c00514f8>] (blocking_notifier_call_chain) from [<c01d225c>] (device_add+0x424/0x524)
> > > [<c01d225c>] (device_add) from [<c0186d90>] (pci_device_add+0xec/0x110)
> > > [<c0186d90>] (pci_device_add) from [<c0186e54>] (pci_scan_single_device+0xa0/0xac)
> > >
> > > I added a few printks and found that the problem is that the iommu_bus_notifier is
> > > called for the 'pci' bus type, which has a null iommu_ops.
> > >
> > > On 04 Jul 10:47 AM, Laurent Pinchart wrote:
> > > [..]
> > > >
> > > > We need a quick fix for v3.16, ...
> > >
> > > Therefore, a quick fix would be to simply check for that:
> > >
> > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> > > index e5555fc..b712cb2 100644
> > > --- a/drivers/iommu/iommu.c
> > > +++ b/drivers/iommu/iommu.c
> > > @@ -536,6 +536,9 @@ static int iommu_bus_notifier(struct notifier_block *nb,
> > > struct iommu_group *group;
> > > unsigned long group_action = 0;
> > >
> > > + if (!ops)
> > > + return 0;
> > > +
> > > /*
> > > * ADD/DEL call into iommu driver ops if provided, which may
> > > * result in ADD/DEL notifiers to group->notifier
> > >
> > > This (nasty workaround?) patch makes the problem go away.
> > >
> > > [..]
> > > > > So it also boot well in 3.15 and then failed in 3.16-rc3. I hope it will
> > > > > help the developers of the OMAP IOMMU driver to fix it.
> > > >
> > > > Thank you. I've had a look at the OMAP IOMMU driver changes between v3.15 and
> > > > v3.16-rc3, and didn't find at first sight any change that could explain the
> > > > crash.
> > > >
> > > > 286f600 iommu/omap: Fix map protection value handling
> > > > 67b779d iommu/omap: Remove comment about supporting single page mappings only
> > > > f7129a0 iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
> > > > 5acc97d iommu/omap: Move to_iommu definition from omap-iopgtable.h
> > > > 2ac6133 iommu/omap: Remove omap_iommu_domain_has_cap() function
> > > > d760e3e iommu/omap: Correct init value of iotlb_entry valid field
> > > >
> > > > Could you try reverting those changes and retest ? If the problem doesn't
> > > > disappear, we'll need to look somewhere else.
> > > >
> > >
> > > I reverted the above commits but nothing changed. I'm far from being an expert,
> > > but it sounds odd to have this bus notifier (that got registered for the
> > > platform bus type) called by a pci bus type.
> >
> > Why wouldn't the PCI bus set this up for its devices? Are you
> > "assuming" you know the bus type and that's the issue?
> >
>
> Thanks for looking at this.
>
> I guess I snipped the thread and lost most of the information about the panic.
> Here's the original bug report:
>
> http://www.spinics.net/lists/arm-kernel/msg344059.html
>
> The problem reported involves enabling OMAP IOMMU driver and not any other IOMMU
> driver. Doing some tracing and adding a few prints, we found that
> omap_iommu_init() sets a bus notifier for the platform bus type:
>
> omap_iommu_init -> bus_set_iommu -> iommu_bus_init:
>
> static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
> {
> bus_register_notifier(bus, &iommu_bus_nb);
> bus_for_each_dev(bus, NULL, ops, add_iommu_group);
> }
>
> But the iommu bus notifier gets called for the 'pci' bus type, which
> has the iommu_ops field NULL (since it hasn't been set for iommu).
So this is what needs to be figured out, how is the notifier being
called with a PCI device? Who else called iommu_bus_init() for the PCI
bus?
thanks,
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: linux-arm-kernel@lists.infradead.org
Subject: 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel
Date: Mon, 7 Jul 2014 11:30:02 -0700 [thread overview]
Message-ID: <20140707183002.GA5947@kroah.com> (raw)
In-Reply-To: <20140707105818.GA1101@arch.cereza>
On Mon, Jul 07, 2014 at 07:58:18AM -0300, Ezequiel Garcia wrote:
> On 05 Jul 01:59 PM, Greg Kroah-Hartman wrote:
> > On Sat, Jul 05, 2014 at 12:03:08PM -0300, Ezequiel Garcia wrote:
> > > After following Gregory's stacktrace (also reproduced here):
> > >
> > > [<c02451f8>] (iommu_bus_notifier) from [<c00512e8>] (notifier_call_chain+0x64/0x9c)
> > > [<c00512e8>] (notifier_call_chain) from [<c00514cc>] (__blocking_notifier_call_chain+0x40/0x58)
> > > [<c00514cc>] (__blocking_notifier_call_chain) from [<c00514f8>] (blocking_notifier_call_chain+0x14/0x1c)
> > > [<c00514f8>] (blocking_notifier_call_chain) from [<c01d225c>] (device_add+0x424/0x524)
> > > [<c01d225c>] (device_add) from [<c0186d90>] (pci_device_add+0xec/0x110)
> > > [<c0186d90>] (pci_device_add) from [<c0186e54>] (pci_scan_single_device+0xa0/0xac)
> > >
> > > I added a few printks and found that the problem is that the iommu_bus_notifier is
> > > called for the 'pci' bus type, which has a null iommu_ops.
> > >
> > > On 04 Jul 10:47 AM, Laurent Pinchart wrote:
> > > [..]
> > > >
> > > > We need a quick fix for v3.16, ...
> > >
> > > Therefore, a quick fix would be to simply check for that:
> > >
> > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> > > index e5555fc..b712cb2 100644
> > > --- a/drivers/iommu/iommu.c
> > > +++ b/drivers/iommu/iommu.c
> > > @@ -536,6 +536,9 @@ static int iommu_bus_notifier(struct notifier_block *nb,
> > > struct iommu_group *group;
> > > unsigned long group_action = 0;
> > >
> > > + if (!ops)
> > > + return 0;
> > > +
> > > /*
> > > * ADD/DEL call into iommu driver ops if provided, which may
> > > * result in ADD/DEL notifiers to group->notifier
> > >
> > > This (nasty workaround?) patch makes the problem go away.
> > >
> > > [..]
> > > > > So it also boot well in 3.15 and then failed in 3.16-rc3. I hope it will
> > > > > help the developers of the OMAP IOMMU driver to fix it.
> > > >
> > > > Thank you. I've had a look at the OMAP IOMMU driver changes between v3.15 and
> > > > v3.16-rc3, and didn't find at first sight any change that could explain the
> > > > crash.
> > > >
> > > > 286f600 iommu/omap: Fix map protection value handling
> > > > 67b779d iommu/omap: Remove comment about supporting single page mappings only
> > > > f7129a0 iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
> > > > 5acc97d iommu/omap: Move to_iommu definition from omap-iopgtable.h
> > > > 2ac6133 iommu/omap: Remove omap_iommu_domain_has_cap() function
> > > > d760e3e iommu/omap: Correct init value of iotlb_entry valid field
> > > >
> > > > Could you try reverting those changes and retest ? If the problem doesn't
> > > > disappear, we'll need to look somewhere else.
> > > >
> > >
> > > I reverted the above commits but nothing changed. I'm far from being an expert,
> > > but it sounds odd to have this bus notifier (that got registered for the
> > > platform bus type) called by a pci bus type.
> >
> > Why wouldn't the PCI bus set this up for its devices? Are you
> > "assuming" you know the bus type and that's the issue?
> >
>
> Thanks for looking at this.
>
> I guess I snipped the thread and lost most of the information about the panic.
> Here's the original bug report:
>
> http://www.spinics.net/lists/arm-kernel/msg344059.html
>
> The problem reported involves enabling OMAP IOMMU driver and not any other IOMMU
> driver. Doing some tracing and adding a few prints, we found that
> omap_iommu_init() sets a bus notifier for the platform bus type:
>
> omap_iommu_init -> bus_set_iommu -> iommu_bus_init:
>
> static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
> {
> bus_register_notifier(bus, &iommu_bus_nb);
> bus_for_each_dev(bus, NULL, ops, add_iommu_group);
> }
>
> But the iommu bus notifier gets called for the 'pci' bus type, which
> has the iommu_ops field NULL (since it hasn't been set for iommu).
So this is what needs to be figured out, how is the notifier being
called with a PCI device? Who else called iommu_bus_init() for the PCI
bus?
thanks,
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>,
Joerg Roedel <joro@8bytes.org>,
Hiroshi.DOYU@nokia.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Paolo Pisati <p.pisati@gmail.com>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Florian Vaussard <florian.vaussard@epfl.ch>,
linux-arm-kernel@lists.infradead.org
Subject: Re: 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel
Date: Mon, 7 Jul 2014 11:30:02 -0700 [thread overview]
Message-ID: <20140707183002.GA5947@kroah.com> (raw)
In-Reply-To: <20140707105818.GA1101@arch.cereza>
On Mon, Jul 07, 2014 at 07:58:18AM -0300, Ezequiel Garcia wrote:
> On 05 Jul 01:59 PM, Greg Kroah-Hartman wrote:
> > On Sat, Jul 05, 2014 at 12:03:08PM -0300, Ezequiel Garcia wrote:
> > > After following Gregory's stacktrace (also reproduced here):
> > >
> > > [<c02451f8>] (iommu_bus_notifier) from [<c00512e8>] (notifier_call_chain+0x64/0x9c)
> > > [<c00512e8>] (notifier_call_chain) from [<c00514cc>] (__blocking_notifier_call_chain+0x40/0x58)
> > > [<c00514cc>] (__blocking_notifier_call_chain) from [<c00514f8>] (blocking_notifier_call_chain+0x14/0x1c)
> > > [<c00514f8>] (blocking_notifier_call_chain) from [<c01d225c>] (device_add+0x424/0x524)
> > > [<c01d225c>] (device_add) from [<c0186d90>] (pci_device_add+0xec/0x110)
> > > [<c0186d90>] (pci_device_add) from [<c0186e54>] (pci_scan_single_device+0xa0/0xac)
> > >
> > > I added a few printks and found that the problem is that the iommu_bus_notifier is
> > > called for the 'pci' bus type, which has a null iommu_ops.
> > >
> > > On 04 Jul 10:47 AM, Laurent Pinchart wrote:
> > > [..]
> > > >
> > > > We need a quick fix for v3.16, ...
> > >
> > > Therefore, a quick fix would be to simply check for that:
> > >
> > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> > > index e5555fc..b712cb2 100644
> > > --- a/drivers/iommu/iommu.c
> > > +++ b/drivers/iommu/iommu.c
> > > @@ -536,6 +536,9 @@ static int iommu_bus_notifier(struct notifier_block *nb,
> > > struct iommu_group *group;
> > > unsigned long group_action = 0;
> > >
> > > + if (!ops)
> > > + return 0;
> > > +
> > > /*
> > > * ADD/DEL call into iommu driver ops if provided, which may
> > > * result in ADD/DEL notifiers to group->notifier
> > >
> > > This (nasty workaround?) patch makes the problem go away.
> > >
> > > [..]
> > > > > So it also boot well in 3.15 and then failed in 3.16-rc3. I hope it will
> > > > > help the developers of the OMAP IOMMU driver to fix it.
> > > >
> > > > Thank you. I've had a look at the OMAP IOMMU driver changes between v3.15 and
> > > > v3.16-rc3, and didn't find at first sight any change that could explain the
> > > > crash.
> > > >
> > > > 286f600 iommu/omap: Fix map protection value handling
> > > > 67b779d iommu/omap: Remove comment about supporting single page mappings only
> > > > f7129a0 iommu/omap: Fix 'no page for' debug message in flush_iotlb_page()
> > > > 5acc97d iommu/omap: Move to_iommu definition from omap-iopgtable.h
> > > > 2ac6133 iommu/omap: Remove omap_iommu_domain_has_cap() function
> > > > d760e3e iommu/omap: Correct init value of iotlb_entry valid field
> > > >
> > > > Could you try reverting those changes and retest ? If the problem doesn't
> > > > disappear, we'll need to look somewhere else.
> > > >
> > >
> > > I reverted the above commits but nothing changed. I'm far from being an expert,
> > > but it sounds odd to have this bus notifier (that got registered for the
> > > platform bus type) called by a pci bus type.
> >
> > Why wouldn't the PCI bus set this up for its devices? Are you
> > "assuming" you know the bus type and that's the issue?
> >
>
> Thanks for looking at this.
>
> I guess I snipped the thread and lost most of the information about the panic.
> Here's the original bug report:
>
> http://www.spinics.net/lists/arm-kernel/msg344059.html
>
> The problem reported involves enabling OMAP IOMMU driver and not any other IOMMU
> driver. Doing some tracing and adding a few prints, we found that
> omap_iommu_init() sets a bus notifier for the platform bus type:
>
> omap_iommu_init -> bus_set_iommu -> iommu_bus_init:
>
> static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
> {
> bus_register_notifier(bus, &iommu_bus_nb);
> bus_for_each_dev(bus, NULL, ops, add_iommu_group);
> }
>
> But the iommu bus notifier gets called for the 'pci' bus type, which
> has the iommu_ops field NULL (since it hasn't been set for iommu).
So this is what needs to be figured out, how is the notifier being
called with a PCI device? Who else called iommu_bus_init() for the PCI
bus?
thanks,
greg k-h
next prev parent reply other threads:[~2014-07-07 18:30 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
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 [this message]
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=20140707183002.GA5947@kroah.com \
--to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
--cc=Hiroshi.DOYU-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=florian.vaussard-p8DiymsW2f8@public.gmane.org \
--cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=p.pisati-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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.