From patchwork Wed Oct 15 03:06:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 38732 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2E8BD20973 for ; Wed, 15 Oct 2014 02:26:12 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf142660wgh.4 for ; Tue, 14 Oct 2014 19:26:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=431Z3RpTF6gp+4pJi5/GQsI4cYGCqVIZz1WtHcL8AhU=; b=FMIOxanCSteZCvgy2+c4BilmbuTDtF7m7tIwSoIZ5ffqxl6jh2Kpfc8tBUFnnjlyVM Pw7QNoCFUfApYYTMVzArpgWCRo4GHmkBOFQ59esoTtG2UVuA4AoQD/DUnHfy+Sr1F+7l af8difWRqpqTGcIjttAjFzTxjs7fluuJRtNSH5o7sBmr38188vLmNwtr3fFGyoJrizc8 A4KSRb/MFD5FIGsxeiOiinTY0GU1z61OwuuPX5AZOYfYj2YcaOBw+QK+gJJ68UN5hsYx MjSDkPme9L0fQ0fe/iDKzPLRzzpvcRPkL+feWKpeINeRDbCZD5wNzNsB8x8UPIUOOoeI dNFw== X-Gm-Message-State: ALoCoQnj37WFTn/1NxZN5MQ5mTrM+nh/ySpcej+IuXnSn4Mlugl5fo5siWGc4j51Z4powSYohRXG X-Received: by 10.112.99.72 with SMTP id eo8mr1502217lbb.7.1413339971343; Tue, 14 Oct 2014 19:26:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.193 with SMTP id x1ls9451lae.53.gmail; Tue, 14 Oct 2014 19:26:11 -0700 (PDT) X-Received: by 10.152.9.201 with SMTP id c9mr9110440lab.38.1413339971034; Tue, 14 Oct 2014 19:26:11 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id kz1si9179309lbc.63.2014.10.14.19.26.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 19:26:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so241889lbv.19 for ; Tue, 14 Oct 2014 19:26:10 -0700 (PDT) X-Received: by 10.152.44.233 with SMTP id h9mr8996342lam.73.1413339970900; Tue, 14 Oct 2014 19:26:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp517294lbz; Tue, 14 Oct 2014 19:26:10 -0700 (PDT) X-Received: by 10.70.40.134 with SMTP id x6mr9203923pdk.99.1413339969341; Tue, 14 Oct 2014 19:26:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jn8si14395811pbd.154.2014.10.14.19.26.08 for ; Tue, 14 Oct 2014 19:26:09 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932806AbaJOC0F (ORCPT + 27 others); Tue, 14 Oct 2014 22:26:05 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:39163 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932670AbaJOCZr (ORCPT ); Tue, 14 Oct 2014 22:25:47 -0400 Received: from 172.24.2.119 (EHLO szxeml412-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CAT35332; Wed, 15 Oct 2014 10:25:27 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml412-hub.china.huawei.com (10.82.67.91) with Microsoft SMTP Server id 14.3.158.1; Wed, 15 Oct 2014 10:25:19 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , , , , , Arnd Bergmann , Thomas Gleixner , "Konrad Rzeszutek Wilk" , , Joerg Roedel , , , Benjamin Herrenschmidt , , , Sebastian Ott , "Tony Luck" , , "David S. Miller" , , Chris Metcalf , Ralf Baechle , Lucas Stach , David Vrabel , "Sergei Shtylyov" , Michael Ellerman , Thierry Reding , "Thomas Petazzoni" , Liviu Dudau , Yijing Wang Subject: [PATCH v3 06/27] PCI: designware: Save msi chip in pci_sys_data Date: Wed, 15 Oct 2014 11:06:54 +0800 Message-ID: <1413342435-7876-7-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangyijing@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Save msi chip in pci_sys_data instead of assign msi chip to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pcie-designware.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index dfed00a..56fa8ab 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -498,6 +498,10 @@ int __init dw_pcie_host_init(struct pcie_port *pp) val |= PORT_LOGIC_SPEED_CHANGE; dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val); +#ifdef CONFIG_PCI_MSI + dw_pcie_msi_chip.dev = pp->dev; + dw_pci.msi_chip = &dw_pcie_msi_chip; +#endif dw_pci.nr_controllers = 1; dw_pci.private_data = (void **)&pp; @@ -747,21 +751,10 @@ static int dw_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) return irq; } -static void dw_pcie_add_bus(struct pci_bus *bus) -{ - if (IS_ENABLED(CONFIG_PCI_MSI)) { - struct pcie_port *pp = sys_to_pcie(bus->sysdata); - - dw_pcie_msi_chip.dev = pp->dev; - bus->msi = &dw_pcie_msi_chip; - } -} - static struct hw_pci dw_pci = { .setup = dw_pcie_setup, .scan = dw_pcie_scan_bus, .map_irq = dw_pcie_map_irq, - .add_bus = dw_pcie_add_bus, }; void dw_pcie_setup_rc(struct pcie_port *pp)