diff mbox

[v2,2/2] PCI: of: Ignore resources with failed translation

Message ID 3604931244806840dd12ff9663671b52d2acd951.1444288748.git.p.fedin@samsung.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Pavel Fedin Oct. 8, 2015, 7:24 a.m. UTC
This patch allows PCI host controller to function even if part of resources
is unusable for some reason. An example is non-LPAE kernel on a machine
which has some 64-bit resources. Unusable resources will be just skipped
instead of a complete failure.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
---
 drivers/of/of_pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Rob Herring Oct. 13, 2015, 8:10 p.m. UTC | #1
On Thu, Oct 8, 2015 at 2:24 AM, Pavel Fedin <p.fedin@samsung.com> wrote:
> This patch allows PCI host controller to function even if part of resources
> is unusable for some reason. An example is non-LPAE kernel on a machine
> which has some 64-bit resources. Unusable resources will be just skipped
> instead of a complete failure.
>
> Signed-off-by: Pavel Fedin <p.fedin@samsung.com>

Applied, thanks.

Rob

> ---
>  drivers/of/of_pci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
> index 5751dc5..ea7c2b6 100644
> --- a/drivers/of/of_pci.c
> +++ b/drivers/of/of_pci.c
> @@ -223,8 +223,10 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
>                 }
>
>                 err = of_pci_range_to_resource(&range, dev, res);
> -               if (err)
> -                       goto conversion_failed;
> +               if (err) {
> +                       kfree(res);
> +                       continue;
> +               }
>
>                 if (resource_type(res) == IORESOURCE_IO) {
>                         if (!io_base) {
> --
> 2.4.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
diff mbox

Patch

diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
index 5751dc5..ea7c2b6 100644
--- a/drivers/of/of_pci.c
+++ b/drivers/of/of_pci.c
@@ -223,8 +223,10 @@  int of_pci_get_host_bridge_resources(struct device_node *dev,
 		}
 
 		err = of_pci_range_to_resource(&range, dev, res);
-		if (err)
-			goto conversion_failed;
+		if (err) {
+			kfree(res);
+			continue;
+		}
 
 		if (resource_type(res) == IORESOURCE_IO) {
 			if (!io_base) {