Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp172642imd; Wed, 31 Oct 2018 16:47:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5f2dcPbFYngOFgllCUX3sPOlB54voNabLTxPpxy/GyGDUJfRnsKJHMbKYFhavCMoT/hPGoN X-Received: by 2002:a17:902:54d:: with SMTP id 71-v6mr5436003plf.80.1541029620037; Wed, 31 Oct 2018 16:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029620; cv=none; d=google.com; s=arc-20160816; b=G/FsOa2eMz1MuTs7xzk715Yv78rfbI/rQhopymgQM6mkU/XFr8981rq0VIN+Rid7W4 kxCP/Y/Xqdp/j3UusUKjMHfNRquIuWM/ekfEmxJUBRT8tINT6LP65ToGuSBwaqleRD23 BQsA3UeLpw0zRM7l7qTG9a3lexhXD0fpIjTXZs1PKiQUDP71hwkSnaKiOo5PkgsuIE4Z bOsyhDeIzyEi/Qn2FwTbTiapjkHVCz28LeQC+Ny9u2hNUXkqXHH+BA64tc3NO7c8clGC x31QTSeuBMrLEAuTsynjrlmj+OuZ4hbraAC1RqQgB9+a+M+ukFP0CQdCXKeBkjPtoq1B tMUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=fj+ZGPvvKZ+shixXfX/KP1caM5+TVI2onSA3cTXgQoY=; b=dH3jj5raFPyixSrUHuyb48OW6t520NfIpDr303RF6RSVhu9piYhU6yDvfSvUeDktF5 geQNl2TVm55v/aGnlNnshTtzvddrpjdbU0Ly3pDwGjByJBTfPSQ3gNNtKrNwKKnhahOe hTERQbmJtjgLf7fZvydQb2gZhrgjnGX2ms6X2wiHVjjYcjihXoUy6c7QZPVGrV6EWE4+ J1UuzdQRhnlSP2lD34zQOn9XXYfoLxP9MPpbmtt30P5oMywp9aQ7YQ7f5UlCc5gC4hOf 4ZbnPQnHUzN1Tk1ZBuacRqI+L2MQlj3ssIPluOeKJay0tQwkV5Vx6cR24CSLHWXWA777 Ztrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fleE6GDj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7-v6si27635001pls.358.2018.10.31.16.46.45; Wed, 31 Oct 2018 16:46:59 -0700 (PDT) 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=fleE6GDj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728923AbeKAIH3 (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:55222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbeKAIH1 (ORCPT ); Thu, 1 Nov 2018 04:07:27 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CB95920838; Wed, 31 Oct 2018 23:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027236; bh=qfDBSN5mygco8LttDLboGl6OPr7seNGmrRBXBNsvZ3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fleE6GDjmmMiS6SPe8qsmhed0gCYh/Vj0Eu72wt3PK4N91NqGDX5AWS+eISKWSCTc IO4mxbc4Y7K25BwjzRqYcoakOURgBMBf6rGe1umZ8WUvS0OeI8gloMGRo3rW4FK9po MB87Ym2qlsm1bBBY8Sf1+ykAEeiMIWVTYwn2UIJc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alan Douglas , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH AUTOSEL 4.19 104/146] PCI: cadence: Use AXI region 0 to signal interrupts from EP Date: Wed, 31 Oct 2018 19:04:59 -0400 Message-Id: <20181031230541.28822-104-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/pci/controller/pcie-cadence-ep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c index 9e87dd7f9ac3..6692654798d4 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; -- 2.17.1