osi: dma: Fix Tx/Rx ring length configuration

Issue: DMA Tx/Rx ring length not updating correctly
after changing with ethtool.

The issue was caused by the ring length being read from
the hardware and then logically OR'd with the new ring length value. This resulted in the ring length being set to the value configured during boot, as the hardware was not reset in this process.
Instead of reading the value from the hardware and logically OR'ing it with the new value, directly set the ring length value to the hardware.

Fix:
Instead of reading the value from the hardware and logically OR'ing
it with the new value, directly set the ring length value to the hardware.

Bug 5158977

Change-Id: I23dc3f18f21c884feea9845e439fbf2783d68bcb
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/3323922
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Bhadram Varka
2025-03-21 12:09:20 +00:00
committed by mobile promotions
parent 58162348f1
commit b86290a392

View File

@@ -1501,8 +1501,7 @@ static nve32_t rx_dma_desc_initialization(const struct osi_dma_priv_data *const
}
/* Update the HW DMA ring length */
val = osi_dma_readl((nveu8_t *)osi_dma->base + ring_len_reg[osi_dma->mac]);
val |= (osi_dma->rx_ring_sz - 1U) & mask[osi_dma->mac];
val = (osi_dma->rx_ring_sz - 1U) & mask[osi_dma->mac];
osi_dma_writel(val, (nveu8_t *)osi_dma->base + ring_len_reg[osi_dma->mac]);
update_rx_tail_ptr(osi_dma, chan, tailptr);
@@ -1584,8 +1583,7 @@ static inline void set_tx_ring_len_and_start_addr(const struct osi_dma_priv_data
nveu32_t val;
/* Program ring length */
val = osi_dma_readl((nveu8_t *)osi_dma->base + ring_len_reg[osi_dma->mac]);
val |= len & mask[osi_dma->mac];
val = len & mask[osi_dma->mac];
osi_dma_writel(val, (nveu8_t *)osi_dma->base + ring_len_reg[osi_dma->mac]);
/* Program tx ring start address */