From patchwork Wed Oct 7 10:49:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Fedin X-Patchwork-Id: 527249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8CEE11402B7 for ; Wed, 7 Oct 2015 21:50:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbbJGKt7 (ORCPT ); Wed, 7 Oct 2015 06:49:59 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:9903 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752008AbbJGKt5 (ORCPT ); Wed, 7 Oct 2015 06:49:57 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVU002JVJF6E960@mailout3.w1.samsung.com>; Wed, 07 Oct 2015 11:49:54 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-e5-5614f8d2e369 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 27.27.05269.2D8F4165; Wed, 7 Oct 2015 11:49:54 +0100 (BST) Received: from fedinw7x64.rnd.samsung.ru ([106.109.131.169]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NVU00JOXJE9II60@eusync4.samsung.com>; Wed, 07 Oct 2015 11:49:54 +0100 (BST) From: Pavel Fedin To: linux-pci@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Frank Rowand , Grant Likely , Peter Maydell Subject: [PATCH 2/2] PCI: of: Ignore resources with failed translation Date: Wed, 07 Oct 2015 13:49:21 +0300 Message-id: <4d98be5a58845f8ee0ffdbefb519486986f36bf5.1444214119.git.p.fedin@samsung.com> X-Mailer: git-send-email 2.4.4 In-reply-to: References: In-reply-to: References: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xa7qXfoiEGez+JGEx/8g5VouZb/6z WRz4s4PR4uy842wWc848YLFo3XuE3YHNY+esu+wem1Z1snncubaHzePzJrkAligum5TUnMyy 1CJ9uwSujPu7YwsesVX8u9DF3sC4nbWLkZNDQsBEYuamNcwQtpjEhXvr2boYuTiEBJYySlw8 2scK4bQxSfQ27mIEqWITUJc4/fUDC4gtImApsbvpNiNIEbPAQkaJLftmgBUJC7hJPFvZyw5i swioSpxcsQZoEgcHr0C0xMx/ARDb5CSuXJ/OBmJzCphL9E5pArtCSMBM4s3Zaey4xCcw8i9g ZFjFKJpamlxQnJSea6RXnJhbXJqXrpecn7uJERJwX3cwLj1mdYhRgINRiYf3h7FImBBrYllx Ze4hRgkOZiUR3sbvQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8M3e9DxESSE8sSc1OTS1ILYLJ MnFwSjUwem0K0bv5Ri7V/Mkx7SijqKTb3uvO603lUN2vcC7Vk6myevlB1YkLahitN4ikX/hp sGvt9fPx7Mo2No+rH69XrGJKMp50hjNfwPqslZxBRK7PNMuJ0YGLDi2tmccWGZt14fvb2E12 O/eWZK7YWO9pzlV/0Nojcv+eBIuLf91cZA6En3y6chmfEktxRqKhFnNRcSIAFHeTwjQCAAA= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- 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) {