From patchwork Mon Jul 30 17:22:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10549505 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: 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 796AF14BC for ; Mon, 30 Jul 2018 17:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ABC52A447 for ; Mon, 30 Jul 2018 17:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ED722A691; Mon, 30 Jul 2018 17:22:38 +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 E75012A447 for ; Mon, 30 Jul 2018 17:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbeG3S6g (ORCPT ); Mon, 30 Jul 2018 14:58:36 -0400 Received: from mail-cys01nam02on0053.outbound.protection.outlook.com ([104.47.37.53]:60224 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeG3S6f (ORCPT ); Mon, 30 Jul 2018 14:58:35 -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=QICfYKD3x6vRRiPKAUKVkquSxSYTNL4NWZ0x1VjzMiU=; b=mJbQhjwhtAe/ol6Blx2YTdQH5U/CM+95AIv6Lep9GGySPTJ+VpRxP1YLuRNH4N/K+Do2GVAbMUw4pUgR+NN+2ldVwEd081KxJ+br/m/sdIiqa9kk5qjiIRBAcdINCv7DEmsospcIW4oJQFv2bHdpibAmbU4LMBe98Vq1JU37Fsg= Received: from CY1PR07CA0008.namprd07.prod.outlook.com (2a01:111:e400:c60a::18) by DM6PR07MB4716.namprd07.prod.outlook.com (2603:10b6:5:a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Mon, 30 Jul 2018 17:22:31 +0000 Received: from CO1NAM05FT026.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::206) by CY1PR07CA0008.outlook.office365.com (2a01:111:e400:c60a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Mon, 30 Jul 2018 17:22:31 +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 CO1NAM05FT026.mail.protection.outlook.com (10.152.96.135) 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:22:28 +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 w6UHMOZr017474 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 30 Jul 2018 10:22:26 -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:22: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:22: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 w6UHM32U007220; Mon, 30 Jul 2018 18:22:03 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w6UHM28b007095; Mon, 30 Jul 2018 18:22:02 +0100 From: Alan Douglas To: CC: , , , , , , Alan Douglas Subject: [PATCH 1/5] PCI: cadence: Use AXI region 0 to signal interrupts from EP Date: Mon, 30 Jul 2018 18:22:00 +0100 Message-ID: <1532971320-6966-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 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)(136003)(346002)(396003)(376002)(39860400002)(2980300002)(3190300001)(189003)(199004)(36092001)(478600001)(14444005)(26826003)(51416003)(2906002)(336012)(87636003)(105596002)(106466001)(2351001)(5660300001)(4326008)(54906003)(246002)(36756003)(47776003)(6916009)(48376002)(50466002)(107886003)(26005)(50226002)(305945005)(316002)(42186006)(86362001)(7636002)(16586007)(8676002)(426003)(126002)(8936002)(186003)(2616005)(486006)(356003)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4716;H:sjmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT026;1:EttZbIH6ZqRH9vSmpZt4mzkdMtJxKvcr53AEUay9s0bnSaqgyKrT5X5FX2wDoADmuLx7/auczMlMhYfuyn0c4t43Q+AHSh8zI2FrhfSW0vsCNF+thEkwdnMEHPc9tG1k X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f03f857-cf59-42aa-8cd0-08d5f64107b3 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060);SRVR:DM6PR07MB4716; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4716;3:OqYiwwHcGnaKOpsdugoE4W5jQcJndWU7cBpDp6xhLt6vSqd9HATd6eqcA9X8MSiVzp8P520/bGPXNeRgbbQx94rRyLdZ0Fm7IWXj55fl2pLtqMwo7Fgsyis2BLoT/gfRF8+5ZWM3BJeDmlx8s/gTBEMtqp1BxZYIpdNyO5u6wAkKJvM62CMbfVgS2nBIPRJav6CTvIS33jTVOtVbLKpHv3bMA8rw6dxGePNU7w4DxM7tzhuekrUX6CaguwI2/HOnwe1LXdTl8BahKFxKl/VC2aY7XJwGfLO3hlKbWrv7+5xlbWv/X46tcxeTBnYp7XsAz7tS3e27KRG3VI0P271RLcYibm017M/g7uhu3q8cyss=;25:AXVWRw2ISkVD3+vY1luaIOZRFey8C56MeZ1Hjle1mSiRi2owhzqHL4aC1QrqwWgic5fQZI5eLrW5oc60aawSVjbL4Pg65Z17ea33w6/inufK0mKb1Csw5h4eT25dc8AQ3CjGuS/9jwxmveo/8/qv2IgPnbxkmMsi2NpSgmO3SYSN5GWuBCdw1Y5ApBmi3syBWlvDVGr11KP4l2jdL8pI4vAAiksThC8L6NZt/RPQbOGpt9VxJr8Vf0l7TSGF6tYN2Z42ItBLAY6KVbrfl/ideHyrF/K2JNAA6T3pYA1rBYv08oYKcV7nwEzV+k6axPf7zfPTJ2EY8KEeIhjuh6rzow== X-MS-TrafficTypeDiagnostic: DM6PR07MB4716: X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4716;31:+23LRFetkSJTd+9WasLc9Ek9OCr1syoEgPHt2Y2pZCS/IqoNZfCUcQCTa3Y10Wii36QAKia1q97DCiHP3wqoE2g5qSSeVy6hasPf7ODY90fzMBzI4td8rSZ8BZzrDhoK5pZTFhKOu+QEQUcwSUpVK9uABMuB8PQzamrJcPSeQP8In+JzGlZl+aOBK12gqoRmrIqp52ixG/IXb8q9v42SW8nd0Y+kkDoVGaIMWpDZ3hE=;20:61rZ7iU3mY58+6lPmPOhuCqoaSzYi45b1KAujI7jeh4E+cuKHZOOlP4R4Twehp4wIHnV6KijQa4cC8fQOQS9c6iRClEpgeybR1COcgx64JucWL22k5G6XhehLoeLCCh9btK7V1+kIvoEhfe2mxtwdv+wAACLWF86saZYyPlazkXXmuiG4DXhYAcXvfrKN3meeOFj/57xZvHAtUQCqYN6lx58+zOIaKmi61iJGSBT/o6mvxEs71JBfV+g/2kGiVNV1gH9L/UgM5rgIhpnovMl7Y7IqxR1q4BG7oYCb6vcHQMf22LSNRWbJqLQZl8CHCgrtlNt1XD20yJmb/6aRa1ygwVmg29OG7LuNUjxSae9cdxi+zM6IAjwdAOORq6KIvFgwh2wDFpZLvnl5D9Y4U088zpIWDUPTYICxc4nCwtNiichIry6oXR52TKJeBpA7ZrgdYA87iA16W6sdjmEIBY7JGHXnrf/ZIbt0zz954MIsP+X9EOxi/NSeEYSzb6iUWGK X-Microsoft-Antispam-PRVS: 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)(93006095)(93003095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DM6PR07MB4716;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4716; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4716;4:rI6DwpikX4GDSw5rJlgZpudIA75oj9erSsbHgniooLSyWLFcB2IK0IFW+wHNu59vizknB/89ACk0v6xZtgv18PJzrfQKf+2aW7bw0+Dh/PLyU97449U51qGEirhcjUtqdy2ul7HudN2Q9KMwsITzBtqahCiPWgmA88z/eA3KRtA60f4DCVRsmrbADnHmQ8WGPO/UHWBABzDFKTkRGqJsr0yxRxinLqxej7G+eQHs2Ssq/8oluUZo0NExQ2euyAybYh2ae5Q8jmU6+RlbDTZpZDmjQFoBgFV/NPmw3LuIxVw3Wh6TbCuCy7bzI4PBhCSY X-Forefront-PRVS: 0749DC2CE6 X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4716;23:3rHzGZ2luFpFhSmdUC+aC5SFvVf3fPTFWfmsNxglsD14hsmT9wDYXDgZGjWPl0QeQzBEwB/YY8VwyRreUz8yldPZ8FLumiWkaPX1F6XOsf8F8GwJk0zM3LJcV6DQrowyDxgBgFlb3qGMLtwlof2Nl5IeRl39g9+eiD8Q1V7+yD2h7i4txM6VqF8XhZwJFba1Ua1eQMtWtizZenUaGARycc69P9AIO+TyJRUZJ2Kzt8OIt5khyKnJkd9i58ntKZ4K8g7XfqBE+9BnjFMCvbvjzKIhaFDyJykDfptLoh+QGzl8Yi6DIaCLXjbotdK4qHNFribvZZz/XV0wOew9JDsLMQlOIK+nwIn7c/co0EsQmaQ9hy48TkxBQkSesVxqnZO7fva6Sc3t3mNN5SBz55X7r25jisYSViqRANx3wCdGEWDs6lfxSThSUDfaW60sFKuVkfR2Ub/Hf2D+IzxjkGmyF4laXb1cgUfyQO2R6WLDIc4aWa1p1aQTaxB1lKvJV5ggxUEucmWRaKQIGktRwMWng0qFBkXEF+umnxAvdNAo+KQJZZ/R0rxLBEV5t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BESZ5h/Vz35ZKZEHrAVXk3EYW6p8hH3sUPB8P9HDulT X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 17:22:28.2963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f03f857-cf59-42aa-8cd0-08d5f64107b3 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: DM6PR07MB4716 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The IRQ physical address is allocated from region 0, rather than the highest region. Update the driver to reserve this region in the bitmap, and to use region 0 for all types of interrupt. Signed-off-by: Alan Douglas --- drivers/pci/controller/pcie-cadence-ep.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 9e87dd7..6692654 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -258,7 +258,6 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn, u8 intx, bool is_asserted) { struct cdns_pcie *pcie = &ep->pcie; - u32 r = ep->max_regions - 1; u32 offset; u16 status; u8 msg_code; @@ -268,8 +267,8 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn, /* Set the outbound region if needed. */ if (unlikely(ep->irq_pci_addr != CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY || ep->irq_pci_fn != fn)) { - /* Last region was reserved for IRQ writes. */ - cdns_pcie_set_outbound_region_for_normal_msg(pcie, fn, r, + /* First region was reserved for IRQ writes. */ + cdns_pcie_set_outbound_region_for_normal_msg(pcie, fn, 0, ep->irq_phys_addr); ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY; ep->irq_pci_fn = fn; @@ -347,8 +346,8 @@ static int cdns_pcie_ep_send_msi_irq(struct cdns_pcie_ep *ep, u8 fn, /* Set the outbound region if needed. */ if (unlikely(ep->irq_pci_addr != (pci_addr & ~pci_addr_mask) || ep->irq_pci_fn != fn)) { - /* Last region was reserved for IRQ writes. */ - cdns_pcie_set_outbound_region(pcie, fn, ep->max_regions - 1, + /* First region was reserved for IRQ writes. */ + cdns_pcie_set_outbound_region(pcie, fn, 0, false, ep->irq_phys_addr, pci_addr & ~pci_addr_mask, @@ -517,6 +516,8 @@ static int cdns_pcie_ep_probe(struct platform_device *pdev) goto free_epc_mem; } ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_NONE; + /* Reserve region 0 for IRQs */ + set_bit(0, &ep->ob_region_map); return 0; From patchwork Mon Jul 30 17:22:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10549507 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: 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 5F21A14BC for ; Mon, 30 Jul 2018 17:22:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ED9D2A2CA for ; Mon, 30 Jul 2018 17:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 433502A311; Mon, 30 Jul 2018 17:22:53 +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 DB67D2A2CA for ; Mon, 30 Jul 2018 17:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728746AbeG3S6v (ORCPT ); Mon, 30 Jul 2018 14:58:51 -0400 Received: from mail-by2nam01on0074.outbound.protection.outlook.com ([104.47.34.74]:54060 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeG3S6u (ORCPT ); Mon, 30 Jul 2018 14:58:50 -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=aHw7vYdYetu/Ztl1TwCT5VWd5QxHW2IBr7YSwECx21M=; b=JArazdJN5L4F9Y3Md7AKhrYr/CcAk8q2zhvjWC93BMgWaMwozarWNc0YfftzB0iQ69e/Wa3EuQgPiH5k5qhT+nXp2uzcdaolqEAHzE1CBOdhRZOj1uMmFurWaUZ79i6NldisFet5u3UwgXHqcTE5GaHn0m+ZnUDATwRYDPfAnWs= Received: from SN1PR0701CA0049.namprd07.prod.outlook.com (2a01:111:e400:52fd::17) by DM6PR07MB4714.namprd07.prod.outlook.com (2603:10b6:5:a1::11) 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:22:49 +0000 Received: from DM3NAM05FT014.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::203) by SN1PR0701CA0049.outlook.office365.com (2a01:111:e400:52fd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Mon, 30 Jul 2018 17:22:48 +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 DM3NAM05FT014.mail.protection.outlook.com (10.152.98.123) 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:22:46 +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 w6UHMhV2017534 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 30 Jul 2018 10:22:44 -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:22:57 +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:22:56 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w6UHMgo1008357; Mon, 30 Jul 2018 18:22:42 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w6UHMggF008347; Mon, 30 Jul 2018 18:22:42 +0100 From: Alan Douglas To: CC: , , , , , , Alan Douglas Subject: [PATCH 2/5] PCI: cadence: Write MSI data with 32bits Date: Mon, 30 Jul 2018 18:22:38 +0100 Message-ID: <1532971358-8220-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 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)(376002)(136003)(346002)(39860400002)(396003)(2980300002)(3190300001)(36092001)(189003)(199004)(305945005)(8676002)(16586007)(2906002)(36756003)(26826003)(186003)(86362001)(6916009)(6666003)(48376002)(8936002)(42186006)(316002)(47776003)(7636002)(50226002)(50466002)(107886003)(5660300001)(87636003)(4326008)(51416003)(105596002)(26005)(106466001)(426003)(478600001)(336012)(246002)(2351001)(486006)(54906003)(126002)(2616005)(476003)(356003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4714;H:sjmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT014;1:bdkhrfz7oN01m4jf7ecsUFxIAtecU2349ov2rPJGvqEgDG+TsR288YOpGScGzpy5d2LkQ4HHN2t3QVWEBj2R6/vzgN3HL1/Z63X5TA1IO6zYBmx0ixUarPBnLly0Zs6I X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ac81d3b-e565-4be8-33dc-08d5f641125b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:DM6PR07MB4714; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4714;3:XHE0veAzrcUeNq4HwLGaU8K41XcfvthK/tpy4S7o7XICqMgMSfDrZ9JsYYj4y2MfmD/aRx2tJ6PxrCZ7ZkYyQOtwxmmiX4AZs6A9MwUEG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Yy7az3I0fh4DciS12uizNe8ZEcR05lRnHbBEkwblLC2SQmhR6Jv2frY5cPk9Nysc3nmgVq2RAVRH+53P3IBBI9OPTMFtbSd55wK3Okq91/cima+eJHQFmGNXguNhx2bHsK/VV2jdZkjw+4GTV1Or1QNjm0/hjyYoTHOyzF6Wj4P2sS/Z6k8ovEvEAPrAOiL386Rk0M03LvPaJvo6JeG0+hsNeDV8mIcpnC1ivaDng/Oek8y3FT+rw5OBQhTh4DQaiY6yPK2j+30WK5i2GC6FhVYuzOKi9E/GGcU4Wr9Zx8fC2rzSFqgX3Ie8OO2E7ltzSaF9Kfb+qsnUA5qbiJw1dkpi1LM/64 X-Microsoft-Antispam-PRVS: 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)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93003095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DM6PR07MB4714;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4714; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4714;4:9bNHcH1qQUlJ2+rfT/zmoUMsxnVJ4TQ0ZqBVw6mLIwj46EhllKHeVJbKraHBrrWudmZLXqMq4uDxzCa5lVMvKtucBa7QCSmgf/wlKoNSfSQSBfOWlAeuI/F37tTBRSs6kj+VzGif3SUyRysJzIyl7IDIjA+6oaQduNV5JaNmeHPE1FKK4ayhu52RUin0DQ+Z5j7uAUmnPfD5ZSt1jlBd9xujzXnaqUx246yApERTpTzxSXdQlSdGp9Dh3XfAh2Z9aeIR7Ex2EayZ7nWjJQ8WBReTjkpQa8ICHIKEyUCJnoonPmhpN8OoDK9LDyHuHDJc X-Forefront-PRVS: 0749DC2CE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dJT0Vdq5S5QIaTfLN5xayJ0GCIMPvWFAg1VoDUSkenNzSApL57uP4b5/mN5xU/g9xVTeR57gRfvkMD76Qc=;7:srmYCy+rz4kVwlBVpIlJZIRQiOUriTAQupwyaVrVNdGEqEaLVkLMrrr31gqDvUgDsThSDrP/R2E7SzXuYgKRQrMojP9NmgoHQ/RNdKlnSkm+FvUIoWdkCdgDng8ejOQAYlSx6iEGFF04RjduV1ikm9Dg8qvPBdrj9vwBO3bAG2wPUK1M1b5LF2iMwjOwQt3QkzjH+JFFPOwzj1Maop3QxjxmkG1M3a3ILMtygm/tUzlcTADHGyGRvkdW3BBO8r59 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4714;20:EXpKwPCtOyVQZVx2z0ZT+Tq8FaD4QyflvJfcoeZKP+cm1o2aSd0QUl4AHtcYKu1yN3Eb7P8JSMtXSefJPAqPxw6ch1Ww3wquy4Q7KCzAgHxpXgjE4QJqAWGNgo5bQvcXnnb2Ytew1bRNd2x2cfDuAeX3ng8aWU9xF2magdhXId+AIFJ5FlMRo8MjWderSKAPdr+VYsGtMG3l1J4JL+ZShgtfXqlSSSPhgcVIVP6xVr7SV4hI9SZo/+SLvX6bRv6s X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 17:22:46.1097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ac81d3b-e565-4be8-33dc-08d5f641125b 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: DM6PR07MB4714 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the PCIe specification, although the MSI data is only 16bits, the upper 16bits should be written as 0. Use writel instead of writew when writing the MSI data to the host. Signed-off-by: Alan Douglas --- drivers/pci/controller/pcie-cadence-ep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 6692654..c3a0889 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -355,7 +355,7 @@ static int cdns_pcie_ep_send_msi_irq(struct cdns_pcie_ep *ep, u8 fn, ep->irq_pci_addr = (pci_addr & ~pci_addr_mask); ep->irq_pci_fn = fn; } - writew(data, ep->irq_cpu_addr + (pci_addr & pci_addr_mask)); + writel(data, ep->irq_cpu_addr + (pci_addr & pci_addr_mask)); return 0; } From patchwork Mon Jul 30 17:22:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10549509 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: 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 ; 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 ; 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 ; Mon, 30 Jul 2018 17:23:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbeG3S7M (ORCPT ); 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 ); 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 To: CC: , , , , , , Alan Douglas 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 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+Tb3KsLrf5BgLVFl51kSGFPeSCKRJqvpseZsA0zZTex7f9uE4gHJZB4BzXru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qm5fGF73wQKZdJEpxEZK5eGXvIYJWj/ypimGRQCT5OvXLvfTwPbJtsw63ZTXy38CvpTkBsIxomHkw54ghPCUaUe4m6wnyOolEih3LYUgpHi+/I2NPl63Od1+rLnfetcIQEnwddeg873cGLgTHdjeVpHoqKRMLEkJKw6I0WV2iRVP4QtwgN7EzHKF3xPcVtDtPKd93e89ewkqwF9xNEZG/+01enLFoBJdXjlVcHORCUZcmWiVYRaIBDZUUUOmdfap1frQfKSvWOlTMxwtfalVnefbJSow/XHpMvWrPnuQh7wWl1WB X-Microsoft-Antispam-PRVS: 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:0UoK27veyZLqaBBGJ71uaVMdk9iq2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;7:bDK9hSgrnooOc/Flc2wY3y46Qdx9NwagTrs0898BBmg01zc2N2R02m03j8VZbw2w1R4oFgx6TaRFRzQKsKfHVmFsD1B+bADwuK7pWv1aPUmTW+UfcdMCywkQESurFEUQ3gdjIt9p4lHDjCukXfzbqqCJYm/YizyJPLqwkkRSwfuuGs0mXztG9ICd9RyhcIzTzY2qjmUYGNqCSObL38rp4R3+CvmoFmFDk5Ff53J7hjWp9TLHyEauyp36ScQyhLvu 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: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/pci/controller/pcie-cadence-ep.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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); From patchwork Mon Jul 30 17:23:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10549525 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: 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 2051B157D for ; Mon, 30 Jul 2018 17:27:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7D1629674 for ; Mon, 30 Jul 2018 17:27:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB502297AA; Mon, 30 Jul 2018 17:27:54 +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 42DCC29674 for ; Mon, 30 Jul 2018 17:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbeG3TDx (ORCPT ); Mon, 30 Jul 2018 15:03:53 -0400 Received: from mail-co1nam03on0042.outbound.protection.outlook.com ([104.47.40.42]:55299 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbeG3TDx (ORCPT ); Mon, 30 Jul 2018 15:03:53 -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=GghrOiUZiuqXS4swEdhya5Ka7tfAgl0ROEXtb/l/3Rw=; b=KKghf+j136dGmgB/uj9/FTNJO88omGK7mLVkcD5Pyg2R1eN1zwuh1+U8zf4vMJcB3Ix+MMmYw5MHHmLaZ+2HQm1DgYgS3Q/x80zNr1AJAGrgBKZvIRrsUfnpWqOWUqYNuisF0uCGC+BoEaLDf3ZtgdY/8P4dpsu98Q0X46MB/Qo= Received: from SN4PR0701CA0024.namprd07.prod.outlook.com (2603:10b6:803:28::34) by BL2PR07MB2291.namprd07.prod.outlook.com (2a01:111:e400:c752::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Mon, 30 Jul 2018 17:23:57 +0000 Received: from BY2NAM05FT043.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by SN4PR0701CA0024.outlook.office365.com (2603:10b6:803:28::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Mon, 30 Jul 2018 17:23:56 +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 BY2NAM05FT043.mail.protection.outlook.com (10.152.100.180) 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:54 +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 w6UHNpuw017614 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 30 Jul 2018 10:23:52 -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:44 +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:44 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w6UHNT5J009590; Mon, 30 Jul 2018 18:23:29 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w6UHNTMD009589; Mon, 30 Jul 2018 18:23:29 +0100 From: Alan Douglas To: CC: , , , , , , Alan Douglas Subject: [PATCH 4/5] PCI: cadence: Check link is up before sending IRQ from EP Date: Mon, 30 Jul 2018 18:23:24 +0100 Message-ID: <1532971404-9444-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 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)(39860400002)(136003)(376002)(346002)(2980300002)(3190300001)(199004)(189003)(36092001)(6916009)(87636003)(6666003)(26826003)(50226002)(5660300001)(51416003)(305945005)(476003)(106466001)(126002)(2616005)(486006)(26005)(478600001)(16586007)(42186006)(316002)(54906003)(246002)(4326008)(36756003)(8936002)(47776003)(7636002)(48376002)(105596002)(8676002)(50466002)(107886003)(2906002)(86362001)(186003)(336012)(356003)(426003)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR07MB2291;H:sjmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT043;1:wrWS5cxATw2ex0dCVvY+BM5p1gwEbFV1IBI8PXNlC0eERdqbRzLjdLrqr+nfR1rsGiw6dxN1WW7sk9mQtZ+kpG/7wbD6+R5KVCx7qmR/IqBjZNsAOPFUHMqjhwy5t+qe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a27dc5cb-a296-4122-9b43-08d5f6413abd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BL2PR07MB2291; X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2291;3:gnmzzyucvzqIKR+zFbvl5+5v37gSJSfcD/F34ejbB56nhLwy5lAB2qBPyPrtWwDrYXTfW6GeW+mawS8yazaZZjf5+XOYZ8qU18fYHpgzmqlvgeiWbiMoHkuVb6ui3PQRacd8McsiPx4vnmpSQ8KJPZkIKWVqxofBw9ti95xpkwLRnGWPtYEn/XX1EI7zTzYcZgE/J8Bvy3U6bmGMxfVDIqJE3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JlfhqmZQhb5kpXGQqkREWONWWyCUsFgfD6kvJN2aYRRGgCtaPipYWDFFC3pxvKRj6wYpDk+iE7R81Zy9+LRRfcUy/Ik5PkhzjVKVRYQehEvY7KAPD16OTKSYWSo0sA9f3aUqstTgHmHan42QDUb9IsbeQo23UDGWJetJdwrnxW6px7Hrh08tMEEx84CQyU1/kGayghdgsrnk0KoXkw0lqXjtpkNgwv5cf X-Microsoft-Antispam-PRVS: 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)(93006095)(93003095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:BL2PR07MB2291;BCL:0;PCL:0;RULEID:;SRVR:BL2PR07MB2291; X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2291;4:ZnKhTsue0Myp6M/Dh3jT5zSY2sjUuLfee6De58GF2aL+/6El9Z38C4Tieh3Ul6I7rEJkPaOTUTqZh1s8nENCBl2We4EcD5wbCiUDpQ9I73cyoTvGf8n5WkKbIBhCMqtkOMcHNiAqewXanarEz8eXi8C0wbg8jmDGA/nvLzGxw+T9acT0OxKZKpPgHmHpq5R/6qOyZbaqVUxQJ8WDWdTj1y9sjbZ5IUrpCd/MJ+QK5jAFGONBBiN/ioM3ojMXu/v5Ey7Qm0g0I8+8hnnUoNGYY7JOQdmmQ9lN1qcv47N0zYzyFFJSwd6RofNJnScjsOZU X-Forefront-PRVS: 0749DC2CE6 X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2291;23:ENGShmVfaK0xn+0TvagvVMT6f68YXV2ERBm5o2qfDOr/M7Z7z6Cr5UJ0JZKjcEJLosiYhWtkV9tkPQBoL82yMYpU/p3H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E/M4Knak3C5orxUBYxdw8pfjo3ntuN+AABy/935S3IHwb25Bl0424d2fyZEQAYL0ckysuvz5SL6VY2xwgMRJMfOXHaIL2NCxnEtWx3jF8QEUxIww2EzBYLnifu8HEmU9zDM/gBVIuRGdnomfOPDMG2nvH6+Qpt6SWSyo/hm2i/eglLxQdfjgdcwyit SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2291;20:gKg39WpbHWvOXiyGFmyYvl4bUcpWCEIJnxTCYMjJKLO62WAoHtdOqk+5G+VHQrmvgbFDSGmKvqA+PDr8hpxZ+PqD8OFcYmLJpU8X/9Ks0Y7KTQVdKEcqXcXtMLmAeuE3YJj5qOofPQtxICCAnoxnrWLhwr3eAhnvbCcVip1YoXWOejGzJRD2H2Wkf7vlVDHOy8eXB5e1ZbfB75o9IK8nPLyjUX9blWgCmI31VCYiPTyInOXgH//nxAiZaJ4zyL0e X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 17:23:54.0041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a27dc5cb-a296-4122-9b43-08d5f6413abd 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: BL2PR07MB2291 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If EP attempts to send an IRQ (legacy, MSI or MSI-X) while the link is not up, return -EINVAL Signed-off-by: Alan Douglas --- drivers/pci/controller/pcie-cadence-ep.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index db75280..33e30dd 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -370,6 +370,12 @@ static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, u16 interrupt_num) { struct cdns_pcie_ep *ep = epc_get_drvdata(epc); + u32 link_status; + + /* Can't send an IRQ if the link is down. */ + link_status = cdns_pcie_readl(&ep->pcie, CDNS_PCIE_LM_BASE); + if (!(link_status & 0x1)) + return -EINVAL; switch (type) { case PCI_EPC_IRQ_LEGACY: From patchwork Mon Jul 30 17:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10549511 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: 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 73B5E13B8 for ; Mon, 30 Jul 2018 17:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63A182A394 for ; Mon, 30 Jul 2018 17:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 573132A40A; Mon, 30 Jul 2018 17:24:06 +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 BD8F92A394 for ; Mon, 30 Jul 2018 17:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbeG3TAE (ORCPT ); Mon, 30 Jul 2018 15:00:04 -0400 Received: from mail-eopbgr730089.outbound.protection.outlook.com ([40.107.73.89]:10814 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726800AbeG3TAD (ORCPT ); Mon, 30 Jul 2018 15:00:03 -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=iBBVM0IknKtIBOCBMQcQi/zJsPYHNtq1ggaR4K9nID8=; b=qlPsY2rS8QUCOzJxpzGp4YCaXavq3bEG/0eztgPo0ios6sWCHa8yKnanAUs/bzW5+D3EknvkbHNBjwzWKySK33/uzL+OG9JIk3QPZzBoW/0ydwKX0KFE8I9APZ+Y0crncaJ7Jei9YvTUhkc4tV+rs/crPUxo2h76MBOaaJXgIsc= Received: from DM5PR07CA0068.namprd07.prod.outlook.com (2603:10b6:4:ad::33) by CY1PR0701MB1338.namprd07.prod.outlook.com (2a01:111:e400:4c1b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Mon, 30 Jul 2018 17:24:00 +0000 Received: from BY2NAM05FT044.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::205) by DM5PR07CA0068.outlook.office365.com (2603:10b6:4:ad::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.17 via Frontend Transport; Mon, 30 Jul 2018 17:24:00 +0000 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 BY2NAM05FT044.mail.protection.outlook.com (10.152.100.181) 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:57 +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 w6UHNsbX017618 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 30 Jul 2018 10:23:56 -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:24:08 +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:24:08 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w6UHNsJO010170; Mon, 30 Jul 2018 18:23:54 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w6UHNrmY010151; Mon, 30 Jul 2018 18:23:53 +0100 From: Alan Douglas To: CC: , , , , , , Alan Douglas Subject: [PATCH 5/5] PCI: cadence: Add MSI-X capability to EP driver Date: Mon, 30 Jul 2018 18:23:49 +0100 Message-ID: <1532971429-10002-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 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)(396003)(376002)(346002)(136003)(2980300002)(3190300001)(36092001)(189003)(199004)(50226002)(106466001)(36756003)(105596002)(6916009)(2616005)(14444005)(6666003)(48376002)(476003)(50466002)(486006)(47776003)(126002)(8936002)(305945005)(7636002)(2351001)(51416003)(356003)(107886003)(4326008)(316002)(16586007)(42186006)(2906002)(54906003)(6346003)(26005)(426003)(336012)(8676002)(246002)(5660300001)(86362001)(186003)(478600001)(87636003)(26826003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1338;H:sjmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:corp.cadence.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM05FT044;1:WjsTn1DdoxJF+YFvbTvLfxm55qfAReyA1Q048KSQrhzcQzf6THexN9dmt/v03mDQLWwzvQI6X2sjxETqJCAC6h4bw6N5PbeeMWKNLm9D24dvdX08ehzhFARPq2WlkS8Z X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a0ec3afc-b61b-4f40-16eb-08d5f6413cd0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY1PR0701MB1338; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1338;3:T7UfE9x+3YYOgKqOga6X0Tot2dctLTemnv6d3JJcn8V50tQyrBCVgWsiShDMQx3q/1wg1/BQKFtye4Io2GFTqFYWbJGzWbM6vYSuCyO6BXitdawewPQBFQhZoAFgfZfkEPDlK3EA/XC0KAxT7pHZS3zFYyawe4JCqKxAM6Nmjd2of6JB+fK2DG8nXywgOo6egrLrD/MpnABUw8JtgF2QL6bKfPpP9KjuotTIuJ7dix/itNTVb18tnOBnTMZ6p9JCNqPkUZHOj6AsAxiw5g5rsaubq9gyDxzk8o1PYHpZxmGzOJ6hDUffIGa1rHVjHC+X1cxFk1GSj2aoPZqrmVOBpG0lxPpibjIxdlOfnC6JaoQ=;25:/WAwzyL6iq2FpoLrYluNaBex/k2QZPb+It5bRWUI3mP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XqS7+oxLB1/qjSeiKgKEKj13t4T56ZHyw7o/OWwcH0k9 X-Microsoft-Antispam-PRVS: 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)(8121501046)(5005006)(93006095)(93003095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:CY1PR0701MB1338;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1338; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1338;4:gW3mu6xH8MTurMG0cerDrMy/zxeSsGdCYS7NId8dlag2t2tk2gNbbyL6WxSLnBiLCQRlGTwaMolIrD+DXwDb0Lx5IOlRHt7ukwgppAxoymu0pfEAc/rP13dQyYNya6cf7U3+0wpN9Qs1b36S7qySlgEUezE1BYXQQaOFiYI5U8sB14u+iOAdt0riWb7hHQ/gMJRj4wYIIjCMmWrnrpFJxIA13OjwumfF1tr5QpUIALnG3Zv239xjemX2C5UK96ivHxMVb+YfMKK+dFUyzXJ2ypBWe5VVymsUtpl5ouBw6wx/4EYmofU0Tu/0wS0OCnUq X-Forefront-PRVS: 0749DC2CE6 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1338;23:dXLExNm946QES+ljWB2vORuGswL3UbX5wTtJI5g/UaW6dp0Bh2DabNk+KjuoyL2fsTTyW1fjcDSiiyLUmXF1EOqmMqJ09xzvHzqq6MFv2xHNSx4zkrhwTPRlj9pg361lYt1MuRPYDEUVAqeRuvRdnFogNrp0HWjWO2yRRRBZZpMCqewvvsK5B9/9V23tUhZ2PoXHGpOyp0thqbbdrxqkcXDc2Bd1nocBkmoFXZLJHhjziAGqWvAO3ijJ+MvUj0ndSTsfWafeCwspYVGRTJQMoq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nHlXkflPr59f1lTQRHEk9+16YSQXF5s7JHl22r9FjCzk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1338;20:+lE5Zgq+WYjMyFwFJ26vt0e6B7u5ht9V0XLgaFFvL4X5bNjGDCfB/z8DW9J23CZoOU6sJ+0WnYFWDo5I9iQBHNalNHr6gYf+suz6AcdktQCBjWSX5xwRokl+3N7ETf1uMnCHYn/VK2QeddA9UHeYB6X+e5Vd3vPw4wEKJspurvFVc4vknk/gRNrTrsZ5MO9h0Bx+/E1pNYxXNeOx0KpQzhfZY/lgfAOWtofBchZzIhbZY4rUluUhUk+kvH6LAYeI X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 17:23:57.4807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0ec3afc-b61b-4f40-16eb-08d5f6413cd0 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: CY1PR0701MB1338 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add set_msix and get_msix functions to driver, and handle PCI_EPC_IRQ_MSIX request in raise_irq. BAR5 is used for the MSI-X vectors. Signed-off-by: Alan Douglas --- drivers/pci/controller/pcie-cadence-ep.c | 105 ++++++++++++++++++++++++++++++ drivers/pci/controller/pcie-cadence.h | 1 + 2 files changed, 106 insertions(+), 0 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 33e30dd..e9a8f8b 100644 --- a/drivers/pci/controller/pcie-cadence-ep.c +++ b/drivers/pci/controller/pcie-cadence-ep.c @@ -16,6 +16,7 @@ #define CDNS_PCIE_EP_MIN_APERTURE 128 /* 128 bytes */ #define CDNS_PCIE_EP_IRQ_PCI_ADDR_NONE 0x1 #define CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY 0x3 +#define CDNS_PCIE_EP_MSIX_BAR 0x5 /** * struct cdns_pcie_ep - private data for this PCIe endpoint controller driver @@ -254,6 +255,44 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn) return mme; } +static int cdns_pcie_ep_get_msix(struct pci_epc *epc, u8 func_no) +{ + struct cdns_pcie_ep *ep = epc_get_drvdata(epc); + struct cdns_pcie *pcie = &ep->pcie; + u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET; + u32 val, reg; + + reg = cap + PCI_MSIX_FLAGS; + val = cdns_pcie_ep_fn_readw(pcie, func_no, reg); + if (!(val & PCI_MSIX_FLAGS_ENABLE)) + return -EINVAL; + + val &= PCI_MSIX_FLAGS_QSIZE; + + return val; +} + + +static int cdns_pcie_ep_set_msix(struct pci_epc *epc, u8 fn, u16 interrupts) +{ + struct cdns_pcie_ep *ep = epc_get_drvdata(epc); + struct cdns_pcie *pcie = &ep->pcie; + u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET; + u32 val, reg; + + reg = cap + PCI_MSIX_FLAGS; + val = cdns_pcie_ep_fn_readw(pcie, fn, reg); + val &= ~PCI_MSIX_FLAGS_QSIZE; + val |= interrupts; + cdns_pcie_ep_fn_writew(pcie, fn, reg, val); + /* Set MSIX BAR and offset */ + cdns_pcie_ep_fn_writel(pcie, fn, 0xb4, CDNS_PCIE_EP_MSIX_BAR); + /* Set PBA BAR and offset. BAR must match MSIX BAR */ + cdns_pcie_ep_fn_writel(pcie, fn, 0xb8, 0x10000|CDNS_PCIE_EP_MSIX_BAR); + + return 0; +} + static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn, u8 intx, bool is_asserted) { @@ -365,6 +404,66 @@ static int cdns_pcie_ep_send_msi_irq(struct cdns_pcie_ep *ep, u8 fn, return 0; } +static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, + u16 interrupt_num) +{ + struct cdns_pcie *pcie = &ep->pcie; + u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET; + u16 flags; + u64 pci_addr_mask = 0xff; + u16 tbl_offset = 0; + u32 bar_addr_upper, bar_addr_lower; + u32 msg_addr_upper, msg_addr_lower; + u32 msg_data; + u64 tbl_addr, msg_addr; + void __iomem *msix_tbl; + + /* Check whether the MSI-X feature has been enabled by the PCI host. */ + flags = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSIX_FLAGS); + if (!(flags & PCI_MSIX_FLAGS_ENABLE)) + return -EINVAL; + /* We want local address, not address on host. Table is at offset 0 */ + bar_addr_lower = cdns_pcie_readl(pcie, + CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, CDNS_PCIE_EP_MSIX_BAR)); + bar_addr_upper = cdns_pcie_readl(pcie, + CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR1(fn, CDNS_PCIE_EP_MSIX_BAR)); + + tbl_addr = ((u64) bar_addr_upper) << 32 | bar_addr_lower; + tbl_addr += (tbl_offset + ((interrupt_num - 1) * PCI_MSIX_ENTRY_SIZE)); + tbl_addr &= PCI_BASE_ADDRESS_MEM_MASK; + msix_tbl = phys_to_virt(tbl_addr); + if (!msix_tbl) + return -EINVAL; + + msg_addr_lower = readl(msix_tbl + PCI_MSIX_ENTRY_LOWER_ADDR); + msg_addr_upper = readl(msix_tbl + PCI_MSIX_ENTRY_UPPER_ADDR); + msg_addr = ((u64) msg_addr_upper) << 32 | msg_addr_lower; + + msg_data = readl(msix_tbl + PCI_MSIX_ENTRY_VECTOR_CTRL); + if (msg_data & 0x1) + return -EINVAL; + + msg_data = readl(msix_tbl + PCI_MSIX_ENTRY_DATA); + + iounmap(msix_tbl); + + /* Set the outbound region if needed. */ + if (unlikely(ep->irq_pci_addr != (msg_addr & ~pci_addr_mask) || + ep->irq_pci_fn != fn)) { + /* First region was reserved for IRQ writes. */ + cdns_pcie_set_outbound_region(pcie, fn, 0, + false, + ep->irq_phys_addr, + msg_addr & ~pci_addr_mask, + pci_addr_mask + 1); + ep->irq_pci_addr = (msg_addr & ~pci_addr_mask); + ep->irq_pci_fn = fn; + } + writel(msg_data, ep->irq_cpu_addr + (msg_addr & pci_addr_mask)); + + return 0; +} + static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, enum pci_epc_irq_type type, u16 interrupt_num) @@ -384,6 +483,9 @@ static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, case PCI_EPC_IRQ_MSI: return cdns_pcie_ep_send_msi_irq(ep, fn, interrupt_num); + case PCI_EPC_IRQ_MSIX: + return cdns_pcie_ep_send_msix_irq(ep, fn, interrupt_num); + default: break; } @@ -430,6 +532,8 @@ static int cdns_pcie_ep_start(struct pci_epc *epc) .unmap_addr = cdns_pcie_ep_unmap_addr, .set_msi = cdns_pcie_ep_set_msi, .get_msi = cdns_pcie_ep_get_msi, + .set_msix = cdns_pcie_ep_set_msix, + .get_msix = cdns_pcie_ep_get_msix, .raise_irq = cdns_pcie_ep_raise_irq, .start = cdns_pcie_ep_start, }; @@ -508,6 +612,7 @@ static int cdns_pcie_ep_probe(struct platform_device *pdev) } epc_set_drvdata(epc, ep); + epc->features |= EPC_FEATURE_MSIX_AVAILABLE; if (of_property_read_u8(np, "max-functions", &epc->max_functions) < 0) epc->max_functions = 1; diff --git a/drivers/pci/controller/pcie-cadence.h b/drivers/pci/controller/pcie-cadence.h index ae6bf2a..71fe6f4 100644 --- a/drivers/pci/controller/pcie-cadence.h +++ b/drivers/pci/controller/pcie-cadence.h @@ -94,6 +94,7 @@ #define CDNS_PCIE_EP_FUNC_BASE(fn) (((fn) << 12) & GENMASK(19, 12)) #define CDNS_PCIE_EP_FUNC_MSI_CAP_OFFSET 0x90 +#define CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET 0xb0 /* * Root Port Registers (PCI configuration space for the root port function)