From patchwork Thu Oct 8 07:24:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Fedin X-Patchwork-Id: 527621 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 E2824140D87 for ; Thu, 8 Oct 2015 18:24:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742AbbJHHYj (ORCPT ); Thu, 8 Oct 2015 03:24:39 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:39229 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753730AbbJHHYf (ORCPT ); Thu, 8 Oct 2015 03:24:35 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVW003TH4KWT590@mailout4.w1.samsung.com>; Thu, 08 Oct 2015 08:24:32 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-6e-56161a3020d1 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 5E.FA.05269.03A16165; Thu, 8 Oct 2015 08:24:32 +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 <0NVW00AG84KQJI10@eusync4.samsung.com>; Thu, 08 Oct 2015 08:24:32 +0100 (BST) From: Pavel Fedin To: linux-pci@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Frank Rowand , Grant Likely Subject: [PATCH v2 2/2] PCI: of: Ignore resources with failed translation Date: Thu, 08 Oct 2015 10:24:26 +0300 Message-id: <3604931244806840dd12ff9663671b52d2acd951.1444288748.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+NgFprGLMWRmVeSWpSXmKPExsVy+t/xa7oGUmJhBnumalvMP3KO1WLmm/9s Fgf+7GC0ODvvOJtF694j7A6sHjtn3WX32LSqk83jzrU9bB6fN8kFsERx2aSk5mSWpRbp2yVw ZdzfHVvwiK3i34Uu9gbG7axdjJwcEgImEk/mXWWBsMUkLtxbz9bFyMUhJLCUUeL0gU5mkISQ QBuTxNKvuSA2m4C6xOmvH8AaRAQsJXY33WYEsZkFSiVWbVoMVi8s4Cmxe8sisAUsAqoSbfuu A9kcHLwC0RLPzxdC7JKTuHJ9OhtImFPAXOLVFUYQU0jATOLoD1nsohMY+RcwMqxiFE0tTS4o TkrPNdIrTswtLs1L10vOz93ECAmtrzsYlx6zOsQowMGoxMP7w1gkTIg1say4MvcQowQHs5II rwmXWJgQb0piZVVqUX58UWlOavEhRmkOFiVx3pm73ocICaQnlqRmp6YWpBbBZJk4OKUaGM9O ftZvmD79YfK1ua7fX6X23wpsZQp+90WVM700mdFZ3T9Ca/XnGXq+l5VUukUNj858phnBpvr0 QHOipEI8x/dDWVw/TaXbl7+JtHQRF9x0+Fuh/AvVBwHrvPZuXhQwa75h7nlnngm/Vt5vORqt Pyc7a9tvFc1gvnVbJ0zK0ttbenN9wczlq5RYijMSDbWYi4oTAeSp7AQpAgAA 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) {