Skip to contentSkip to conversation

rt: Fix buid issue in be2net

PATCH In review Ben Hutchings 3 participants 3 messages Mar 28, 2025 – Mar 31, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt: Fix buid issue in be2net

The problem described here is specific to v5.10-rt.

The function be_cmd_unlock() includes the line:

    return spin_unlock_bh(...);

In 5.10-rt, with CONFIG_PREEMPT_RT enabled, spin_unlock_bh() is a macro that doesn't expand to a valid expression, so this fails to compile.

A similar issue was recently fixed in at_hdmac. Do the same thing
here: make the spin_unlock_bh() and return 2 separate statements.

---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/emulex/benet/be_cmds.c +5 -3
index 9812a9a5d033..b3540b3d2862 100644
@@ -875,10 +875,12 @@ static int be_cmd_lock(struct be_adapter *adapter)
 /* Must be used only in process context */
 static void be_cmd_unlock(struct be_adapter *adapter)
 {
-	if (use_mcc(adapter))
-		return spin_unlock_bh(&adapter->mcc_lock);
-	else
+	if (use_mcc(adapter)) {
+		spin_unlock_bh(&adapter->mcc_lock);
+		return;
+	} else {
 		return mutex_unlock(&adapter->mbox_lock);
+	}
 }
 
 static struct be_mcc_wrb *be_cmd_copy(struct be_adapter *adapter,
#2 lore raw
Quoted 8 lines · Sebastian Andrzej Siewior
Quoted 1 line · Ben Hutchings

The problem described here is specific to v5.10-rt.

…

Thank you for the report.

Luis is aware of it and handling it
https://lore.kernel.org/all/[email protected]/

Thank you for the report and patch Ben!

As Sebastian mentioned, I was working on that and looking for input from the other RT maintainers on whether to fix that case with a small patch or backport the lock primitive definitions from, say, v5.15-rt and remove the two patches we have in place for similar problems.

As, so far, the usage of similar statements has been rare in the code, a small patch sounded like a good compromise. If another update brings a similar statement (void function returning <spin_lock macro>), I will backport newer locking primitives (that use functions instead of macros).

Best regards,
Luis

Quoted 3 lines

Sebastian

---end quoted text---