public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Paolo Pisati <p.pisati@gmail.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>,
	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: Tue, 8 Jul 2014 09:41:49 +0200	[thread overview]
Message-ID: <20140708094149.0ad6ab13@free-electrons.com> (raw)
In-Reply-To: <20140707233758.GA1456@arch.cereza>

Dear Ezequiel Garcia,

On Mon, 7 Jul 2014 20:37:58 -0300, Ezequiel Garcia wrote:

> It seems bus_register_notifier() is been called for platform and pci devices
> with the *same* notifier block. Haven't looked close enough, but you mentioned
> that could cause trouble?
> 
> This patch fixes the issue here:
> 
> diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
> index 477202f..2bdc323 100644
> --- a/arch/arm/mach-mvebu/coherency.c
> +++ b/arch/arm/mach-mvebu/coherency.c
> @@ -292,6 +292,10 @@ static struct notifier_block mvebu_hwcc_nb = {
>  	.notifier_call = mvebu_hwcc_notifier,
>  };
>  
> +static struct notifier_block mvebu_hwcc_pci_nb = {
> +	.notifier_call = mvebu_hwcc_notifier,
> +};
> +
>  static void __init armada_370_coherency_init(struct device_node *np)
>  {
>  	struct resource res;
> @@ -427,7 +431,7 @@ static int __init coherency_pci_init(void)
>  {
>  	if (coherency_available())
>  		bus_register_notifier(&pci_bus_type,
> -				       &mvebu_hwcc_nb);
> +				       &mvebu_hwcc_pci_nb);
>  	return 0;
>  }
>  
> Paolo, can you apply it and confirm it fixes the problem?
> 
> Greg, can you confirm using the same notifier block pointer
> for two different bus types makes the bus notifier go nuts?

Looking at how notifier_chain_register() is implemented (which gets
called by bus_register_notifier() ->
blocking_notifier_chain_register()), I indeed don't see how a single
'struct notifier_block' can be registered on multiple notifier chains,
so I believe your patch is correct.

Thanks for the investigation!

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

  parent reply	other threads:[~2014-07-08  7:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140703135146.GA6898@luxor.wired.org>
     [not found] ` <53B5C61D.2060308@free-electrons.com>
     [not found]   ` <53B5CA26.7050405@free-electrons.com>
     [not found]     ` <1936558.QaAG1bYMuD@avalon>
2014-07-05 15:03       ` 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel Ezequiel Garcia
2014-07-05 20:59         ` Greg Kroah-Hartman
2014-07-07 10:58           ` Ezequiel Garcia
2014-07-07 18:30             ` Greg Kroah-Hartman
2014-07-07 23:37               ` Ezequiel Garcia
2014-07-07 23:47                 ` Greg Kroah-Hartman
2014-07-08  7:41                 ` Thomas Petazzoni [this message]
2014-07-08  9:20                   ` Paolo Pisati
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=20140708094149.0ad6ab13@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=andrew@lunn.ch \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=florian.vaussard@epfl.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jason@lakedaemon.net \
    --cc=joro@8bytes.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.pisati@gmail.com \
    --cc=sebastian.hesselbarth@gmail.com \
    /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