Skip to contentSkip to conversation

ACPI: IORT: Add extra message "applying workaround" for off-by-1 issue

PATCH Superseded Hanjun Guo 2 participants 5 messages May 7, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Hanjun Guo

author maintainer
#0 lore raw

PATCH 1/1 ACPI: IORT: Add extra message "applying workaround" for off-by-1 issue

As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see such message in the boot log.

---

Based on top of for-next/acpi branch of ARM64 repo

 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +1 -1
index b011d25..f3d492a 100644
@@ -328,7 +328,7 @@ static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in,
 		 * Otherwise, things are *really* broken, and we just disregard
 		 * duplicate matches entirely to retain compatibility.
 		 */
-		pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x\n",
+		pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x, applying workaround\n",
 		       map, rid_in);
 		if (rid_in != map->input_base)
 			return -ENXIO;
Signature · 1 line
1.7.12.4
#1 lore raw
Quoted 6 lines · Hanjun Guo

As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see such message in the boot log.

Hi Hanjun,

Quoted 12 lines

---

Based on top of for-next/acpi branch of ARM64 repo

 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +0 -0
index b011d25..f3d492a 100644

drivers/acpi/arm64/iort.c static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in, · line 331

Quoted 5 lines
drivers/acpi/arm64/iort.c +1 -1
@@ -328,7 +328,7 @@ static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in,
                 * Otherwise, things are *really* broken, and we just disregard
                 * duplicate matches entirely to retain compatibility.
                 */
-               pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x\n",
+               pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x, applying workaround\n",

This is not correct. The workaround is only applied if rid_in == map->input_base, so better to print a second line after the 'return' below that is only reached in that particular case.

Quoted 6 lines
drivers/acpi/arm64/iort.c +0 -1
                       map, rid_in);
                if (rid_in != map->input_base)
                        return -ENXIO;
--

1.7.12.4

author maintainer
#2 lore raw

Hi Ard,

Quoted 17 lines · Ard Biesheuvel
Quoted 6 lines · Hanjun Guo

As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see such message in the boot log.

Hi Hanjun,

Quoted 7 lines

---

Based on top of for-next/acpi branch of ARM64 repo

  drivers/acpi/arm64/iort.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/acpi/arm64/iort.c static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in, · line 331

Quoted 10 lines
drivers/acpi/arm64/iort.c +1 -1
index b011d25..f3d492a 100644
@@ -328,7 +328,7 @@ static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in,
                  * Otherwise, things are *really* broken, and we just disregard
                  * duplicate matches entirely to retain compatibility.
                  */
-               pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x\n",
+               pr_err(FW_BUG "[map %p] conflicting mapping for input ID 0x%x, applying workaround\n",

This is not correct. The workaround is only applied if rid_in == map->input_base, so better to print a second line after the 'return' below that is only reached in that particular case.

Obvious I'm wrong, I will update this patch, thanks a lot!

Quoted 10 lines
Quoted 7 lines
drivers/acpi/arm64/iort.c +0 -1
                        map, rid_in);
                 if (rid_in != map->input_base)
                         return -ENXIO;
--

1.7.12.4

.

author maintainer
#3 lore raw
Quoted 38 lines · Hanjun Guo

Hi Ard,

Quoted 26 lines · Ard Biesheuvel
Quoted 6 lines · Hanjun Guo

As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see such message in the boot log.

Hi Hanjun,

Quoted 16 lines

---

Based on top of for-next/acpi branch of ARM64 repo

  drivers/acpi/arm64/iort.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +0 -0
index b011d25..f3d492a 100644
@@ -328,7 +328,7 @@ static int iort_id_map(struct 
 acpi_iort_id_mapping *map, u8 type, u32 rid_in,
                   * Otherwise, things are *really* broken, and we just disregard
                   * duplicate matches entirely to retain compatibility.
                   */
Quoted 8 lines

drivers/acpi/arm64/iort.c static int iort_id_map(struct · line 334

Quoted 4 lines
drivers/acpi/arm64/iort.c +1 -1
-               pr_err(FW_BUG "[map %p] conflicting mapping for input 
 ID 0x%x\n",
+               pr_err(FW_BUG "[map %p] conflicting mapping for input 
 ID 0x%x, applying workaround\n",

This is not correct. The workaround is only applied if rid_in == map->input_base, so better to print a second line after the 'return' below that is only reached in that particular case.

Quoted 1 line

Obvious I'm wrong, I will update this patch, thanks a lot!

By the way, how about the print below? Should I add something more?

                if (rid_in != map->input_base)
                        return -ENXIO;

+
+ pr_err(FW_BUG "applying workaround for the conflicting mapping\n");

Thanks
Hanjun

#4 lore raw
Quoted 49 lines · Hanjun Guo
Quoted 39 lines · Hanjun Guo

Hi Ard,

Quoted 27 lines · Ard Biesheuvel
Quoted 6 lines · Hanjun Guo

As we already applied a workaround for the off-by-1 issue, it's good to add extra message "applying workaround" to make people less uneasy to see such message in the boot log.

Hi Hanjun,

Quoted 17 lines

---

Based on top of for-next/acpi branch of ARM64 repo

  drivers/acpi/arm64/iort.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +0 -0
index b011d25..f3d492a 100644
@@ -328,7 +328,7 @@ static int iort_id_map(struct
 acpi_iort_id_mapping *map, u8 type, u32 rid_in,
                  * Otherwise, things are *really* broken, and we

just disregard
* duplicate matches entirely to retain compatibility. */

Quoted 8 lines
Quoted 4 lines

- pr_err(FW_BUG "[map %p] conflicting mapping for input
ID 0x%x\n",
+ pr_err(FW_BUG "[map %p] conflicting mapping for input
ID 0x%x, applying workaround\n",

This is not correct. The workaround is only applied if rid_in == map->input_base, so better to print a second line after the 'return' below that is only reached in that particular case.

Quoted 1 line

Obvious I'm wrong, I will update this patch, thanks a lot!

By the way, how about the print below? Should I add something more?

                 if (rid_in != map->input_base)
                         return -ENXIO;
(quoted diff) +2 -0
+
+         pr_err(FW_BUG "applying workaround for the conflicting
Quoted 2 lines

mapping\n");

Simply 'applying workaround' should do it imo.