diff mbox series

[net-next] ionic: Don't overwrite the cyclecounter bitmask

Message ID 20230407184539.27559-1-brett.creeley@amd.com (mailing list archive)
State Accepted
Commit be690daa224ec41889bf8f293a5bcd8a3ea6a420
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ionic: Don't overwrite the cyclecounter bitmask | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers warning 3 maintainers not CCed: leon@kernel.org pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Brett Creeley April 7, 2023, 6:45 p.m. UTC
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.

Suggested-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Simon Horman April 8, 2023, 1:32 p.m. UTC | #1
On Fri, Apr 07, 2023 at 11:45:39AM -0700, Brett Creeley 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.
> 
> Suggested-by: Allen Hubbe <allen.hubbe@amd.com>
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
patchwork-bot+netdevbpf@kernel.org April 12, 2023, 8:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
index eac2f0e3576e..7505efdff8e9 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
@@ -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.