Message ID | 1532971373-8591-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 72483157D for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Jul 2018 17:23:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62EF32A343 for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Jul 2018 17:23:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56C2D2A394; Mon, 30 Jul 2018 17:23:15 +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 DFBC42A343 for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Jul 2018 17:23:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbeG3S7M (ORCPT <rfc822;patchwork-linux-pci@patchwork.kernel.org>); Mon, 30 Jul 2018 14:59:12 -0400 Received: from mail-eopbgr690067.outbound.protection.outlook.com ([40.107.69.67]:30496 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeG3S7M (ORCPT <rfc822;linux-pci@vger.kernel.org>); Mon, 30 Jul 2018 14:59:12 -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=XHWZzxnc31Ltdcf/1mZIGqTBpi3R0ix43r4EYHajF40=; b=sEErif++wwlLKhNstwvm076DI0YyJIzTWI23/RsVy4Oy5CKcO5rZ/oc/N5CvoqJuQcO3zPBfvJxhEFIisWdQE5FPGw7DjzhctdAKJBXNmcNTv+ETjkFxUwwFIAkJ8i0qr+4BqiTHDxwh4EgZLTrrnBrkEHRExJT+mHvDrBZ3TRQ= Received: from CY1PR07CA0031.namprd07.prod.outlook.com (2a01:111:e400:c60a::41) by DM2PR0701MB1341.namprd07.prod.outlook.com (2a01:111:e400:5119::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Mon, 30 Jul 2018 17:23:09 +0000 Received: from DM3NAM05FT042.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::202) by CY1PR07CA0031.outlook.office365.com (2a01:111:e400:c60a::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.19 via Frontend Transport; Mon, 30 Jul 2018 17:23:09 +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 sjmaillnx2.cadence.com (158.140.1.28) by DM3NAM05FT042.mail.protection.outlook.com (10.152.98.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1038.3 via Frontend Transport; Mon, 30 Jul 2018 17:23:06 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id w6UHN3x0028562 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 30 Jul 2018 10:23:04 -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; Mon, 30 Jul 2018 19:23:17 +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; Mon, 30 Jul 2018 19:23:17 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w6UHN2Zm008870; Mon, 30 Jul 2018 18:23:02 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w6UHN281008863; Mon, 30 Jul 2018 18:23:02 +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 3/5] PCI: cadence: Check whether MSI is masked before sending it Date: Mon, 30 Jul 2018 18:22:53 +0100 Message-ID: <1532971373-8591-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)(396003)(346002)(376002)(39860400002)(136003)(2980300002)(3190300001)(36092001)(199004)(189003)(2351001)(126002)(426003)(42186006)(6666003)(6916009)(2906002)(336012)(476003)(478600001)(2616005)(107886003)(48376002)(26826003)(87636003)(186003)(486006)(4326008)(86362001)(50466002)(54906003)(16586007)(50226002)(47776003)(51416003)(5660300001)(356003)(316002)(26005)(246002)(105596002)(106466001)(305945005)(36756003)(8676002)(7636002)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1341;H:sjmaillnx2.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT042;1:V5/dYjXM9yeVC1h+xtD1Y5wNyyj9On1LVcR5UI96GCwde75sM9s20vYpCGQAzmZMvOILnp9W1JQoJLEnecZDjGnP4TPWL1zOhDYgFpDOf3wJQkiuD6z6vcahogd419o3 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c08ca71-3c75-4a55-d4f3-08d5f6411e6e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM2PR0701MB1341; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1341;3:Xbo70CWyzgEguxLzsaLTOhJU2H+BNIkcTpdKNyOiOQiGe3rrRUijYuJQkVrPI0+3KC8cHY5NOCJ+Eq5O3JF7YGJUNdV22xfIkj9l82YTtFADEp2+Tb3KsLrf5BgLVFl51kSGFPeSCKRJqvpseZsA0zZTex7f9uE4gHJZB4BzXruGyuZXVjovqAywjjrzV7BvfKKfkQ0/6oRRYabXI31fgUdBIECdzhBVRYAqWI/s65lOpGtcOPNMCmKzdzeSzSUug7rNQAWhc4Kft9ZwhkfqR0a7DvyQaGUCOjJ1QC1db1JPxihPpWtT1R/dBkqzse1LaOzRVMyNjbNteW5HZnyBJEKSjuhDHdY4/2dsj18fJzo=;25:e2XkJeUL4wHWX8xtN3x8dv1/lucvq1T8gzX0K5D+tmhD7ev6hf3xvn/GZ6zWr22leQ+rAxrlLSPRVfSjMapHVN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nuQh7wWl1WB X-Microsoft-Antispam-PRVS: <DM2PR0701MB134183145007C0F41AC8FC12D82F0@DM2PR0701MB1341.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)(3231311)(944501410)(52105095)(93006095)(93003095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM2PR0701MB1341;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0701MB1341; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1341;4:Kn1stV1ItiRx4GwGl0f6STj07Od/Mr9DEQ3tJWGJ7s6R68vrJXd8McFGkX6RCluPJkpGRnEV66KN9YQ8Q32uHW78HZrElf9DfzsbUX844gphBcWxzPHPTcWFpEerXeaNMdcCQ20e3Fhyr/uFI55PBGp/i92CIwhhcrfcVzb3CD2eRVK/BAdQWDgBK/0HSPdG+4pOJaR2yft/1GG4//TnFEqD+kpOl+5143VmzGx2k2pAVMasitqrOFF560Eb+U3o0fxhn2BV1AjBSouhScIwU1gC9tx7o/xhW6qV9WYyf/ry9dnOVh+z2Rg6rx6zMCeN X-Forefront-PRVS: 0749DC2CE6 X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1341;23:0UoK27veyZLqaBBGJ71uaVMdk9iq2qlbRP78m9GR0pdKf31SacX3w2dtUeR7ejoWNxDOok7fS6AIMKvUMJjh4AWtffU7UCULyco+8DHEtFy6FyvyJARteevDzFgbAA11Bain+sd1d2R7AGqYkEezdzKo9MJxL3x0n2EH3vbshs3SVIFmQQB86phlMLKpiHKHuWWH2wzMf4qHOeDg/Vp4g5rBEjVb0iBpu8A1GKeUQpF3AYH+tzbUspcHCjQfDPBJkBzZW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ff53J7hjWp9TLHyEauyp36ScQyhLvu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1341;20:yM+OTEFzhWvLqJhU2+GWkPhyaxJecyXMLwy/KJQGV09xfUvzZR1+MLlEiP+XtwAnI157w6nYBD3XKuKCMpnYZceiKCLUKD/74R26w18mbZdjw/tzd0kbXPVQc25bTQGhhzZ++McXPD67SApv9962yQMt89LvAJU0Cc799hXOSROyHeuDsy348r5NpIHy7nfdlXktZszgjrfzcyxoB5qlM62mBdK4uRC9RCz/J1nTsiS2916rJiIjcwNT3gH5olXd X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 17:23:06.3711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c08ca71-3c75-4a55-d4f3-08d5f6411e6e 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=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1341 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 c3a0889..db75280 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -332,6 +332,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. Signed-off-by: Alan Douglas <adouglas@cadence.com> --- drivers/pci/controller/pcie-cadence-ep.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)