Message ID | 1534340867-21491-1-git-send-email-adouglas@cadence.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show
Return-Path: <linux-pci-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2512D1515 for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 15 Aug 2018 13:50:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100022A6EF for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 15 Aug 2018 13:50:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DA622A740; Wed, 15 Aug 2018 13:50:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 700902A727 for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 15 Aug 2018 13:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729300AbeHOQnJ (ORCPT <rfc822;patchwork-linux-pci@patchwork.kernel.org>); Wed, 15 Aug 2018 12:43:09 -0400 Received: from mail-sn1nam01on0087.outbound.protection.outlook.com ([104.47.32.87]:12480 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729312AbeHOQnJ (ORCPT <rfc822;linux-pci@vger.kernel.org>); Wed, 15 Aug 2018 12:43:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1VA97M2tW+9R4wPxaeZH8P9Czi5y3nXH9PL03NLb4Qc=; b=SI9rpbuUi1ZHcbFMAGLcn1Ipbof6KRhQXo08nr+uKMbWdjTWoq6aomSprUfDXsYTnLUIcfMoiDuMUdaji5aqgQwreXqb0Zwd9A9emEgr6ME2WYQgilGXlbC4pQHYZ6TrOZDBoDtO0PNZpMQZMuWhZjxaBO1xpPUjbbsBQRhf5z4= Received: from BYAPR07CA0043.namprd07.prod.outlook.com (2603:10b6:a03:60::20) by BN7PR07MB4705.namprd07.prod.outlook.com (2603:10b6:406:f1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.25; Wed, 15 Aug 2018 13:47:57 +0000 Received: from DM3NAM05FT017.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::202) by BYAPR07CA0043.outlook.office365.com (2603:10b6:a03:60::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.19 via Frontend Transport; Wed, 15 Aug 2018 13:47:57 +0000 Authentication-Results: spf=softfail (sender IP is 158.140.1.28) smtp.mailfrom=cadence.com; arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=fail action=none header.from=cadence.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning cadence.com discourages use of 158.140.1.28 as permitted sender) Received: from sjmaillnx1.cadence.com (158.140.1.28) by DM3NAM05FT017.mail.protection.outlook.com (10.152.98.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1080.6 via Frontend Transport; Wed, 15 Aug 2018 13:47:56 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id w7FDlslc002845 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 15 Aug 2018 06:47:55 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 15 Aug 2018 15:48:07 +0200 Received: from lvloginb.cadence.com (10.165.177.11) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 15 Aug 2018 15:48:06 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w7FDlrQP021670; Wed, 15 Aug 2018 14:47:53 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w7FDlrLS021656; Wed, 15 Aug 2018 14:47:53 +0100 From: Alan Douglas <adouglas@cadence.com> To: <bhelgaas@google.com> CC: <kishon@ti.com>, <lorenzo.pieralisi@arm.com>, <linux-pci@vger.kernel.org>, <gustavo.pimentel@synopsys.com>, <cyrille.pitchen@bootlin.com>, <stelford@cadence.com>, Alan Douglas <adouglas@cadence.com> Subject: [PATCH v2 3/5] PCI: cadence: Check whether MSI is masked before sending it Date: Wed, 15 Aug 2018 14:47:47 +0100 Message-ID: <1534340867-21491-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 Content-Type: text/plain X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:158.140.1.28;IPV:CAL;SCL:-1;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(376002)(396003)(2980300002)(3190300001)(189003)(199004)(36092001)(107886003)(4326008)(42186006)(16586007)(246002)(316002)(54906003)(356003)(486006)(7636002)(51416003)(48376002)(50466002)(36756003)(305945005)(426003)(2616005)(476003)(126002)(86362001)(2351001)(8936002)(478600001)(26005)(5660300001)(47776003)(186003)(106466001)(2906002)(6666003)(105596002)(50226002)(26826003)(8676002)(87636003)(6916009)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4705;H:sjmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT017;1:cI1tJo+MMlF/VVehxZiesSKMeWtrFPY7XkRlFR5cF9h1mcIDoNrPyEjdKJlHalnX2efqUPIqO3Udq7tc8pRMi4QodnTQ1YNSI5A8WSpoTBwwacwBM9KGnVuhkEHMg8Sm X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 919d5b11-28a9-40a4-b107-08d602b5b545 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060);SRVR:BN7PR07MB4705; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4705;3:lM2o1tRqrC442jwLNOM1lakq/EST48F295fHwURul5NxXXWiFnhX6DNmwO6zDBZu25zKJIKg76aDKkAKaIzoti1/d1mXVXuOgAApCIl4sy+72DqZJ21FkyMzFBGdN7RFp6l5tq+DJ1ANE5yeFlgmgHjJJ2gp5nQSVtoGnVvYeHspb+h2Zf1NTpDDHDAr4AP5Lx9Y3LS2YQitCLms/j3YVXV9C8ko356CuR0/mHNgRbG0HZoOZEjbxkfPZopj5sCeufzwtcZng9aOkF6FZ0z+PpfK33nQJ0aoMtU2MjSmZDfV+94UUhfzY6NtPnFTbEWu5adeEETYnNrw3i7U6jUlTgVLkXdmfC2jou/mvpQBn3M=;25:GBULeSpuIaul9L02lwvmz67xmk9zzdXGNtYA2XfEdu3WnbCtxKT9/51z/BtU7nIpD0SCdQ85WNk9KtUROPWxT+jKqszt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Microsoft-Antispam-PRVS: <BN7PR07MB47051F149DD9570347C09B18D83F0@BN7PR07MB4705.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(72806322054110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93003095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BN7PR07MB4705;BCL:0;PCL:0;RULEID:;SRVR:BN7PR07MB4705; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4705;4:v7/Ack0bGAL2GFALRsNMIflnHejhkI8VkgpRaOz/eNDFyQhejfmHJin93dMiU27kmXprFdX2axlP/OrDITxq+XGpm/PDmnaeVJ4qrHDVG04MH6GCg1qm9fSExsfpyGBMG9t7D9QQ37QZoihmZ1Im8rlA4g9ir56YFBjm/d9reQX/nMIxVvVjdHSN485ON/XiQx7lkU9/Esi8y0krMPl+E4S1//HFEX59NY4+Xy2qEXGsVfTF4STEPEoh4xgYmLa5Uyeiwd+y2DagTnD0zcAHk3v3Pim/TZA9duloOVspV79ugHOgbsd/L+fd0nOuq4Sn X-Forefront-PRVS: 07658B8EA3 X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4705;23:jFYgCesbXCtEHRF7eWg+sRHuR5rTfX2L3blzH5oBAJ68gp0IgAUt942am6ZZWTmL7zSACAvU7kvNm8mVP6LwXzleRLb+A60QtLD9v7DsmuYFf3s9UvCvW2AKhUYKE67c4BcGB9aPrXTfjcf03YRERKMDQT+GwXE+VXEWPhLi1OJZUpZfmolcYbAawLgRYG+0n1FXooXIw/NuhpMfYSbpQz8U78wLDqtLxG2UCQ/Ouc37tzE+Du3ItIK3Je/C5fiXIRTGAuGd2vUu2OcXjHDBs6FNX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pamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4705;20:XcoYdifVT/0GPsCadiH82vkTHrpFkpAMWzKQgICWn1EIE3exmSES25ZMXWV7U5HjGDdn7YtyLPeaW8p1s2dDA+8dm1AChpv5A/caTrUBu5Tx0TATfijA0A6faGsBH4Xik8YGqD7FdJal+/p6yRlCZm5KhB0RaFj0cASV/TVfh9zbPdNRaDvWblPlIrqzLLCxJcKT5Krf1o7cZhpr/tZ6iRrJJ7y8iSkmDnHrDOI22YHRU5aVODJCW8JIn1hC+MFm X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2018 13:47:56.9645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 919d5b11-28a9-40a4-b107-08d602b5b545 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[158.140.1.28];Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4705 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: <linux-pci.vger.kernel.org> X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Add MSI-X support for cadence EP driver
|
expand
|
diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 970d934..56f6b87 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -333,6 +333,11 @@ static int cdns_pcie_ep_send_msi_irq(struct cdns_pcie_ep *ep, u8 fn, if (!interrupt_num || interrupt_num > msi_count) return -EINVAL; + /* Check whether MSI is masked */ + data = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSI_MASK_64); + if (data & (1 << (interrupt_num - 1))) + return -EINVAL; + /* Compute the data value to be written. */ data_mask = msi_count - 1; data = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSI_DATA_64);
The EP driver did not check the mask bit for each MSI before sending it in raise_irq. This is now checked, and -EINVAL is returned if masked. Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller") Signed-off-by: Alan Douglas <adouglas@cadence.com> --- drivers/pci/controller/pcie-cadence-ep.c | 5 +++++ 1 file changed, 5 insertions(+)