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: 7344121
X-Patchwork-Delegate: bhelgaas@google.com
Return-Path:
X-Original-To: patchwork-linux-pci@patchwork.kernel.org
Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org
Received: from mail.kernel.org (mail.kernel.org [198.145.29.136])
by patchwork2.web.kernel.org (Postfix) with ESMTP id 38F1EBEEA4
for ;
Wed, 7 Oct 2015 10:50:04 +0000 (UTC)
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 7C56B20741
for ;
Wed, 7 Oct 2015 10:50:02 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.kernel.org (Postfix) with ESMTP id 760AC2074E
for ;
Wed, 7 Oct 2015 10:50:01 +0000 (UTC)
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
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI,
T_RP_MATCHES_RCVD,
UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
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) {