From patchwork Mon Oct 27 07:48:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 39565 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 9E62D2118A for ; Mon, 27 Oct 2014 07:11:25 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf2530184wgh.0 for ; Mon, 27 Oct 2014 00:11:24 -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=xK/5gDT5ZkL6n6yk81c7UNmODGb6UmUhPJyAdRBwKVA=; b=Z1U6LOODkiIHGizPExYjnwkMcf8LM8mQS0M6qC9QZGVmIxB5pEvMHnh8TdK0Z+hf2t uMuqKXkAJ3+slXk3vBxDqPr4JvS6rn3EsS5wAZhgxlfp5+5a2hYo2Aem//QEmKErjGb7 uacvyfyb4AOV0l5vj7wrZZMdQKOuz7EfXoOAsxTyBOpkvh+qOuU8Mho+LP6Hseo5/w2k Fj7POmuUzcKnim1ycdIpk9sTVWYcMF2C8Gi+PnweRdUytZEm2tVQ5UY3L8mOf0u4chMR 5o0JWbhbyfuKL64wuOawixhjc1YyywfdtvbhKpVVZLLqT6FKal1b2QOW+zLHE3Lo1Tu0 ydOg== X-Gm-Message-State: ALoCoQmBNshfxCsoTLfJeIN9e7oD3RmVn/z0s1g/UDxkfezdVYAd+3DEqfKplousAE5o4E0A0yJd X-Received: by 10.180.39.66 with SMTP id n2mr3548061wik.6.1414393884793; Mon, 27 Oct 2014 00:11:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.38 with SMTP id p6ls657336lap.64.gmail; Mon, 27 Oct 2014 00:11:24 -0700 (PDT) X-Received: by 10.112.182.1 with SMTP id ea1mr21131311lbc.16.1414393884532; Mon, 27 Oct 2014 00:11:24 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id h3si18457511lbc.88.2014.10.27.00.11.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 00:11:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id ge10so1199174lab.30 for ; Mon, 27 Oct 2014 00:11:24 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr21232652lap.44.1414393884293; Mon, 27 Oct 2014 00:11:24 -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 c5csp242727lbz; Mon, 27 Oct 2014 00:11:23 -0700 (PDT) X-Received: by 10.68.206.98 with SMTP id ln2mr21953872pbc.83.1414393882641; Mon, 27 Oct 2014 00:11:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si9860014pdo.55.2014.10.27.00.11.21 for ; Mon, 27 Oct 2014 00:11:22 -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 S1751846AbaJ0HIO (ORCPT + 26 others); Mon, 27 Oct 2014 03:08:14 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:6870 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751308AbaJ0HIN (ORCPT ); Mon, 27 Oct 2014 03:08:13 -0400 Received: from 172.24.2.119 (EHLO szxeml409-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AWE07461; Mon, 27 Oct 2014 15:07:29 +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:20 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , Thomas Gleixner , "Thierry Reding" , Thomas Petazzoni , Yijing Wang Subject: [PATCH 02/10] PCI/MSI: Introduce weak pcibios_msi_controller() Date: Mon, 27 Oct 2014 15:48:39 +0800 Message-ID: <1414396127-30023-3-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A02020A.544DEF31.0189, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3ff181c1f0d39fd0d459c802015e7d48 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.215.43 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: , Introduce a new weak pcibios_msi_controller() to get the associate msi_chip for PCI bus. This is preparation for save msi_chip in arch PCI sysdata. This weak function will be removed after we save msi_chip in generic pci_host_bridge. Suggested-by: Bjorn Helgaas Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 1c7ca4a..f085f7f 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -30,9 +30,24 @@ int pci_msi_ignore_mask; /* Arch hooks */ +struct msi_controller * __weak pcibios_msi_controller(struct pci_bus *bus) +{ + return NULL; +} + +struct msi_controller *pci_msi_controller(struct pci_bus *bus) +{ + struct msi_controller *ctrl = bus->msi; + + if (ctrl) + return ctrl; + + return pcibios_msi_controller(bus); +} + int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) { - struct msi_controller *ctrl = dev->bus->msi; + struct msi_controller *ctrl = pci_msi_controller(dev->bus); int err; if (!ctrl || !ctrl->setup_irq) @@ -48,7 +63,7 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) void __weak arch_teardown_msi_irq(unsigned int irq) { struct msi_desc *entry = irq_get_msi_desc(irq); - struct msi_controller *ctrl = entry->dev->bus->msi; + struct msi_controller *ctrl = pci_msi_controller(entry->dev->bus); if (!ctrl || !ctrl->teardown_irq) return;