From patchwork Sat Jul 26 03:08:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 34337 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BED7A235AB for ; Sat, 26 Jul 2014 02:46:57 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id ft15sf32381358pdb.6 for ; Fri, 25 Jul 2014 19:46:57 -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=06gXc/6xkpERdAqApL8S5eqEWw1dVArtk2w44MQfrVE=; b=kPlj2Lkas+XnISnfGDhS5x6GTcKDqkO387hNb4jrnqMB8gqfCkw7lEBKJC8uv4nrkx IJMRvXcUj4ef6PRs2TraaiAmATEqv3fpOvRcRr2ti3r4Nrn8/CsM5umYIth9Gd4ClMwW NofbcYyIXI+cmVvCurcYYHcyg2+I2YtSVLE1R92lnI0gQStS+GYtRoTLEva4hnC+T3c/ FTp3pMODa31Wh86ewROBVk8UqOUZFoPRwbdJmw/WBhfmpvzGduMzaEXr9E7rJc/pZbwW qGz+ldLbmhwdlox28biXnhQentMePYxz0o4O6vOqaif6H89hKp1wJTdwScGKtmSRDWzj PN4A== X-Gm-Message-State: ALoCoQmA0tkkgEowj6WeGe1rjx0ZOJ27S/YTjM8ry46eH33Isdoj2Q7A7znXYI7yAdUXpbGsmUeZ X-Received: by 10.70.63.66 with SMTP id e2mr9605776pds.2.1406342817064; Fri, 25 Jul 2014 19:46:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.51 with SMTP id s48ls1436091qgs.64.gmail; Fri, 25 Jul 2014 19:46:56 -0700 (PDT) X-Received: by 10.224.119.198 with SMTP id a6mr4493601qar.39.1406342816940; Fri, 25 Jul 2014 19:46:56 -0700 (PDT) Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) by mx.google.com with ESMTPS id j4si19210718qao.126.2014.07.25.19.46.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 19:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.216.44 as permitted sender) client-ip=209.85.216.44; Received: by mail-qa0-f44.google.com with SMTP id f12so5451174qad.17 for ; Fri, 25 Jul 2014 19:46:56 -0700 (PDT) X-Received: by 10.140.44.67 with SMTP id f61mr32567597qga.44.1406342816836; Fri, 25 Jul 2014 19:46:56 -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.96.16.166 with SMTP id h6csp70449qdd; Fri, 25 Jul 2014 19:46:56 -0700 (PDT) X-Received: by 10.69.3.67 with SMTP id bu3mr22945930pbd.34.1406342815994; Fri, 25 Jul 2014 19:46:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi4si5495637pdb.206.2014.07.25.19.46.55 for ; Fri, 25 Jul 2014 19:46:55 -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 S1760672AbaGZCoF (ORCPT + 15 others); Fri, 25 Jul 2014 22:44:05 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:6660 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbaGZCnt (ORCPT ); Fri, 25 Jul 2014 22:43:49 -0400 Received: from 172.24.2.119 (EHLO szxeml419-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BXE25885; Sat, 26 Jul 2014 10:43:42 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml419-hub.china.huawei.com (10.82.67.158) with Microsoft SMTP Server id 14.3.158.1; Sat, 26 Jul 2014 10:43:33 +0800 From: Yijing Wang To: CC: Xinwei Hu , Wuyun , "Bjorn Helgaas" , , , "James E.J. Bottomley" , "Marc Zyngier" , , Russell King , , , , Hanjun Guo , Yijing Wang Subject: [RFC PATCH 06/11] PCI/MSI: Save MSI irq in PCI MSI layer Date: Sat, 26 Jul 2014 11:08:43 +0800 Message-ID: <1406344128-27055-7-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1406344128-27055-1-git-send-email-wangyijing@huawei.com> References: <1406344128-27055-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.216.44 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 irq in PCI MSI layer, this is preparation for generic MSI. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 21b16e0..f96dd38 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -650,8 +650,6 @@ static int msi_capability_init(struct pci_dev *dev, int nvec) pci_intx_for_msi(dev, 0); msi_set_enable(dev, 1); dev->msi_enabled = 1; - - dev->irq = entry->irq; return 0; } @@ -1059,6 +1057,7 @@ int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) { int nvec; int rc; + struct msi_desc *entry; if (dev->current_state != PCI_D0) return -EINVAL; @@ -1114,6 +1113,8 @@ int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) return rc; } + entry = list_entry(dev->msi_list.next, struct msi_desc, list); + dev->irq = entry->irq; return nvec; } EXPORT_SYMBOL(pci_enable_msi_range);