Skip to contentSkip to conversation

ata: pata_ep93xx: add missing "cc" clobber to inline asm

PATCH Superseded Rosen Penev 2 participants 3 messages Jun 1 – Jul 20 libata

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: pata_ep93xx: add missing "cc" clobber to inline asm

The inline assembly in ep93xx_pata_delay() uses a "subs" instruction which modifies the ARM condition code flags. Add a "cc" clobber so the compiler knows the flags are altered. Without it, the compiler may reorder flag-dependent instructions across the asm block when the function is inlined, potentially causing incorrect control flow.

Assisted-by Opencode:Big-Pickle
---
 drivers/ata/pata_ep93xx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ata/pata_ep93xx.c +1 -0
index aa6f8172925d..838cab54d58a 100644
@@ -211,6 +211,7 @@ static void ep93xx_pata_delay(unsigned long count)
 		"bge 0b\n"
 		: "=r" (count)
 		: "0" (count)
+		: "cc"
 	);
 }
 
Signature · 1 line
2.54.0
#1 lore raw
Quoted 9 lines · Rosen Penev

The inline assembly in ep93xx_pata_delay() uses a "subs" instruction which modifies the ARM condition code flags. Add a "cc" clobber so the compiler knows the flags are altered. Without it, the compiler may reorder flag-dependent instructions across the asm block when the function is inlined, potentially causing incorrect control flow.

Assisted-by Opencode:Big-Pickle

should I resend?

Quoted 19 lines
---
 drivers/ata/pata_ep93xx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ata/pata_ep93xx.c +1 -1
index aa6f8172925d..838cab54d58a 100644
@@ -211,6 +211,7 @@ static void ep93xx_pata_delay(unsigned long count)
                "bge 0b\n"
                : "=r" (count)
                : "0" (count)
+               : "cc"
        );
 }
 
--

2.54.0

maintainer
#2 lore raw
Quoted 11 lines · Rosen Penev
Quoted 9 lines · Rosen Penev

The inline assembly in ep93xx_pata_delay() uses a "subs" instruction which modifies the ARM condition code flags. Add a "cc" clobber so the compiler knows the flags are altered. Without it, the compiler may reorder flag-dependent instructions across the asm block when the function is inlined, potentially causing incorrect control flow.

Assisted-by Opencode:Big-Pickle

should I resend?

Oops. This fell through the cracks. Yes, please resend and add a fixes tag as well.

Signature · 2 lines
Damien Le Moal
Western Digital Research