* [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment [not found] <20240213002235.671934-1-sashal@kernel.org> @ 2024-02-13 0:22 ` Sasha Levin 2024-02-18 18:01 ` Pavel Machek 0 siblings, 1 reply; 3+ messages in thread From: Sasha Levin @ 2024-02-13 0:22 UTC (permalink / raw) To: linux-kernel, stable Cc: Dan Carpenter, Bjorn Helgaas, Niklas Cassel, Ilpo Järvinen, Manivannan Sadhasivam, Sasha Levin, jingoohan1, gustavo.pimentel, lpieralisi, kw, linux-pci From: Dan Carpenter <dan.carpenter@linaro.org> [ 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 <dan.carpenter@linaro.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- 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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment 2024-02-13 0:22 ` [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment Sasha Levin @ 2024-02-18 18:01 ` Pavel Machek 2024-02-21 18:53 ` Sasha Levin 0 siblings, 1 reply; 3+ messages in thread From: Pavel Machek @ 2024-02-18 18:01 UTC (permalink / raw) To: Sasha Levin Cc: linux-kernel, stable, Dan Carpenter, Bjorn Helgaas, Niklas Cassel, Ilpo Järvinen, Manivannan Sadhasivam, jingoohan1, gustavo.pimentel, lpieralisi, kw, linux-pci [-- Attachment #1: Type: text/plain, Size: 1262 bytes --] Hi! > From: Dan Carpenter <dan.carpenter@linaro.org> > > [ 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). Just a cleanup, we don't need it in stable. Best regards, Pavel > +++ 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) -- People of Russia, stop Putin before his war on Ukraine escalates. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment 2024-02-18 18:01 ` Pavel Machek @ 2024-02-21 18:53 ` Sasha Levin 0 siblings, 0 replies; 3+ messages in thread From: Sasha Levin @ 2024-02-21 18:53 UTC (permalink / raw) To: Pavel Machek Cc: linux-kernel, stable, Dan Carpenter, Bjorn Helgaas, Niklas Cassel, Ilpo Järvinen, Manivannan Sadhasivam, jingoohan1, gustavo.pimentel, lpieralisi, kw, linux-pci On Sun, Feb 18, 2024 at 07:01:05PM +0100, Pavel Machek wrote: >Hi! > >> From: Dan Carpenter <dan.carpenter@linaro.org> >> >> [ 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). > >Just a cleanup, we don't need it in stable. Dropped, thanks! -- Thanks, Sasha ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-21 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240213002235.671934-1-sashal@kernel.org>
2024-02-13 0:22 ` [PATCH AUTOSEL 6.1 23/28] PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment Sasha Levin
2024-02-18 18:01 ` Pavel Machek
2024-02-21 18:53 ` Sasha Levin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox