From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEF543CF42; Wed, 21 Feb 2024 14:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524804; cv=none; b=Q5vg6Y2dDPGJrprqylyxTZ8GZeR++gosO8DfwJR0UY0UqDEdp2nWTWp0p41c7iunCJDPMF8wrbCjT73zAvdyhlvpn116Q8dKrVs27XXWT5/RbLo/YdyLB6PBrPJPUCXgOPV75Q8uDbQu5mnFt3vCuGEhmvCeXoOYSHGPa9QCXgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524804; c=relaxed/simple; bh=Vts7DhFppRGGTpPnqUzpexQq9MkeIvjyExg8oXthACk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EmLl7pXhMipinDB75DIClSlHmDoge0nmFWc/BPMgCo02dSBR4fTKuiVNKtHM0kMTlp0LA//JgqTF9ZsOMVHrP/xfdKsWzFXgqGaMzF+iwyEOjTWwrXMXKSi5+svPqVfmMpCvnHpArarByBk9OnVcHkgih/c+X4xTv2XTuljB+MY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OmriWO/G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="OmriWO/G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B78AC433F1; Wed, 21 Feb 2024 14:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708524804; bh=Vts7DhFppRGGTpPnqUzpexQq9MkeIvjyExg8oXthACk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OmriWO/GRFPWmI8oMxEJMYUE0VHFxfiRpotroL1e5zFUHwzfRTdxD0ksSXJrGHp1I cDKsDgRT2d8ix7bpSqqWBmslcC40uafsonmLKAjJR3LZQOMdTkFyE8qQFyWsDoXJm9 jETfCvf7WksTpay8ZgeUVgImPjGu5o418U3AlNPc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Niklas Cassel , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH 5.10 354/379] PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support Date: Wed, 21 Feb 2024 14:08:53 +0100 Message-ID: <20240221130005.501717467@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240221125954.917878865@linuxfoundation.org> References: <20240221125954.917878865@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel [ Upstream commit 2217fffcd63f86776c985d42e76daa43a56abdf1 ] Commit 6f5e193bfb55 ("PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get correct MSI-X table address") modified dw_pcie_ep_raise_msix_irq() to support iATUs which require a specific alignment. However, this support cannot have been properly tested. The whole point is for the iATU to map an address that is aligned, using dw_pcie_ep_map_addr(), and then let the writel() write to ep->msi_mem + aligned_offset. Thus, modify the address that is mapped such that it is aligned. With this change, dw_pcie_ep_raise_msix_irq() matches the logic in dw_pcie_ep_raise_msi_irq(). Link: https://lore.kernel.org/linux-pci/20231128132231.2221614-1-nks@flawful.org Fixes: 6f5e193bfb55 ("PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get correct MSI-X table address") Signed-off-by: Niklas Cassel Signed-off-by: Krzysztof WilczyƄski Reviewed-by: Manivannan Sadhasivam Cc: stable@vger.kernel.org # 5.7 Cc: Kishon Vijay Abraham I Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-designware-ep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 95ed719402d7..e27bac623684 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -593,6 +593,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no, } aligned_offset = msg_addr & (epc->mem->window.page_size - 1); + msg_addr &= ~aligned_offset; ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys, msg_addr, epc->mem->window.page_size); if (ret) -- 2.43.0