]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/amd: Rename DTE_INTTABLEN* and MAX_IRQS_PER_TABLE macro
authorSairaj Kodilkar <sarunkod@amd.com>
Fri, 7 Mar 2025 09:58:21 +0000 (15:28 +0530)
committerJoerg Roedel <jroedel@suse.de>
Thu, 13 Mar 2025 11:14:16 +0000 (12:14 +0100)
AMD iommu can support both 512 and 2K interrupts on newer platform. Hence
add suffix "512" to the existing macros.

Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20250307095822.2274-4-sarunkod@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c

index 487fbe97aeaf0849feeffbf8c30a28a51ecf7fc9..433eca602a4eef9c4b951b365f560ef5b897884b 100644 (file)
  * AMD IOMMU hardware only support 512 IRTEs despite
  * the architectural limitation of 2048 entries.
  */
-#define DTE_INTTABLEN_VALUE     9ULL
-#define DTE_INTTABLEN           (DTE_INTTABLEN_VALUE << 1)
 #define DTE_INTTABLEN_MASK      (0xfULL << 1)
-#define MAX_IRQS_PER_TABLE      (1 << DTE_INTTABLEN_VALUE)
+#define DTE_INTTABLEN_VALUE_512 9ULL
+#define DTE_INTTABLEN_512       (DTE_INTTABLEN_VALUE_512 << 1)
+#define MAX_IRQS_PER_TABLE_512  BIT(DTE_INTTABLEN_VALUE_512)
 
 #define PAGE_MODE_NONE    0x00
 #define PAGE_MODE_1_LEVEL 0x01
index 1f305371c4c31f00e6bac2b36e7d8ead6a9a104f..d91c04253fd3ca4c15d2538bc191c66de5c86853 100644 (file)
@@ -1060,7 +1060,7 @@ static bool __copy_device_table(struct amd_iommu *iommu)
                int_tab_len = old_devtb[devid].data[2] & DTE_INTTABLEN_MASK;
                if (irq_v && (int_ctl || int_tab_len)) {
                        if ((int_ctl != DTE_IRQ_REMAP_INTCTL) ||
-                           (int_tab_len != DTE_INTTABLEN)) {
+                           (int_tab_len != DTE_INTTABLEN_512)) {
                                pr_err("Wrong old irq remapping flag: %#x\n", devid);
                                memunmap(old_devtb);
                                return false;
index 3123b8fe7f8b6f97c128938364ada490dca8155c..d4559d555fa0a9911ba0d3bcbd53a30f60f9988d 100644 (file)
@@ -3090,7 +3090,7 @@ static void set_dte_irq_entry(struct amd_iommu *iommu, u16 devid,
        new &= ~DTE_IRQ_PHYS_ADDR_MASK;
        new |= iommu_virt_to_phys(table->table);
        new |= DTE_IRQ_REMAP_INTCTL;
-       new |= DTE_INTTABLEN;
+       new |= DTE_INTTABLEN_512;
        new |= DTE_IRQ_REMAP_ENABLE;
        WRITE_ONCE(dte->data[2], new);