From patchwork Mon Oct 27 07:48:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 39562 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DAEBA2118A for ; Mon, 27 Oct 2014 07:10:22 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf693355lab.3 for ; Mon, 27 Oct 2014 00:10:21 -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=PG+gRybOPmyLKhxxhyFIX+frPHh5mkZ3RF+6PUEHXaY=; b=M9w6qUvHexbo7Q0fOhWAuuzo/qaTZ9hXgOqwIz2MnrsDPDnrHLwYhf68w85F5nTjWu CU7U/GZH+Cz5PpOfi3aJktD61MVDM3V5p7n1CaMuuPSRcD5pu7tKQTaLWwb2Z0UJhsmk s8XEBLDkH0sGVTB3M3ct7dGKfWCFrR2DnAyKzPZ2GAm9scfdZoTvfTZOD0xEq/i0lykc 5S8/dAlXrAJf3XjSVWflTAd1sstUJFqGfw/wMtYbVqgLhtTHLHgxvg1IFMJq/5p1xyr6 aDPxIgNXNWBgHD1BaMCWY009Hc13tsEj/FUpdO/+sJpdcNzNgmMqmEgbc3Lgs44Zh3NW aIlg== X-Gm-Message-State: ALoCoQkfb91H5eJoIexyJ66GpHD8WJi2/CrfHGNhR+s1nGF7637rNvBjhPA+BNpWVRNWF9G/4Pa1 X-Received: by 10.112.137.202 with SMTP id qk10mr131461lbb.11.1414393821357; Mon, 27 Oct 2014 00:10:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.199 with SMTP id u7ls679843lau.10.gmail; Mon, 27 Oct 2014 00:10:21 -0700 (PDT) X-Received: by 10.112.97.135 with SMTP id ea7mr21557414lbb.46.1414393821133; Mon, 27 Oct 2014 00:10:21 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id 8si18458600las.83.2014.10.27.00.10.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 00:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so1449956lbj.23 for ; Mon, 27 Oct 2014 00:10:20 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr21226936lap.44.1414393820906; Mon, 27 Oct 2014 00:10:20 -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 c5csp242612lbz; Mon, 27 Oct 2014 00:10:20 -0700 (PDT) X-Received: by 10.66.242.203 with SMTP id ws11mr22486991pac.69.1414393819234; Mon, 27 Oct 2014 00:10:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hd1si7475336pbb.253.2014.10.27.00.10.18 for ; Mon, 27 Oct 2014 00:10:19 -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 S1752488AbaJ0HIV (ORCPT + 26 others); Mon, 27 Oct 2014 03:08:21 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:10231 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbaJ0HIS (ORCPT ); Mon, 27 Oct 2014 03:08:18 -0400 Received: from 172.24.2.119 (EHLO szxeml409-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBJ05367; Mon, 27 Oct 2014 15:07:33 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml409-hub.china.huawei.com (10.82.67.136) with Microsoft SMTP Server id 14.3.158.1; Mon, 27 Oct 2014 15:07:22 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , Thomas Gleixner , "Thierry Reding" , Thomas Petazzoni , Yijing Wang Subject: [PATCH 05/10] PCI: designware: Save MSI controller in pci_sys_data Date: Mon, 27 Oct 2014 15:48:42 +0800 Message-ID: <1414396127-30023-6-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1414396127-30023-1-git-send-email-wangyijing@huawei.com> References: <1414396127-30023-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.178 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 controller in pci_sys_data instead of assigning MSI controller pointer 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 0839b92..dd85b41 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_controller.dev = pp->dev; + dw_pci.msi_ctrl = &dw_pcie_msi_controller; +#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_controller.dev = pp->dev; - bus->msi = &dw_pcie_msi_controller; - } -} - 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)