All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"Zhu Richard-R65037" <r65037@freescale.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"tharvey@gateworks.com" <tharvey@gateworks.com>,
	Frank Li <lznuaa@gmail.com>, Sean Cross <xobs@kosagi.com>,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH v7 0/2] Add PCIe support for i.MX6q
Date: Fri, 11 Oct 2013 16:44:22 +0200	[thread overview]
Message-ID: <201310111644.22844.marex@denx.de> (raw)
In-Reply-To: <CAE9FiQXKgkwgzA0ciRyahObDHvnFtEJxzOhHRo6gytdeKQ-XQQ@mail.gmail.com>

Hi Yinghai,

> On Thu, Oct 10, 2013 at 7:18 PM, Marek Vasut <marex@denx.de> wrote:
> > And so does the probe log (but the pcieport failure still persists):
> > 
> > 
> > pci_bus 0000:04: bus scan returning with max=04
> > pci_bus 0000:04: busn_res: [bus 04-ff] end is updated to 04
> > pci_bus 0000:02: bus scan returning with max=04
> > pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 04
> > pci_bus 0000:01: bus scan returning with max=04
> > pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 04
> > pci_bus 0000:00: bus scan returning with max=04
> > pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 04
> > PCI: Device 0000:00:00.0 not available because of resource collisions
> > pcieport: probe of 0000:00:00.0 failed with error -22
> 
> load pcieport driver too early.

OK

[...]

> > pci_bus 0000:00: resource 4 [io  0x1000-0x10000]
> > pci_bus 0000:00: resource 5 [mem 0x01000000-0x01efffff]
> > pci_bus 0000:01: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:01: resource 1 [mem 0x01000000-0x01bfffff]
> > pci_bus 0000:02: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:02: resource 1 [mem 0x01000000-0x01bfffff]
> > pci_bus 0000:03: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:03: resource 1 [mem 0x01000000-0x01bfffff]
> 
> Looks your arch call pci_assign_unassigned_resources() too late.
> 
> you should have call it with fs_initcall()...

You're right, the pci_assign_unassigned_resources() is called from probe() call 
of the MX6 PCIe driver, which is called from module_init().

imx6_pcie_init() -> imx6_pcie_probe() -> imx6_add_pcie_port() -> 
dw_pcie_host_init() -> pci_assign_unassigned_resources()

> please try to boot with "debug ignore_loglevel initcall_debug" to sort out
> the initcall sequence.

Yes, probing the MX6 PCIe driver in fs_initcall() actually fixed my issues:

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 32b30ca..771892a 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c

@@ -587,7 +590,7 @@ static int __init imx6_pcie_init(void)
 {
        return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe);
 }                                                                                                                                                                          
-module_init(imx6_pcie_init);                                                                                                                                               
+fs_initcall(imx6_pcie_init);                                                                                                                                               
                                                                                                                                                                            
 MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>");                                                                                                                             
 MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver");

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 0/2] Add PCIe support for i.MX6q
Date: Fri, 11 Oct 2013 16:44:22 +0200	[thread overview]
Message-ID: <201310111644.22844.marex@denx.de> (raw)
In-Reply-To: <CAE9FiQXKgkwgzA0ciRyahObDHvnFtEJxzOhHRo6gytdeKQ-XQQ@mail.gmail.com>

Hi Yinghai,

> On Thu, Oct 10, 2013 at 7:18 PM, Marek Vasut <marex@denx.de> wrote:
> > And so does the probe log (but the pcieport failure still persists):
> > 
> > 
> > pci_bus 0000:04: bus scan returning with max=04
> > pci_bus 0000:04: busn_res: [bus 04-ff] end is updated to 04
> > pci_bus 0000:02: bus scan returning with max=04
> > pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 04
> > pci_bus 0000:01: bus scan returning with max=04
> > pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 04
> > pci_bus 0000:00: bus scan returning with max=04
> > pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 04
> > PCI: Device 0000:00:00.0 not available because of resource collisions
> > pcieport: probe of 0000:00:00.0 failed with error -22
> 
> load pcieport driver too early.

OK

[...]

> > pci_bus 0000:00: resource 4 [io  0x1000-0x10000]
> > pci_bus 0000:00: resource 5 [mem 0x01000000-0x01efffff]
> > pci_bus 0000:01: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:01: resource 1 [mem 0x01000000-0x01bfffff]
> > pci_bus 0000:02: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:02: resource 1 [mem 0x01000000-0x01bfffff]
> > pci_bus 0000:03: resource 0 [io  0x1000-0x1fff]
> > pci_bus 0000:03: resource 1 [mem 0x01000000-0x01bfffff]
> 
> Looks your arch call pci_assign_unassigned_resources() too late.
> 
> you should have call it with fs_initcall()...

You're right, the pci_assign_unassigned_resources() is called from probe() call 
of the MX6 PCIe driver, which is called from module_init().

imx6_pcie_init() -> imx6_pcie_probe() -> imx6_add_pcie_port() -> 
dw_pcie_host_init() -> pci_assign_unassigned_resources()

> please try to boot with "debug ignore_loglevel initcall_debug" to sort out
> the initcall sequence.

Yes, probing the MX6 PCIe driver in fs_initcall() actually fixed my issues:

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 32b30ca..771892a 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c

@@ -587,7 +590,7 @@ static int __init imx6_pcie_init(void)
 {
        return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe);
 }                                                                                                                                                                          
-module_init(imx6_pcie_init);                                                                                                                                               
+fs_initcall(imx6_pcie_init);                                                                                                                                               
                                                                                                                                                                            
 MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>");                                                                                                                             
 MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver");

Best regards,
Marek Vasut

  reply	other threads:[~2013-10-11 14:44 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26  3:24 [PATCH v7 0/2] Add PCIe support for i.MX6q Shawn Guo
2013-09-26  3:24 ` Shawn Guo
2013-09-26  3:24 ` [PATCH v7 1/2] ARM: imx6q: Add PCIe bits to GPR syscon definition Shawn Guo
2013-09-26  3:24   ` Shawn Guo
2013-09-26  3:24 ` [PATCH v7 2/2] PCI: imx6: Add support for i.MX6 PCIe controller Shawn Guo
2013-09-26  3:24   ` Shawn Guo
2013-09-27 19:24 ` [PATCH v7 0/2] Add PCIe support for i.MX6q Bjorn Helgaas
2013-09-27 19:24   ` Bjorn Helgaas
2013-09-28  6:56   ` Shawn Guo
2013-09-28  6:56     ` Shawn Guo
2013-10-08 20:56   ` Marek Vasut
2013-10-08 20:56     ` Marek Vasut
2013-10-09  5:23     ` Zhu Richard-R65037
2013-10-09  5:23       ` Zhu Richard-R65037
2013-10-10 10:25       ` Marek Vasut
2013-10-10 10:25         ` Marek Vasut
2013-10-10 10:40         ` Zhu Richard-R65037
2013-10-10 10:40           ` Zhu Richard-R65037
2013-10-10 12:59           ` Marek Vasut
2013-10-10 12:59             ` Marek Vasut
2013-10-10 20:33           ` Tim Harvey
2013-10-10 20:33             ` Tim Harvey
2013-10-10 20:40             ` Marek Vasut
2013-10-10 20:40               ` Marek Vasut
2013-10-10 13:27         ` Bjorn Helgaas
2013-10-10 13:27           ` Bjorn Helgaas
2013-10-10 13:43           ` Marek Vasut
2013-10-10 13:43             ` Marek Vasut
2013-10-10 15:58           ` Marek Vasut
2013-10-10 15:58             ` Marek Vasut
2013-10-10 17:17             ` Bjorn Helgaas
2013-10-10 17:17               ` Bjorn Helgaas
2013-10-10 17:39               ` Marek Vasut
2013-10-10 17:39                 ` Marek Vasut
2013-10-10 17:56                 ` Bjorn Helgaas
2013-10-10 17:56                   ` Bjorn Helgaas
2013-10-11  2:12                   ` [PATCH 1/2] PCI: imx6: Make reset-gpio optional Marek Vasut
2013-10-11  2:12                     ` Marek Vasut
2013-10-11  2:12                     ` [PATCH 2/2] PCI: imx6: Fix the clock for PCIe Marek Vasut
2013-10-11  2:12                       ` Marek Vasut
2013-10-11  7:20                       ` Jingoo Han
2013-10-11  7:20                         ` Jingoo Han
2013-10-11 11:55                         ` Marek Vasut
2013-10-11 11:55                           ` Marek Vasut
2013-10-12  7:13                           ` Shawn Guo
2013-10-12  7:13                             ` Shawn Guo
2013-10-11  7:09                     ` [PATCH 1/2] PCI: imx6: Make reset-gpio optional Jingoo Han
2013-10-11  7:09                       ` Jingoo Han
2013-10-12  7:20                     ` Shawn Guo
2013-10-12  7:20                       ` Shawn Guo
2013-10-12  9:28                       ` Marek Vasut
2013-10-12  9:28                         ` Marek Vasut
2013-10-14  0:02                         ` Jingoo Han
2013-10-14  0:02                           ` Jingoo Han
2013-10-14  0:44                           ` Marek Vasut
2013-10-14  0:44                             ` Marek Vasut
2013-10-14  1:17                             ` Marek Vasut
2013-10-14  1:17                               ` Marek Vasut
2013-10-14  2:33                               ` Jingoo Han
2013-10-14  2:33                                 ` Jingoo Han
2013-10-14  3:23                                 ` Marek Vasut
2013-10-14  3:23                                   ` Marek Vasut
2013-10-11  2:13                   ` [PATCH v7 0/2] Add PCIe support for i.MX6q Marek Vasut
2013-10-11  2:13                     ` Marek Vasut
2013-10-11  2:18                     ` Marek Vasut
2013-10-11  2:18                       ` Marek Vasut
2013-10-11  2:29                       ` Zhu Richard-R65037
2013-10-11  2:29                         ` Zhu Richard-R65037
2013-10-11  4:44                       ` Yinghai Lu
2013-10-11  4:44                         ` Yinghai Lu
2013-10-11 14:44                         ` Marek Vasut [this message]
2013-10-11 14:44                           ` Marek Vasut
2013-10-11 15:24                           ` Tim Harvey
2013-10-11 15:24                             ` Tim Harvey
2013-10-11 20:13                             ` Marek Vasut
2013-10-11 20:13                               ` Marek Vasut
2013-10-12  2:16                             ` Zhu Richard-R65037
2013-10-12  2:16                               ` Zhu Richard-R65037
2013-10-12  2:30                               ` Marek Vasut
2013-10-12  2:30                                 ` Marek Vasut

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=201310111644.22844.marex@denx.de \
    --to=marex@denx.de \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lznuaa@gmail.com \
    --cc=r65037@freescale.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=tharvey@gateworks.com \
    --cc=xobs@kosagi.com \
    --cc=yinghai@kernel.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.