From patchwork Thu Sep 4 18:45:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 4843761 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ACF35C0338 for ; Thu, 4 Sep 2014 11:00:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6515720211 for ; Thu, 4 Sep 2014 11:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3461420107 for ; Thu, 4 Sep 2014 11:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218AbaIDLAo (ORCPT ); Thu, 4 Sep 2014 07:00:44 -0400 Received: from mail-by2lp0240.outbound.protection.outlook.com ([207.46.163.240]:19095 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752812AbaIDLAo (ORCPT ); Thu, 4 Sep 2014 07:00:44 -0400 Received: from BN3PR0301CA0003.namprd03.prod.outlook.com (25.160.180.141) by BN1PR0301MB0628.namprd03.prod.outlook.com (25.160.171.13) with Microsoft SMTP Server (TLS) id 15.0.1019.16; Thu, 4 Sep 2014 10:45:05 +0000 Received: from BN1BFFO11FD033.protection.gbl (2a01:111:f400:7c10::1:112) by BN3PR0301CA0003.outlook.office365.com (2a01:111:e400:4000::13) with Microsoft SMTP Server (TLS) id 15.0.1019.16 via Frontend Transport; Thu, 4 Sep 2014 10:45:06 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD033.mail.protection.outlook.com (10.58.144.96) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Thu, 4 Sep 2014 10:45:05 +0000 Received: from lmh.ap.freescale.net (lmh.ap.freescale.net [10.193.20.14]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s84Aj1xT027614; Thu, 4 Sep 2014 03:45:02 -0700 From: Minghuan Lian To: CC: , Zang Roy-R61911 , Hu Mingkai-B21284 , "Minghuan Lian" Subject: [PATCH 1/2] PCI: designware: change MSI-related pcie_host_ops Date: Thu, 4 Sep 2014 18:45:37 +0000 Message-ID: <1409856338-1730-1-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199003)(87286001)(102836001)(50466002)(62966002)(44976005)(95666004)(64706001)(19580405001)(26826002)(21056001)(19580395003)(83322001)(36756003)(104016003)(90102001)(105606002)(74662001)(2351001)(81342001)(229853001)(4396001)(97736001)(20776003)(85306004)(47776003)(107046002)(68736004)(84676001)(48376002)(6806004)(50226001)(99396002)(31966008)(76482001)(50986999)(106466001)(88136002)(92566001)(79102001)(92726001)(104166001)(86362001)(93916002)(74502001)(89996001)(80022001)(110136001)(46102001)(77156001)(87936001)(81542001)(83072002)(77982001)(85852003); DIR:OUT; SFP:; SCL:1; SRVR:BN1PR0301MB0628; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 0324C2C0E2 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Minghuan.Lian@freescale.com; X-OriginatorOrg: freescale.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1. Change original get_msi_data() to get_msi_addr(), since this function returns MSI message address. 2. Add a new function get_msi_data() to return MSI message data. Signed-off-by: Minghuan Lian --- drivers/pci/host/pcie-designware.c | 11 ++++++++--- drivers/pci/host/pcie-designware.h | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 52bd3a1..c84913e 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -373,12 +373,17 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev, */ desc->msi_attrib.multiple = msgvec; - if (pp->ops->get_msi_data) - msg.address_lo = pp->ops->get_msi_data(pp); + if (pp->ops->get_msi_addr) + msg.address_lo = pp->ops->get_msi_addr(pp); else msg.address_lo = virt_to_phys((void *)pp->msi_data); msg.address_hi = 0x0; - msg.data = pos; + + if (pp->ops->get_msi_data) + msg.data = pp->ops->get_msi_data(pp, pos); + else + msg.data = pos; + write_msi_msg(irq, &msg); return 0; diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index daf81f9..7f08807 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -73,7 +73,8 @@ struct pcie_host_ops { void (*host_init)(struct pcie_port *pp); void (*msi_set_irq)(struct pcie_port *pp, int irq); void (*msi_clear_irq)(struct pcie_port *pp, int irq); - u32 (*get_msi_data)(struct pcie_port *pp); + u32 (*get_msi_addr)(struct pcie_port *pp); + u32 (*get_msi_data)(struct pcie_port *pp, int pos); }; int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);