[PATCH] pci: layerscape: fix pci_iommu_extra hotplug

Vincent Jardin <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
We can have many pci hotplug groups, each introduced
by a "pci@<addr>" token such as,

  pci_iommu_extra=pci@0x3600000,1.0.0,hp,pci@0x3700000,1.0.0,hp,
                  pci@0x3800000,1.0.0,hp,pci@0x3900000,1.0.0,hp

Without this fix, we have the error:
  Added iommu map for hotplug 1.0.0
  ERROR: invalid action in extra iommu entry
  ERROR: invalid action in extra iommu entry
  ERROR: invalid action in extra iommu entry

Fixes: 2a5bbb13cc39 ("pci: layerscape: add a way of specifying additional iommu mappings")
Signed-off-by: Vincent Jardin <[email protected]>

---

 drivers/pci/pcie_layerscape_fixup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c
index 97c38c0bfa7..5299aee63db 100644
--- a/drivers/pci/pcie_layerscape_fixup.c
+++ b/drivers/pci/pcie_layerscape_fixup.c
@@ -319,6 +319,11 @@ static struct extra_iommu_entry *get_extra_iommu_ents(void *blob,
 			/* Hot-plug entry */
 			entries[i].action = EXTRA_IOMMU_ENTRY_HOTPLUG;
 			p += 2;
+			/* Skip the comma separator so it check the
+			 * next "pci@" group.
+			 */
+			if (*p == ',')
+				p++;
 		} else if (!strncmp(p, "vfs", 3) ||
 			   !strncmp(p, "noari_vfs", 9)) {
 			/* VFs or VFs with ARI disabled entry */
---
base-commit: 616c3d79f01cf9204e38738857c4647a730dcb3b
branch: for-upstream/pci-layerscape-iommu-extra-v1

-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.