All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3][UPDATE] ARM/PCI: claim bus resources on PCI_PROBE_ONLY set-ups
@ 2016-06-23 10:36 Lorenzo Pieralisi
  2016-06-23 16:30 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Pieralisi @ 2016-06-23 10:36 UTC (permalink / raw)
  To: linux-pci; +Cc: Lorenzo Pieralisi, Bjorn Helgaas, Russell King

The PCI bios API does not reassign bus resources on systems
that require the BARs set-up to be immutable (ie PCI_PROBE_ONLY) since
that would trigger system failures. Nonetheless, PCI bus resources
allocated to PCI bridge and devices must be claimed in order to be
validated and inserted in the kernel resource tree, but the current
code omits the resources claiming and relies on arch specific kludges
to prevent probing failure (ie preventing resources enablement on
PCI_PROBE_ONLY systems).

Add code to the ARM PCI bios kernel layer that correctly claims bus
resources upon probe on systems that are required to prevent
reassignment after bus enumeration, so that the allocated resources
can be enabled successfully upon PCI device drivers probing, without
resorting to arch back-ends workarounds.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Russell King <linux@armlinux.org.uk>
---
Hi Bjorn,

I put together this patch as requested, I could not test this
specific path but I do not really see how this patch would
affect any existing set-up.

It completes (and should be inserted as patch 2 or 3 for
bisection reasons) this series:

https://patchwork.ozlabs.org/patch/632161/

Please let me know if that's ok.

Thanks!
Lorenzo

 arch/arm/kernel/bios32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 488545f..1e05d04 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -515,7 +515,9 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
 	list_for_each_entry(sys, &head, node) {
 		struct pci_bus *bus = sys->bus;
 
-		if (!pci_has_flag(PCI_PROBE_ONLY)) {
+		if (pci_has_flag(PCI_PROBE_ONLY)) {
+			pci_bus_claim_resources(bus);
+		} else {
 			struct pci_bus *child;
 
 			/*
-- 
2.6.4


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

* Re: [PATCH v3][UPDATE] ARM/PCI: claim bus resources on PCI_PROBE_ONLY set-ups
  2016-06-23 10:36 [PATCH v3][UPDATE] ARM/PCI: claim bus resources on PCI_PROBE_ONLY set-ups Lorenzo Pieralisi
@ 2016-06-23 16:30 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2016-06-23 16:30 UTC (permalink / raw)
  To: Lorenzo Pieralisi; +Cc: linux-pci, Bjorn Helgaas, Russell King

On Thu, Jun 23, 2016 at 11:36:22AM +0100, Lorenzo Pieralisi wrote:
> The PCI bios API does not reassign bus resources on systems
> that require the BARs set-up to be immutable (ie PCI_PROBE_ONLY) since
> that would trigger system failures. Nonetheless, PCI bus resources
> allocated to PCI bridge and devices must be claimed in order to be
> validated and inserted in the kernel resource tree, but the current
> code omits the resources claiming and relies on arch specific kludges
> to prevent probing failure (ie preventing resources enablement on
> PCI_PROBE_ONLY systems).
> 
> Add code to the ARM PCI bios kernel layer that correctly claims bus
> resources upon probe on systems that are required to prevent
> reassignment after bus enumeration, so that the allocated resources
> can be enabled successfully upon PCI device drivers probing, without
> resorting to arch back-ends workarounds.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Russell King <linux@armlinux.org.uk>
> ---
> Hi Bjorn,
> 
> I put together this patch as requested, I could not test this
> specific path but I do not really see how this patch would
> affect any existing set-up.
> 
> It completes (and should be inserted as patch 2 or 3 for
> bisection reasons) this series:
> 
> https://patchwork.ozlabs.org/patch/632161/
> 
> Please let me know if that's ok.

Yes, this is exactly what I had in mind.  Then all the places that use
PCI_PROBE_ONLY will make sense when we look at them later.  I'll add
this to the series on pci/resource.

Thanks!

>  arch/arm/kernel/bios32.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index 488545f..1e05d04 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -515,7 +515,9 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
>  	list_for_each_entry(sys, &head, node) {
>  		struct pci_bus *bus = sys->bus;
>  
> -		if (!pci_has_flag(PCI_PROBE_ONLY)) {
> +		if (pci_has_flag(PCI_PROBE_ONLY)) {
> +			pci_bus_claim_resources(bus);
> +		} else {
>  			struct pci_bus *child;
>  
>  			/*
> -- 
> 2.6.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-06-23 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 10:36 [PATCH v3][UPDATE] ARM/PCI: claim bus resources on PCI_PROBE_ONLY set-ups Lorenzo Pieralisi
2016-06-23 16:30 ` Bjorn Helgaas

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.