All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] MIPS: Loongson: Remove unused PCI_BAR_COUNT definition
@ 2017-05-19 19:55 Bjorn Helgaas
  2017-05-19 19:56 ` [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2017-05-19 19:55 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-mips, Joshua Kinard, Ralf Baechle, linux-kernel

Remove unused PCI_BAR_COUNT definition.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 .../asm/mach-loongson64/cs5536/cs5536_pci.h        |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/include/asm/mach-loongson64/cs5536/cs5536_pci.h b/arch/mips/include/asm/mach-loongson64/cs5536/cs5536_pci.h
index 8a7ecb4d5c64..bf9dd9eb4ceb 100644
--- a/arch/mips/include/asm/mach-loongson64/cs5536/cs5536_pci.h
+++ b/arch/mips/include/asm/mach-loongson64/cs5536/cs5536_pci.h
@@ -80,7 +80,6 @@ extern u32 cs5536_pci_conf_read4(int function, int reg);
 #define PCI_BAR3_REG			0x1c
 #define PCI_BAR4_REG			0x20
 #define PCI_BAR5_REG			0x24
-#define PCI_BAR_COUNT			6
 #define PCI_BAR_RANGE_MASK		0xFFFFFFFF
 
 /* CARDBUS CIS POINTER */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset
  2017-05-19 19:55 [PATCH v1 1/2] MIPS: Loongson: Remove unused PCI_BAR_COUNT definition Bjorn Helgaas
@ 2017-05-19 19:56 ` Bjorn Helgaas
  2017-05-24 21:42   ` Bjorn Helgaas
  2017-06-11  1:14   ` Joshua Kinard
  0 siblings, 2 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2017-05-19 19:56 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-mips, Joshua Kinard, Ralf Baechle, linux-kernel

pci_add_resource_offset() is for host bridge windows where the bridge
translates CPU addresses to PCI bus addresses by adding an offset.  To my
knowledge, no host bridge translates bus numbers, so this is only useful
for MEM and IO windows.  In any event, host->busn_offset is never set to
anything other than zero, so pci_add_resource() is sufficient.

a2e50f53d535 ("MIPS: PCI: Add a hook for IORESOURCE_BUS in
pci_controller/bridge_controller") also added busn_resource itself.  This
is currently unused but may be used by future SGI IP27 fixes, so I left it
there.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Joshua Kinard <kumba@gentoo.org>
---
 arch/mips/include/asm/pci.h |    1 -
 arch/mips/pci/pci-legacy.c  |    3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 1000c1b4c875..52f551ee492d 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -39,7 +39,6 @@ struct pci_controller {
 	unsigned long io_offset;
 	unsigned long io_map_base;
 	struct resource *busn_resource;
-	unsigned long busn_offset;
 
 #ifndef CONFIG_PCI_DOMAINS_GENERIC
 	unsigned int index;
diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c
index 3a84f6c0c840..174575a9a112 100644
--- a/arch/mips/pci/pci-legacy.c
+++ b/arch/mips/pci/pci-legacy.c
@@ -86,8 +86,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
 				hose->mem_resource, hose->mem_offset);
 	pci_add_resource_offset(&resources,
 				hose->io_resource, hose->io_offset);
-	pci_add_resource_offset(&resources,
-				hose->busn_resource, hose->busn_offset);
+	pci_add_resource(&resources, hose->busn_resource);
 	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
 				&resources);
 	hose->bus = bus;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset
  2017-05-19 19:56 ` [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset Bjorn Helgaas
@ 2017-05-24 21:42   ` Bjorn Helgaas
  2017-06-11  1:14   ` Joshua Kinard
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2017-05-24 21:42 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-mips, Joshua Kinard, Ralf Baechle, linux-kernel

On Fri, May 19, 2017 at 02:56:06PM -0500, Bjorn Helgaas wrote:
> pci_add_resource_offset() is for host bridge windows where the bridge
> translates CPU addresses to PCI bus addresses by adding an offset.  To my
> knowledge, no host bridge translates bus numbers, so this is only useful
> for MEM and IO windows.  In any event, host->busn_offset is never set to
> anything other than zero, so pci_add_resource() is sufficient.
> 
> a2e50f53d535 ("MIPS: PCI: Add a hook for IORESOURCE_BUS in
> pci_controller/bridge_controller") also added busn_resource itself.  This
> is currently unused but may be used by future SGI IP27 fixes, so I left it
> there.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> CC: Joshua Kinard <kumba@gentoo.org>

I applied both of these to pci/misc for v4.13.

> ---
>  arch/mips/include/asm/pci.h |    1 -
>  arch/mips/pci/pci-legacy.c  |    3 +--
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index 1000c1b4c875..52f551ee492d 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -39,7 +39,6 @@ struct pci_controller {
>  	unsigned long io_offset;
>  	unsigned long io_map_base;
>  	struct resource *busn_resource;
> -	unsigned long busn_offset;
>  
>  #ifndef CONFIG_PCI_DOMAINS_GENERIC
>  	unsigned int index;
> diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c
> index 3a84f6c0c840..174575a9a112 100644
> --- a/arch/mips/pci/pci-legacy.c
> +++ b/arch/mips/pci/pci-legacy.c
> @@ -86,8 +86,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
>  				hose->mem_resource, hose->mem_offset);
>  	pci_add_resource_offset(&resources,
>  				hose->io_resource, hose->io_offset);
> -	pci_add_resource_offset(&resources,
> -				hose->busn_resource, hose->busn_offset);
> +	pci_add_resource(&resources, hose->busn_resource);
>  	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
>  				&resources);
>  	hose->bus = bus;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset
  2017-05-19 19:56 ` [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset Bjorn Helgaas
  2017-05-24 21:42   ` Bjorn Helgaas
@ 2017-06-11  1:14   ` Joshua Kinard
  1 sibling, 0 replies; 4+ messages in thread
From: Joshua Kinard @ 2017-06-11  1:14 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci; +Cc: linux-mips, Ralf Baechle, linux-kernel

On 05/19/2017 15:56, Bjorn Helgaas wrote:
> pci_add_resource_offset() is for host bridge windows where the bridge
> translates CPU addresses to PCI bus addresses by adding an offset.  To my
> knowledge, no host bridge translates bus numbers, so this is only useful
> for MEM and IO windows.  In any event, host->busn_offset is never set to
> anything other than zero, so pci_add_resource() is sufficient.
> 
> a2e50f53d535 ("MIPS: PCI: Add a hook for IORESOURCE_BUS in
> pci_controller/bridge_controller") also added busn_resource itself.  This
> is currently unused but may be used by future SGI IP27 fixes, so I left it
> there.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> CC: Joshua Kinard <kumba@gentoo.org>
> ---
>  arch/mips/include/asm/pci.h |    1 -
>  arch/mips/pci/pci-legacy.c  |    3 +--
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index 1000c1b4c875..52f551ee492d 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -39,7 +39,6 @@ struct pci_controller {
>  	unsigned long io_offset;
>  	unsigned long io_map_base;
>  	struct resource *busn_resource;
> -	unsigned long busn_offset;
>  
>  #ifndef CONFIG_PCI_DOMAINS_GENERIC
>  	unsigned int index;
> diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c
> index 3a84f6c0c840..174575a9a112 100644
> --- a/arch/mips/pci/pci-legacy.c
> +++ b/arch/mips/pci/pci-legacy.c
> @@ -86,8 +86,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
>  				hose->mem_resource, hose->mem_offset);
>  	pci_add_resource_offset(&resources,
>  				hose->io_resource, hose->io_offset);
> -	pci_add_resource_offset(&resources,
> -				hose->busn_resource, hose->busn_offset);
> +	pci_add_resource(&resources, hose->busn_resource);
>  	bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
>  				&resources);
>  	hose->bus = bus;
> 
> 

I tested this change out on my Octane (SGI-IP30) and Origin 200 (SGI-IP27), and
it appears to work fine on both systems (for now).

The Octane has two PCI host bridges in it right now (BaseIO & PCI Card cage),
while the Origin 200 only has one.  Haven't tested it on my bigger Onyx2 w/
multiple host bridges, but that machine has other problems, so I am ignoring it
for now.

I wasn't aware that pci_add_resource existed back when I wrote the patch.  The
symptom that was addressed was some conditional in the PCI core -- I forget
where -- wasn't enumerating multiple PCI busses without having an
IORESOURCE_BUS struct passed to it.  I think it found the first bus and then
moved on to other subsystems, which usually led to a non-booting machine.

Acked-by: Joshua Kinard <kumba@gentoo.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-11  1:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 19:55 [PATCH v1 1/2] MIPS: Loongson: Remove unused PCI_BAR_COUNT definition Bjorn Helgaas
2017-05-19 19:56 ` [PATCH v1 2/2] MIPS: PCI: Remove unused busn_offset Bjorn Helgaas
2017-05-24 21:42   ` Bjorn Helgaas
2017-06-11  1:14   ` Joshua Kinard

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.