pci-v6.8-fixes-2

-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmXGSRoUHGJoZWxnYWFz
 QGdvb2dsZS5jb20ACgkQWYigwDrT+vzz/BAAiTzhJJuiDwI9GG5yiyvsNzVuPWqM
 L0r3Or3WC7RzibHrVcCzCryjYQCGhrwsFCuknzPRatno4wknqaG2vu3ZinfuBBie
 BvIU+gA/fLCD8KZ5ZODOiboR9547ggVpLOxDv/4QKAq8l+YAAJOaoHytySi1HsgG
 Pj9Q1D4iYLe6OVZfFTfSMublpAmqnvczFXDRVv1xMT4Kksf0hfX1YwU0l6AEqFTX
 DT6kCq6JXH/0ZAZZZq7o9VoxY7BQprATMa8gM0CX6v9PjEg/QmOTpXPRZ5zZyg0b
 ppKEDKkLZ69AyXcsjJ55bWbx8yzyzNsPT5nkPg/jCU8gD6DOPAIAGbdnH3jt5LU5
 iKYcExt4ciBYgIKkk73FxLGMMvrKWon7kdcgF43atqyzifzxTzWib8h30/wnLuZB
 Hnlm/lBcC6ThGQiL0WbW/gmXU6DQx92HDCD4k97JGwpwNL79H2sXCm4xAyvPkNYR
 ATYaeG/yswPtfotOjdPIXx9Tq1y07U8btVYyivaDm5q6ty2js6XNaSiCya/W+f5l
 +lDz48DbqAEL6hR34dPKFDK6peEuGi4/+CmyHsqYhBt2n7eLL74M7yPme1zwyC9o
 qBJiHucog/2cBkOvIdowsNgGua06lFxBlMXKTUN1DNcogLkjKiBJ6zsO757g3tsq
 s63ofJw/Tgfv4i8=
 =jJks
 -----END PGP SIGNATURE-----

Merge tag 'pci-v6.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci

Pull pci fixes from Bjorn Helgaas:

 - Fix an unintentional truncation of DWC MSI-X address to 32 bits and
   update similar MSI code to match (Dan Carpenter)

* tag 'pci-v6.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  PCI: dwc: Clean up dw_pcie_ep_raise_msi_irq() alignment
  PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()
This commit is contained in:
Linus Torvalds 2024-02-09 10:37:59 -08:00
commit 5ddfc24606

View File

@ -6,6 +6,7 @@
* Author: Kishon Vijay Abraham I <kishon@ti.com>
*/
#include <linux/align.h>
#include <linux/bitfield.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@ -482,9 +483,10 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
reg = ep_func->msi_cap + PCI_MSI_DATA_32;
msg_data = dw_pcie_ep_readw_dbi(ep, func_no, 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)
@ -551,7 +553,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;
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)