Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3482473imu; Sun, 11 Nov 2018 16:06:47 -0800 (PST) X-Google-Smtp-Source: AJdET5f/hEF2/lyk+nUOQuAeDANZM/v5vQ9C4pOPRZUVcNQP1sYyjInBQANsymaPj1vh+07rX39P X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr11913530plk.235.1541981207122; Sun, 11 Nov 2018 16:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981207; cv=none; d=google.com; s=arc-20160816; b=rp93doy/IixPjNBzVcePEPDwnReste1axNP09XasXQ1F5k84m/5XzKiFg7EMBzgEb9 gOzvy1CTswvBSfF0/obPmE5G7AOwRgxh8VE8QHQREhEsenBRfZawOlQpNAQGcnVst8BM pu19XCBUN3QtJ0KU17ixl0B5ANbY6uQx4rh9nPfGzwKifmVY0kIMQQzuppdVJGl6x/6M qNKOd06JXjqNaFIEwgrv8LPlwVq+PcDw0QvUgG1iIjsrxGu4BqWWrJfho1Uq7UMd+Z6f 4KhIBmkYHdzBN6sIb0+9n7oq8GSIDRsAZiUyJDWu4Osl7fCppY0PjlXbePcNKSk8voPo OFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JbIi8jgCiVfZssgMqogJM5HsdZNeVfz4mFY/yg/Dqas=; b=x2/xxZS+ixJrQsIMbY4LOuP/AiP7xM0GURmneYnJIVgyMG4p+WDByM6oJ5dBv0Pijk RgpWFYvjFPGJxRiEOlN8LM00zZcv43nxd4Zm4E2RwfG7tTKuBTufTIvQQ33gwEodlRJF M8bmuCiNV3FBcz93NqSTnnZg3x9o95Q1NBp/szkQOGMRfCRU/wBOAAcnncwvPWp00GmQ +PSTsH4w9MfgR1ouTdRKRgJbwxouUrZWDpqDoGJ62HOQUPnjiJPsSxlKskOSKk2PD00V C+JEfs9BkFZs33CBvRdfsA2YNWpPo773JEXqBfG6IR8wcF7H2uPKY99OgiFcx7SKy/GC pb/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c91MjRuh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si14699877pgl.59.2018.11.11.16.06.31; Sun, 11 Nov 2018 16:06:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c91MjRuh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731853AbeKLIRj (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:33864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731593AbeKLIRi (ORCPT ); Mon, 12 Nov 2018 03:17:38 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DB1322353; Sun, 11 Nov 2018 22:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975262; bh=ovIeQ0ivphsRrw6UemqLB4LhpgupPPY/KkdZIHRoGRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c91MjRuhynWACeurRdi7LE5Ve36KmG0Ygm6/QEauHA6ix7uEioIYVz8Hhnyf43hSQ F4svjxOjggpX6IZehBFiPLt5heZdd/iali14TVsio3s0dtuRqhjGEjSjR4RBvrFETR zTcCIZ1XvORKvkojXYyg5eK3n3ExJ6N1rXAdl0Zc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Douglas , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH 4.19 149/361] PCI: cadence: Use AXI region 0 to signal interrupts from EP Date: Sun, 11 Nov 2018 14:18:16 -0800 Message-Id: <20181111221641.262030976@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alan Douglas [ Upstream commit 0652d4b6b56f73c81abbdbc7e26f772cb2dfe370 ] 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. This corrects a problem which prevents the interrupt being signalled correctly if using the first address in the AXI region, since an offset of zero will always be mapped to region 0. Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller") Signed-off-by: Alan Douglas Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pcie-cadence-ep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- 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(str 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(str /* 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(str /* 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 pla 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;