Skip to contentSkip to conversation

ionic: Don't overwrite the cyclecounter bitmask

PATCH Applied Brett Creeley 3 participants 3 messages Apr 7, 2023 – Apr 12, 2023

Subsystems (3)
lore
Share & tools
lore

Brett Creeley

author maintainer
#0 lore raw

PATCH 1/1 ionic: Don't overwrite the cyclecounter bitmask

The driver was incorrectly overwriting the cyclecounter bitmask, which was truncating it and not aligning to the hardware mask value. This isn't causing any issues, but it's wrong. Fix this by not constraining the cyclecounter/hardware mask.

Luckily, this seems to cause no issues, which is why this change doesn't have a fixes tag and isn't being sent to net. However, if any transformations from time->cycles are needed in the future, this change will be needed.

---
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_phc.c +2 -3
index eac2f0e3576e..7505efdff8e9 100644
@@ -579,11 +579,10 @@ void ionic_lif_alloc_phc(struct ionic_lif *lif)
 	diff |= diff >> 16;
 	diff |= diff >> 32;
 
-	/* constrain to the hardware bitmask, and use this as the bitmask */
+	/* constrain to the hardware bitmask */
 	diff &= phc->cc.mask;
-	phc->cc.mask = diff;
 
-	/* the wrap period is now defined by diff (or phc->cc.mask)
+	/* the wrap period is now defined by diff
 	 *
 	 * we will update the time basis at about 1/4 the wrap period, so
 	 * should not see a difference of more than +/- diff/4.
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Brett Creeley

The driver was incorrectly overwriting the cyclecounter bitmask, which was truncating it and not aligning to the hardware mask value. This isn't causing any issues, but it's wrong. Fix this by not constraining the cyclecounter/hardware mask.

Quoted 8 lines

Luckily, this seems to cause no issues, which is why this change doesn't have a fixes tag and isn't being sent to net. However, if any transformations from time->cycles are needed in the future, this change will be needed.

#2 lore raw
In reply to Brett Creeley
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 11 lines · On Fri, 7 Apr 2023 11:45:39 -0700 you wrote:

The driver was incorrectly overwriting the cyclecounter bitmask, which was truncating it and not aligning to the hardware mask value. This isn't causing any issues, but it's wrong. Fix this by not constraining the cyclecounter/hardware mask.

Luckily, this seems to cause no issues, which is why this change doesn't have a fixes tag and isn't being sent to net. However, if any transformations from time->cycles are needed in the future, this change will be needed.

[...]

Here is the summary with links:
- [net-next] ionic: Don't overwrite the cyclecounter bitmask

    https://git.kernel.org/netdev/net-next/c/be690daa224e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html