PCI: dwc: Strengthen the MSI address allocation logic
authorAjay Agarwal <ajayagarwal@google.com>
Wed, 21 Feb 2024 15:38:40 +0000 (21:08 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Sun, 10 Mar 2024 18:08:04 +0000 (18:08 +0000)
commitf3a296405b6e65fe478144c2f85602dc5668700c
tree3e50791c1253475b5bca2b5383778a4d8b390d69
parent6613476e225e090cc9aad49be7fa504e290dd33d
PCI: dwc: Strengthen the MSI address allocation logic

There can be platforms that do not use/have 32-bit DMA addresses.
The current implementation of 32-bit IOVA allocation can fail for
such platforms, eventually leading to the probe failure.

Try to allocate a 32-bit msi_data. If this allocation fails,
attempt a 64-bit address allocation. Please note that if the
64-bit MSI address is allocated, then the EPs supporting 32-bit
MSI address only will not work.

Link: https://lore.kernel.org/linux-pci/20240221153840.1789979-1-ajayagarwal@google.com
Tested-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Ajay Agarwal <ajayagarwal@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Will McVicker <willmcvicker@google.com>
drivers/pci/controller/dwc/pcie-designware-host.c