From patchwork Tue May 26 12:49:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6479661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E8F19F38C for ; Tue, 26 May 2015 12:53:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DE0B204A7 for ; Tue, 26 May 2015 12:53:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CA33205EC for ; Tue, 26 May 2015 12:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753009AbbEZMxB (ORCPT ); Tue, 26 May 2015 08:53:01 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:36461 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbbEZMw7 (ORCPT ); Tue, 26 May 2015 08:52:59 -0400 Received: by pdfh10 with SMTP id h10so90179593pdf.3 for ; Tue, 26 May 2015 05:50:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6ZZehvbpiGvErEF59suz1kivyLM0ApS4D2ix9Xgkmq4=; b=LQ1ARWoCdnR1P76Fw9an4P7xgstGgKbvmTmyU+gOEQ4/L0K+wN5xBB17LJydSXMA1c 862MKZXpPzDu0SyrY6aNP7I7UNfE10mRzI/lF/+SR6KwNjdhAf5l56Mde6XLTcvHcUaJ bYwJ+VyHKvFk4vfgyfDScGKVmEGHOEPftzoKH/XRCyH7NsNcQOpIEDFPsTAOYmpt6wop bTC1UoIkk8EP3KFJ1NJvkktr1yrA+D2ttaXg8XzZzbntLJ3s7wcwlSm2QM8SoZ0PjaGb MD/cpxIRDjIG8nO4OhuFTGGsEX9/q8oPo/zstGmyT84HDHgT3X7eJbGHTV7ImIEzswjM qiGA== X-Gm-Message-State: ALoCoQmLapOLVWJZQ/VpdYClw9OAqa8tbKNUCwrWb5vh8Z7ifZDoGhiBFoVX8fiObXbpnSt/ylTl X-Received: by 10.68.94.193 with SMTP id de1mr48191050pbb.153.1432644653260; Tue, 26 May 2015 05:50:53 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id fs16sm13066192pdb.12.2015.05.26.05.50.51 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 26 May 2015 05:50:52 -0700 (PDT) From: Hanjun Guo To: Bjorn Helgaas , Arnd Bergmann , Catalin Marinas , Will Deacon , "Rafael J. Wysocki" Cc: Jiang Liu , Liviu Dudau , Thomas Gleixner , Yijing Wang , Lorenzo Pieralisi , Tomasz Nowicki , Suravee Suthikulpanit , Mark Salter , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo , Konrad Rzeszutek Wilk , Boris Ostrovsky Subject: [PATCH 10/11] XEN / PCI: Remove the dependence on arch x86 when PCI_MMCONFIG=y Date: Tue, 26 May 2015 20:49:23 +0800 Message-Id: <1432644564-24746-11-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> References: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> 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=ham 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 In drivers/xen/pci.c, there are arch x86 dependent codes when CONFIG_PCI_MMCONFIG is enabled, since CONFIG_PCI_MMCONFIG depends on ACPI, so this will prevent XEN PCI running on other architectures using ACPI with PCI_MMCONFIG enabled (such as ARM64). Fortunatly, it can be sloved in a simple way. In drivers/xen/pci.c, the only x86 dependent code is if ((pci_probe & PCI_PROBE_MMCONF) == 0), and it's defined in asm/pci_x86.h, the code means that if the PCI resource is not probed in PCI_PROBE_MMCONF way, just ingnore the xen mcfg init. Actually this is duplicate, because if PCI resource is not probed in PCI_PROBE_MMCONF way, the pci_mmconfig_list will be empty, and the if (list_empty()) after it will do the same job. So just remove the arch related code and the head file, this will be no functional change for x86, and also makes xen/pci.c usable for other architectures. Signed-off-by: Hanjun Guo CC: Konrad Rzeszutek Wilk CC: Boris Ostrovsky --- drivers/xen/pci.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index 6785ebb..9a8dbe3 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -28,9 +28,6 @@ #include #include #include "../pci/pci.h" -#ifdef CONFIG_PCI_MMCONFIG -#include -#endif static bool __read_mostly pci_seg_supported = true; @@ -222,9 +219,6 @@ static int __init xen_mcfg_late(void) if (!xen_initial_domain()) return 0; - if ((pci_probe & PCI_PROBE_MMCONF) == 0) - return 0; - if (list_empty(&pci_mmcfg_list)) return 0;