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;