From patchwork Sat Apr 27 09:12:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 2496901 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 102A23FC64 for ; Sat, 27 Apr 2013 09:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754461Ab3D0JQK (ORCPT ); Sat, 27 Apr 2013 05:16:10 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:59336 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754356Ab3D0JQJ (ORCPT ); Sat, 27 Apr 2013 05:16:09 -0400 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BBG66880; Sat, 27 Apr 2013 17:16:05 +0800 (CST) Received: from SZXEML412-HUB.china.huawei.com (10.82.67.91) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.1.323.7; Sat, 27 Apr 2013 17:13:20 +0800 Received: from localhost (10.135.76.69) by szxeml412-hub.china.huawei.com (10.82.67.91) with Microsoft SMTP Server id 14.1.323.7; Sat, 27 Apr 2013 17:13:14 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , Hanjun Guo , , Yijing Wang , Yinghai Lu , Jiang Liu , "Rafael J. Wysocki" , Feng Tang Subject: [PATCH 1/7] PCI/X86: fix always use info->res[0] to store _CRS resource when pci=nocrs set Date: Sat, 27 Apr 2013 17:12:23 +0800 Message-ID: <1367053949-38424-2-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 In-Reply-To: <1367053949-38424-1-git-send-email-wangyijing@huawei.com> References: <1367053949-38424-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.76.69] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We should increase info->res_num before checking pci_use_crs return, otherwise only the res[0] of pci_root_info will be used during setup_resource() when pci=nocrs set. And the old resource value will be overwritten by new resource item. Signed-off-by: Yijing Wang Cc: Yinghai Lu Cc: Jiang Liu Cc: "Rafael J. Wysocki" Cc: Feng Tang --- arch/x86/pci/acpi.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 3e72425..662dfdf 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -324,14 +324,11 @@ setup_resource(struct acpi_resource *acpi_res, void *data) res->start = start; res->end = end; info->res_offset[info->res_num] = addr.translation_offset; + info->res_num++; - if (!pci_use_crs) { + if (!pci_use_crs) dev_printk(KERN_DEBUG, &info->bridge->dev, "host bridge window %pR (ignored)\n", res); - return AE_OK; - } - - info->res_num++; return AE_OK; }