From patchwork Sat Jul 26 03:08:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyijing X-Patchwork-Id: 34327 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F6F4235AB for ; Sat, 26 Jul 2014 02:44:01 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id b6sf17809672yha.9 for ; Fri, 25 Jul 2014 19:44:01 -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=uUNC6UEYr0iBXbC1QfKPpuk5XOxV1YCmk5nyhPzHyDU=; b=VoHwhlNzRyYVfyqkesMfcwsxDRolg8JjJyvWQVlXpiiEy0HVKOeGAzXqmILrtinydb YS2sIaeWtzyorwe7lPpGXR7F2t9byn9Y8yIQ+sIqyyTkx8zmVi64v8NAWFRvrDyiaQSZ 7DGZbXk5mIZGwJPzNEmYHhmuNlgKCHW8R+4dEmJ8Fr2rEhYcQhLRd13oL96fwjKeYZ9o DjIEDDdChz0JdoCYTVcOHnoC9HfY1voaWTeCS1Yxwe6Sk/LmM41O9nFcPtYDeZQVKo64 y5DE8NtnMmu3iy9QSAwq00suu/DdL6rtfC3vApAKObMckY9LBvBszvIiklpy6MvnMZAE O62g== X-Gm-Message-State: ALoCoQlGUgkkon3o31tFEbtYqzxLJowof4qoYXhSSuzC5B4uR7Ys2gScdnn76Leh5PMIzGh13FUv X-Received: by 10.236.157.193 with SMTP id o41mr8517505yhk.6.1406342641225; Fri, 25 Jul 2014 19:44:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.112 with SMTP id o103ls1495130qgd.30.gmail; Fri, 25 Jul 2014 19:44:01 -0700 (PDT) X-Received: by 10.140.48.5 with SMTP id n5mr33078676qga.102.1406342641075; Fri, 25 Jul 2014 19:44:01 -0700 (PDT) Received: from mail-qa0-f45.google.com (mail-qa0-f45.google.com [209.85.216.45]) by mx.google.com with ESMTPS id t8si19276978qad.37.2014.07.25.19.44.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 19:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.216.45 as permitted sender) client-ip=209.85.216.45; Received: by mail-qa0-f45.google.com with SMTP id cm18so5404789qab.18 for ; Fri, 25 Jul 2014 19:44:01 -0700 (PDT) X-Received: by 10.140.36.149 with SMTP id p21mr33856088qgp.54.1406342640959; Fri, 25 Jul 2014 19:44:00 -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 h6csp70347qdd; Fri, 25 Jul 2014 19:44:00 -0700 (PDT) X-Received: by 10.66.142.42 with SMTP id rt10mr23191864pab.1.1406342640019; Fri, 25 Jul 2014 19:44:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id km8si10965804pbc.28.2014.07.25.19.43.59 for ; Fri, 25 Jul 2014 19:44:00 -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 S1752402AbaGZCno (ORCPT + 15 others); Fri, 25 Jul 2014 22:43:44 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:21119 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbaGZCnl (ORCPT ); Fri, 25 Jul 2014 22:43:41 -0400 Received: from 172.24.2.119 (EHLO szxeml419-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ASC29708; Sat, 26 Jul 2014 10:43:37 +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:28 +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 01/11] PCI/MSI: Use pci_dev->msi_cap instead of msi_desc->msi_attrib.pos Date: Sat, 26 Jul 2014 11:08:38 +0800 Message-ID: <1406344128-27055-2-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020208.53D315DB.00FE,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 58302deaf4bf45bec6723305c37a1377 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.45 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: , PCI devices save the msi and msix capability offset in pci_dev->msi_cap and pci_dev->msix_cap. When we access PCI device MSI and MSIX registers, we can use msi_cap and msix_cap in pci_dev directly. Remove the pos member in msi_attrib. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-octeon.c | 4 ++-- drivers/pci/host/pcie-designware.c | 2 +- drivers/pci/msi.c | 2 -- include/linux/msi.h | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c index ab0c5d1..6a6a99f 100644 --- a/arch/mips/pci/msi-octeon.c +++ b/arch/mips/pci/msi-octeon.c @@ -73,7 +73,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) * wants. Most devices only want 1, which will give * configured_private_bits and request_private_bits equal 0. */ - pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, + pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); /* @@ -176,7 +176,7 @@ msi_irq_allocated: /* Update the number of IRQs the device has available to it */ control &= ~PCI_MSI_FLAGS_QSIZE; control |= request_private_bits << 4; - pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, + pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, control); irq_set_msi_desc(irq, desc); diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 1eaf4df..04339cd 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -335,7 +335,7 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev, return -EINVAL; } - pci_read_config_word(pdev, desc->msi_attrib.pos+PCI_MSI_FLAGS, + pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &msg_ctr); msgvec = (msg_ctr&PCI_MSI_FLAGS_QSIZE) >> 4; if (msgvec == 0) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 5a40516..e67acd1 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -595,7 +595,6 @@ static struct msi_desc *msi_setup_entry(struct pci_dev *dev) entry->msi_attrib.entry_nr = 0; entry->msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT); entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ - entry->msi_attrib.pos = dev->msi_cap; entry->msi_attrib.multi_cap = (control & PCI_MSI_FLAGS_QMASK) >> 1; if (control & PCI_MSI_FLAGS_64BIT) @@ -699,7 +698,6 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base, entry->msi_attrib.is_64 = 1; entry->msi_attrib.entry_nr = entries[i].entry; entry->msi_attrib.default_irq = dev->irq; - entry->msi_attrib.pos = dev->msix_cap; entry->mask_base = base; list_add_tail(&entry->list, &dev->msi_list); diff --git a/include/linux/msi.h b/include/linux/msi.h index 8103f32..ce88c5b 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -29,7 +29,6 @@ struct msi_desc { __u8 multi_cap : 3; /* log2 num of messages supported */ __u8 maskbit : 1; /* mask-pending bit supported ? */ __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ - __u8 pos; /* Location of the msi capability */ __u16 entry_nr; /* specific enabled entry */ unsigned default_irq; /* default pre-assigned irq */ } msi_attrib;