From patchwork Thu Sep 11 21:09:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 4886501 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC4A89F32E for ; Thu, 11 Sep 2014 13:09:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBDF020148 for ; Thu, 11 Sep 2014 13:09:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29CF120149 for ; Thu, 11 Sep 2014 13:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbaIKNJR (ORCPT ); Thu, 11 Sep 2014 09:09:17 -0400 Received: from mail-bn1bbn0103.outbound.protection.outlook.com ([157.56.111.103]:39060 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755934AbaIKNIo (ORCPT ); Thu, 11 Sep 2014 09:08:44 -0400 Received: from BY2PR03CA076.namprd03.prod.outlook.com (10.141.249.49) by BLUPR03MB568.namprd03.prod.outlook.com (10.141.78.22) with Microsoft SMTP Server (TLS) id 15.0.1015.17; Thu, 11 Sep 2014 13:08:41 +0000 Received: from BY2FFO11FD032.protection.gbl (2a01:111:f400:7c0c::196) by BY2PR03CA076.outlook.office365.com (2a01:111:e400:2c5d::49) with Microsoft SMTP Server (TLS) id 15.0.1024.12 via Frontend Transport; Thu, 11 Sep 2014 13:08:40 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD032.mail.protection.outlook.com (10.1.14.210) with Microsoft SMTP Server (TLS) id 15.0.1019.14 via Frontend Transport; Thu, 11 Sep 2014 13:08:40 +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 s8BD8TlH001175; Thu, 11 Sep 2014 06:08:36 -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 v2 2/3] PCI: designware: Add get_msi_data to pcie_host_ops Date: Thu, 11 Sep 2014 21:09:00 +0000 Message-ID: <1410469741-11634-2-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410469741-11634-1-git-send-email-Minghuan.Lian@freescale.com> References: <1410469741-11634-1-git-send-email-Minghuan.Lian@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(54534003)(19580405001)(47776003)(20776003)(104166001)(64706001)(76482001)(31966008)(85852003)(50226001)(93916002)(4396001)(6806004)(77982001)(36756003)(46102001)(74662001)(92566001)(79102001)(89996001)(44976005)(50986999)(83322001)(77156001)(95666004)(104016003)(106466001)(99396002)(84676001)(105606002)(19580395003)(62966002)(229853001)(76176999)(74502001)(110136001)(102836001)(97736003)(80022001)(86362001)(26826002)(83072002)(50466002)(92726001)(88136002)(48376002)(85306004)(107046002)(68736004)(21056001)(90102001)(87286001)(87936001)(81342001)(2351001)(81542001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB568; 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: 03319F6FEF 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=-7.5 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The patch adds get_msi_data for some platforms to return their special MSI message data. Signed-off-by: Minghuan Lian --- Change log: v2: no change just derived from v1 drivers/pci/host/pcie-designware.c | 6 +++++- drivers/pci/host/pcie-designware.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 1d37bed..eae4917 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -366,7 +366,11 @@ 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); diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index 8be2b33..c8ec879 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -75,6 +75,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); };