From patchwork Tue Sep 23 14:28:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 392543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7577414007B for ; Wed, 24 Sep 2014 00:31:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbaIWObk (ORCPT ); Tue, 23 Sep 2014 10:31:40 -0400 Received: from mail-by2on0145.outbound.protection.outlook.com ([207.46.100.145]:22448 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756063AbaIWO3G (ORCPT ); Tue, 23 Sep 2014 10:29:06 -0400 Received: from BY2PR0301MB0741.namprd03.prod.outlook.com (25.160.63.19) by BY2PR0301MB0710.namprd03.prod.outlook.com (25.160.63.152) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Tue, 23 Sep 2014 14:29:05 +0000 Received: from CO2PR03CA0033.namprd03.prod.outlook.com (10.141.194.160) by BY2PR0301MB0741.namprd03.prod.outlook.com (25.160.63.19) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Tue, 23 Sep 2014 14:29:03 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:141) by CO2PR03CA0033.outlook.office365.com (2a01:111:e400:1414::32) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Tue, 23 Sep 2014 14:29:03 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (TLS) id 15.0.1029.15 via Frontend Transport; Tue, 23 Sep 2014 14:29:02 +0000 Received: from lmh.ap.freescale.net (lmh.ap.freescale.net [10.193.20.46]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s8NESkg1024223; Tue, 23 Sep 2014 07:28:59 -0700 From: Minghuan Lian To: CC: , Zang Roy-R61911 , Hu Mingkai-B21284 , Scott Wood , Yoder Stuart-B08248 , Arnd Bergmann , Bjorn Helgaas , "Minghuan Lian" Subject: [PATCH v3 2/3] PCI: designware: Add get_msi_data() to pcie_host_ops Date: Tue, 23 Sep 2014 22:28:59 +0800 Message-ID: <1411482540-31297-4-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411482540-31297-1-git-send-email-Minghuan.Lian@freescale.com> References: <1411482540-31297-1-git-send-email-Minghuan.Lian@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(54534003)(189002)(199003)(85306004)(76176999)(20776003)(50986999)(44976005)(229853001)(97736003)(80022003)(99396002)(74662003)(4396001)(81342003)(79102003)(87936001)(74502003)(19580405001)(90102001)(6806004)(2351001)(64706001)(107046002)(83322001)(88136002)(31966008)(93916002)(19580395003)(47776003)(92726001)(83072002)(95666004)(62966002)(76482002)(77156001)(105606002)(86362001)(21056001)(110136001)(48376002)(50466002)(46102003)(77982003)(104166001)(50226001)(68736004)(81542003)(36756003)(104016003)(92566001)(84676001)(120916001)(89996001)(87286001)(106466001)(10300001)(85852003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB0741; H:tx30smr01.am.freescale.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0741; X-Forefront-PRVS: 0343AC1D30 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-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0710; X-OriginatorOrg: freescale.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The patch adds get_msi_data() for some platforms to return their special MSI message data. Signed-off-by: Minghuan Lian --- Change log: v3: no change v2: no change just derived from v1 drivers/pci/host/pcie-designware.c | 7 ++++++- drivers/pci/host/pcie-designware.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 1c09f814..c28ca05 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -366,7 +366,12 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev, 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 904e40a..c625675 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -71,6 +71,7 @@ struct pcie_host_ops { void (*msi_set_irq)(struct pcie_port *pp, int irq); void (*msi_clear_irq)(struct pcie_port *pp, int irq); u32 (*get_msi_addr)(struct pcie_port *pp); + u32 (*get_msi_data)(struct pcie_port *pp, int pos); void (*scan_bus)(struct pcie_port *pp); int (*msi_host_init)(struct pcie_port *pp, struct msi_chip *chip); };