Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2774764rdb; Mon, 12 Feb 2024 16:56:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqowkwoqmLUrvnrF7zVivawQXFqM1rhOmSdQ+3QHdQvZnDTPpPfu95BTUIoPGj8j1S3VzdgOFN3WmVOt/93Ckh6KndpmxqzKrUDUv46Q== X-Google-Smtp-Source: AGHT+IFsLOcuUDR7xkU8xv3VFQ/ESA78f36T2ickQJVZSTzo9r45BJJm+oFjAXN0mI2kY+n9ZQmS X-Received: by 2002:a05:622a:509:b0:42c:7da1:693a with SMTP id l9-20020a05622a050900b0042c7da1693amr3935233qtx.36.1707785796618; Mon, 12 Feb 2024 16:56:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707785796; cv=pass; d=google.com; s=arc-20160816; b=GAsmwT+LsfpW+bHmffLs7OEoFzoGvqFg6zmyN8aGCuizaInC8WKNTXojc/T4KgY6a1 jILWIBhVtyJhcJEU3GuXheKB1md3KBZmKVIeewCBsd+PNSLEn9coR4ParaQp9BUvfi7t 38txRfYy4YqF7UMdnEsmrOoR+DXgT4BwPP7TrSRzAj/I9wMLAMaVxATy9bNl/hBU9EST s+QJmE/gsqOW3jXwQhcXkQVGqsWF5Hy9sYK9gm2bNv6vcuwMxnqMdNzzukcPJKmlRwku v8UooRmK8iX9MasMPXxA6uLb+wfq29yOg9Cd0i707q+4rKi03tSGmS1qNahOotHIHOP8 3cPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=K14PdJZr2u9IQyISXXs3dHNkmjg+oSRiR7laZVXFr/g=; fh=3NWbDupkVjfpNTuli2hxqJW4W1JszuN0S/t7DksYO9Q=; b=pVIj+NRADOVFOfP/ZRJXnHwVHuQAL1tUrdPo5UV0/WAnIlnZb499L9Q+7j8NWMNLpu 6So/oebXhRlNciwJH8Q4xXg5D/tsvzXMGLoXDI26uHnTrLNkreNY/aRN96E/VZwuI/pW Hpizd8L7o7gZOi7B4E4VB0M1TVI+Ll6TApOOhkj3L+sXc+EQ6qisz/uRgLjCG4kRHjDt aoX0VGMHhNRF1pGUC0VwxJX49GbcQCUw8FJAVdACiCVFUZLlmdt3Rbgg5O8bIN1++PHC pRtSUyRxizBuLqk1XTxlkww0ezr9cp4z5+vezuxAZH4+e/zgyqG15MULwfSPSxLeJ5vL 1Tig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O3N7p0nV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVutTF/KKmCppskr0nC4KMe7fehGrZsvBIpb5DFWGnlYMqa1iAGCGeYHefDfJIBaCPQNhtpQIoVOGG5L44eAtg7AhIkV7sG2jcONRuxGQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f26-20020ac8499a000000b0042da7c19170si1399330qtq.670.2024.02.12.16.56.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 16:56:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O3N7p0nV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 61EB31C22C04 for ; Tue, 13 Feb 2024 00:56:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AF2380C02; Tue, 13 Feb 2024 00:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O3N7p0nV" 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 9F80A81755; Tue, 13 Feb 2024 00:23:09 +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=1707783789; cv=none; b=NcGzfTkkYiAXE9NTWVF0dO2kFe4UJxjwcWZ5qg2kgbjacd0K/CYzl2OwYgHXb1+yNEYOOk8BqPcFPlBoqLOdQ3Zpi+8DB/5fym2GCZmyiC9Qy8QFfjgbBlsMH2iLunSlnqHyiA/SllKZQwSteJlwkC+HbFuOe992CoA70v2ltHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783789; c=relaxed/simple; bh=h2R2cYRyDIUhPm+TMUvSPSOvLAZTtewgg5O8+FSt1JI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AdXEQA6oBLgsiKZkDux+tQk+DErpiUP604MYIQaRPDjZIBcuy4emqmgjsmYHj7qnkNN4DHZd0S5UgIbsmNnJDhv3a4bS5G/XZ8/0VGzP0voxUeYI7xs7XxKrePlo3225SfMuNj9Bv1FuDLA72x1t5E8/WyrVRwzbRh/Fo/ef66c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O3N7p0nV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2EA7C433B2; Tue, 13 Feb 2024 00:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707783789; bh=h2R2cYRyDIUhPm+TMUvSPSOvLAZTtewgg5O8+FSt1JI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3N7p0nVRlKdQT3pBF2V6j4c4YATLvYuSFD6Dh3wGKx7N+9nVLIbXqStGsAb8Jpls UAG3WQunfY3K15gsZxu3FzU/IUUG7w9S0SybdrL6GdOF8DTrZzNVAM9qEYrghOCV2I HxOhkKIZzWAz3z6SLDzUMaPtmbFFn+1aV0z+ohNcvjvo668XM29QGQNmQSDKIQdwM3 mQa1O3qiX9/iGnzRk+WAWktZmKVRQZ7Ho9tnl/WzolnaAL0eYnha1rIGRNklpVy0oD exaf+vjROj/SDj03Vz/BmYVVtitzF6tXVRe1sQSpWBhkfp/L6Sbilli9/dqQ82GvQf nbzPRpF0B1Lrg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Bjorn Helgaas , Niklas Cassel , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Manivannan Sadhasivam , Sasha Levin , jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, lpieralisi@kernel.org, kw@linux.com, linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment Date: Mon, 12 Feb 2024 19:22:21 -0500 Message-ID: <20240213002235.671934-23-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213002235.671934-1-sashal@kernel.org> References: <20240213002235.671934-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.77 Content-Transfer-Encoding: 8bit From: Dan Carpenter [ Upstream commit 67057f48df79a3d73683385f521215146861684b ] I recently changed the alignment code in dw_pcie_ep_raise_msix_irq(). The code in dw_pcie_ep_raise_msi_irq() is similar, so update it to match, just for consistency. (No effect on runtime, just a cleanup). Link: https://lore.kernel.org/r/184097e0-c728-42c7-9e8a-556bd33fb612@moroto.mountain Signed-off-by: Dan Carpenter Signed-off-by: Bjorn Helgaas Reviewed-by: Niklas Cassel Reviewed-by: Ilpo Järvinen Reviewed-by: Manivannan Sadhasivam Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-designware-ep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 59c164b5c64a..cfdeb1e2935c 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -528,9 +528,10 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, reg = ep_func->msi_cap + func_offset + PCI_MSI_DATA_32; msg_data = dw_pcie_readw_dbi(pci, reg); } - aligned_offset = msg_addr_lower & (epc->mem->window.page_size - 1); - msg_addr = ((u64)msg_addr_upper) << 32 | - (msg_addr_lower & ~aligned_offset); + msg_addr = ((u64)msg_addr_upper) << 32 | msg_addr_lower; + + aligned_offset = msg_addr & (epc->mem->window.page_size - 1); + msg_addr = ALIGN_DOWN(msg_addr, epc->mem->window.page_size); ret = dw_pcie_ep_map_addr(epc, func_no, 0, ep->msi_mem_phys, msg_addr, epc->mem->window.page_size); if (ret) -- 2.43.0