All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: David Ahern <david.ahern@oracle.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: d63e2e1f3df breaks sparc/T5-8
Date: Fri, 27 Mar 2015 20:19:09 -0700	[thread overview]
Message-ID: <CAE9FiQXpNKrX9BuC5-sgb8XEdFPN1a-wBRR2XqY5Mh1cnhXSPQ@mail.gmail.com> (raw)
In-Reply-To: <5515F782.7060301@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Fri, Mar 27, 2015 at 5:36 PM, David Ahern <david.ahern@oracle.com> wrote:
>>>
>>>> Also please make sure your config have
>>>>
>>>> CONFIG_PCI_DEBUG=y
>>>>
>>>> and capture serial console with "debug ignore_loglevel", so we check if
>>>> pci 0000:00:01.0 really have resource assigned.
>>>
>>>
>>> Please check attached patch and send out boot log with above config.
>>
>>
>> patched applied. PCI_DEBUG enabled. options added. log attached. This is
>> with d63e2e1f3df reverted still.
>>
>
> oops lied about that last one; I forgot to revert the patch this round. That
> the system booted with it applied is progress.

Good. But we still have annoying warning about "no compatible window".

Please try attached patch that support 64bit pci mem space for sparc.

BTW, looks like you still do not have   CONFIG_PCI_DEBUG=y in your .config.
otherwise we should more verbose print out.
Or did you have DYNAMIC_DEBUG enabled ?
If it is that case, can you remove that?

Thanks

Yinghai

[-- Attachment #2: sparc_sun4v_mem64.patch --]
[-- Type: text/x-patch, Size: 3483 bytes --]

Subject: [RFC PATCH] sparc/PCI: Add mem64 resource parsing for root bus

Found no compatible bridge window warning in boot log from T5-8.

pci 0000:00:01.0: can't claim BAR 15 [mem 0x100000000-0x4afffffff pref]: no compatible bridge window

and root bus only report io and mem32.

pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io  0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
pci_bus 0000:00: root bus resource [bus 00-77]

Add mem64 handling in pci_common for sparc, so we can have 64bit resource
registered for bus at first.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/sparc/kernel/pci.c        |    3 +++
 arch/sparc/kernel/pci_common.c |   15 +++++++++++++--
 arch/sparc/kernel/pci_impl.h   |    1 +
 3 files changed, 17 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/sparc/kernel/pci.c
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci.c
+++ linux-2.6/arch/sparc/kernel/pci.c
@@ -663,6 +663,9 @@ struct pci_bus *pci_scan_one_pbm(struct
 				pbm->io_space.start);
 	pci_add_resource_offset(&resources, &pbm->mem_space,
 				pbm->mem_space.start);
+	if (pbm->mem64_space.flags)
+		pci_add_resource_offset(&resources, &pbm->mem64_space,
+					pbm->mem64_space.start);
 	pbm->busn.start = pbm->pci_first_busno;
 	pbm->busn.end	= pbm->pci_last_busno;
 	pbm->busn.flags	= IORESOURCE_BUS;
Index: linux-2.6/arch/sparc/kernel/pci_common.c
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci_common.c
+++ linux-2.6/arch/sparc/kernel/pci_common.c
@@ -406,6 +406,7 @@ void pci_determine_mem_io_space(struct p
 	}
 
 	num_pbm_ranges = i / sizeof(*pbm_ranges);
+	memset(&pbm->mem64_space, 0, sizeof(struct resource));
 
 	for (i = 0; i < num_pbm_ranges; i++) {
 		const struct linux_prom_pci_ranges *pr = &pbm_ranges[i];
@@ -451,7 +452,11 @@ void pci_determine_mem_io_space(struct p
 			break;
 
 		case 3:
-			/* XXX 64-bit MEM handling XXX */
+			/* 64-bit MEM handling */
+			pbm->mem64_space.start = a;
+			pbm->mem64_space.end = a + size - 1UL;
+			pbm->mem64_space.flags = IORESOURCE_MEM;
+			break;
 
 		default:
 			break;
@@ -465,15 +470,21 @@ void pci_determine_mem_io_space(struct p
 		prom_halt();
 	}
 
-	printk("%s: PCI IO[%llx] MEM[%llx]\n",
+	printk("%s: PCI IO[%llx] MEM[%llx]",
 	       pbm->name,
 	       pbm->io_space.start,
 	       pbm->mem_space.start);
+	if (pbm->mem64_space.flags)
+		printk(" MEM64[%llx]",
+		       pbm->mem64_space.start);
+	printk("\n");
 
 	pbm->io_space.name = pbm->mem_space.name = pbm->name;
 
 	request_resource(&ioport_resource, &pbm->io_space);
 	request_resource(&iomem_resource, &pbm->mem_space);
+	if (pbm->mem64_space.flags)
+		request_resource(&iomem_resource, &pbm->mem64_space);
 
 	pci_register_legacy_regions(&pbm->io_space,
 				    &pbm->mem_space);
Index: linux-2.6/arch/sparc/kernel/pci_impl.h
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci_impl.h
+++ linux-2.6/arch/sparc/kernel/pci_impl.h
@@ -97,6 +97,7 @@ struct pci_pbm_info {
 	/* PBM I/O and Memory space resources. */
 	struct resource			io_space;
 	struct resource			mem_space;
+	struct resource			mem64_space;
 	struct resource			busn;
 
 	/* Base of PCI Config space, can be per-PBM or shared. */

WARNING: multiple messages have this Message-ID (diff)
From: Yinghai Lu <yinghai@kernel.org>
To: David Ahern <david.ahern@oracle.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: d63e2e1f3df breaks sparc/T5-8
Date: Sat, 28 Mar 2015 03:19:09 +0000	[thread overview]
Message-ID: <CAE9FiQXpNKrX9BuC5-sgb8XEdFPN1a-wBRR2XqY5Mh1cnhXSPQ@mail.gmail.com> (raw)
In-Reply-To: <5515F782.7060301@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Fri, Mar 27, 2015 at 5:36 PM, David Ahern <david.ahern@oracle.com> wrote:
>>>
>>>> Also please make sure your config have
>>>>
>>>> CONFIG_PCI_DEBUG=y
>>>>
>>>> and capture serial console with "debug ignore_loglevel", so we check if
>>>> pci 0000:00:01.0 really have resource assigned.
>>>
>>>
>>> Please check attached patch and send out boot log with above config.
>>
>>
>> patched applied. PCI_DEBUG enabled. options added. log attached. This is
>> with d63e2e1f3df reverted still.
>>
>
> oops lied about that last one; I forgot to revert the patch this round. That
> the system booted with it applied is progress.

Good. But we still have annoying warning about "no compatible window".

Please try attached patch that support 64bit pci mem space for sparc.

BTW, looks like you still do not have   CONFIG_PCI_DEBUG=y in your .config.
otherwise we should more verbose print out.
Or did you have DYNAMIC_DEBUG enabled ?
If it is that case, can you remove that?

Thanks

Yinghai

[-- Attachment #2: sparc_sun4v_mem64.patch --]
[-- Type: text/x-patch, Size: 3483 bytes --]

Subject: [RFC PATCH] sparc/PCI: Add mem64 resource parsing for root bus

Found no compatible bridge window warning in boot log from T5-8.

pci 0000:00:01.0: can't claim BAR 15 [mem 0x100000000-0x4afffffff pref]: no compatible bridge window

and root bus only report io and mem32.

pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io  0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
pci_bus 0000:00: root bus resource [bus 00-77]

Add mem64 handling in pci_common for sparc, so we can have 64bit resource
registered for bus at first.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/sparc/kernel/pci.c        |    3 +++
 arch/sparc/kernel/pci_common.c |   15 +++++++++++++--
 arch/sparc/kernel/pci_impl.h   |    1 +
 3 files changed, 17 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/sparc/kernel/pci.c
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci.c
+++ linux-2.6/arch/sparc/kernel/pci.c
@@ -663,6 +663,9 @@ struct pci_bus *pci_scan_one_pbm(struct
 				pbm->io_space.start);
 	pci_add_resource_offset(&resources, &pbm->mem_space,
 				pbm->mem_space.start);
+	if (pbm->mem64_space.flags)
+		pci_add_resource_offset(&resources, &pbm->mem64_space,
+					pbm->mem64_space.start);
 	pbm->busn.start = pbm->pci_first_busno;
 	pbm->busn.end	= pbm->pci_last_busno;
 	pbm->busn.flags	= IORESOURCE_BUS;
Index: linux-2.6/arch/sparc/kernel/pci_common.c
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci_common.c
+++ linux-2.6/arch/sparc/kernel/pci_common.c
@@ -406,6 +406,7 @@ void pci_determine_mem_io_space(struct p
 	}
 
 	num_pbm_ranges = i / sizeof(*pbm_ranges);
+	memset(&pbm->mem64_space, 0, sizeof(struct resource));
 
 	for (i = 0; i < num_pbm_ranges; i++) {
 		const struct linux_prom_pci_ranges *pr = &pbm_ranges[i];
@@ -451,7 +452,11 @@ void pci_determine_mem_io_space(struct p
 			break;
 
 		case 3:
-			/* XXX 64-bit MEM handling XXX */
+			/* 64-bit MEM handling */
+			pbm->mem64_space.start = a;
+			pbm->mem64_space.end = a + size - 1UL;
+			pbm->mem64_space.flags = IORESOURCE_MEM;
+			break;
 
 		default:
 			break;
@@ -465,15 +470,21 @@ void pci_determine_mem_io_space(struct p
 		prom_halt();
 	}
 
-	printk("%s: PCI IO[%llx] MEM[%llx]\n",
+	printk("%s: PCI IO[%llx] MEM[%llx]",
 	       pbm->name,
 	       pbm->io_space.start,
 	       pbm->mem_space.start);
+	if (pbm->mem64_space.flags)
+		printk(" MEM64[%llx]",
+		       pbm->mem64_space.start);
+	printk("\n");
 
 	pbm->io_space.name = pbm->mem_space.name = pbm->name;
 
 	request_resource(&ioport_resource, &pbm->io_space);
 	request_resource(&iomem_resource, &pbm->mem_space);
+	if (pbm->mem64_space.flags)
+		request_resource(&iomem_resource, &pbm->mem64_space);
 
 	pci_register_legacy_regions(&pbm->io_space,
 				    &pbm->mem_space);
Index: linux-2.6/arch/sparc/kernel/pci_impl.h
===================================================================
--- linux-2.6.orig/arch/sparc/kernel/pci_impl.h
+++ linux-2.6/arch/sparc/kernel/pci_impl.h
@@ -97,6 +97,7 @@ struct pci_pbm_info {
 	/* PBM I/O and Memory space resources. */
 	struct resource			io_space;
 	struct resource			mem_space;
+	struct resource			mem64_space;
 	struct resource			busn;
 
 	/* Base of PCI Config space, can be per-PBM or shared. */

  reply	other threads:[~2015-03-28  3:19 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 16:51 d63e2e1f3df breaks sparc/T5-8 David Ahern
2015-03-26 16:51 ` David Ahern
2015-03-26 20:43 ` Yinghai Lu
2015-03-26 20:43   ` Yinghai Lu
2015-03-26 23:27   ` David Ahern
2015-03-26 23:27     ` David Ahern
2015-03-27 21:01     ` Yinghai Lu
2015-03-27 21:01       ` Yinghai Lu
2015-03-27 21:50       ` David Miller
2015-03-27 21:50         ` David Miller
2015-03-27 22:51         ` Yinghai Lu
2015-03-27 22:51           ` Yinghai Lu
2015-03-29 13:30         ` Bjorn Helgaas
2015-03-29 18:32           ` David Miller
2015-03-29 18:32             ` David Miller
2015-04-03 15:45             ` Bjorn Helgaas
2015-04-03 15:45               ` Bjorn Helgaas
2015-04-03 16:48               ` David Miller
2015-04-03 16:48                 ` David Miller
2015-03-27 23:57       ` Yinghai Lu
2015-03-27 23:57         ` Yinghai Lu
2015-03-28  0:32         ` David Ahern
2015-03-28  0:32           ` David Ahern
2015-03-28  0:36           ` David Ahern
2015-03-28  0:36             ` David Ahern
2015-03-28  3:19             ` Yinghai Lu [this message]
2015-03-28  3:19               ` Yinghai Lu
2015-03-28  3:22               ` David Ahern
2015-03-28  3:22                 ` David Ahern
2015-03-28  3:27                 ` Yinghai Lu
2015-03-28  3:27                   ` Yinghai Lu
2015-03-28  3:45               ` David Ahern
2015-03-28  3:45                 ` David Ahern
2015-03-28  5:26                 ` Yinghai Lu
2015-03-28  5:26                   ` Yinghai Lu
2015-03-28 14:48                   ` David Ahern
2015-03-28 14:48                     ` David Ahern
2015-03-28 20:24                     ` Yinghai Lu
2015-03-28 20:24                       ` Yinghai Lu
2015-03-29 14:47                       ` David Ahern
2015-03-29 14:47                         ` David Ahern
2015-03-29 20:07                         ` Yinghai Lu
2015-03-29 20:07                           ` Yinghai Lu
2015-03-30 22:54                           ` David Ahern
2015-03-30 22:54                             ` David Ahern
2015-03-31  1:06                             ` Yinghai Lu
2015-03-31  1:06                               ` Yinghai Lu
2015-03-31  4:10                               ` David Ahern
2015-03-31  4:10                                 ` David Ahern
2015-03-31 16:53                                 ` Yinghai Lu
2015-03-31 16:53                                   ` Yinghai Lu
2015-03-31 17:04                                   ` David Ahern
2015-03-31 17:04                                     ` David Ahern
2015-03-31 20:28                                     ` Yinghai Lu
2015-03-31 20:28                                       ` Yinghai Lu
2015-03-31 22:29                                       ` David Ahern
2015-03-31 22:29                                         ` David Ahern
2015-03-31 22:38                                         ` Yinghai Lu
2015-03-31 22:38                                           ` Yinghai Lu
2015-03-31 22:42                                           ` David Ahern
2015-03-31 22:42                                             ` David Ahern
2015-03-31 15:06                               ` David Miller
2015-03-31 15:06                                 ` David Miller
2015-03-31 18:16                                 ` Yinghai Lu
2015-03-31 18:16                                   ` Yinghai Lu
2015-03-31 18:19                                   ` David Miller
2015-03-31 18:19                                     ` David Miller
2015-03-31 18:19                                     ` David Miller
2015-03-31 18:25                                     ` Yinghai Lu
2015-03-31 18:25                                       ` Yinghai Lu
2015-03-28  1:05         ` Sam Ravnborg
2015-03-28  1:05           ` Sam Ravnborg
2015-03-28  2:07           ` Yinghai Lu
2015-03-28  2:07             ` Yinghai Lu
2015-03-28  8:18             ` Sam Ravnborg
2015-03-28  8:18               ` Sam Ravnborg
2015-03-28 18:16         ` David Miller
2015-03-28 18:16           ` David Miller
2015-03-28 20:19           ` Yinghai Lu
2015-03-28 20:19             ` Yinghai Lu

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=CAE9FiQXpNKrX9BuC5-sgb8XEdFPN1a-wBRR2XqY5Mh1cnhXSPQ@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=david.ahern@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sparclinux@vger.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.