mirror of
git://nv-tegra.nvidia.com/kernel/nvethernetrm.git
synced 2025-12-22 17:34:29 +03:00
nvethernetrm: Zero initialize all descriptors
Issue: Tx/Rx DMA initialization in OSI does not actually
zero initialize all the descriptors. This inherently
assumes that the OSD layer would already zero initialize
the memory allocated for descriptors, which need not be
the case for all OSD's as this requirement isn't
called out.
Fix: Instead of relying on OSD to zero initialize the
descriptors, perform initialization in OSI during DMA
init operation. It is one time cost at init, so no
performance penalty in data path.
Bug 2779959
Change-Id: I39431184980fceeb836eca872491ac8d7ee029ca
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2259541
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
0bd3dc4135
commit
e95c46f86c
@@ -782,6 +782,12 @@ static int rx_dma_desc_initialization(struct osi_dma_priv_data *osi,
|
||||
rx_swcx = rx_ring->rx_swcx + i;
|
||||
rx_desc = rx_ring->rx_desc + i;
|
||||
|
||||
/* Zero initialize the descriptors first */
|
||||
rx_desc->rdes0 = 0;
|
||||
rx_desc->rdes1 = 0;
|
||||
rx_desc->rdes2 = 0;
|
||||
rx_desc->rdes3 = 0;
|
||||
|
||||
tmp = L32(rx_swcx->buf_phy_addr);
|
||||
if (tmp < UINT_MAX) {
|
||||
rx_desc->rdes0 = (unsigned int)tmp;
|
||||
@@ -867,19 +873,20 @@ static void tx_dma_desc_init(struct osi_dma_priv_data *osi_dma)
|
||||
struct osi_tx_desc *tx_desc = OSI_NULL;
|
||||
struct osi_dma_chan_ops *ops = osi_dma->ops;
|
||||
unsigned int chan = 0;
|
||||
unsigned int i;
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0; i < osi_dma->num_dma_chans; i++) {
|
||||
chan = osi_dma->dma_chans[i];
|
||||
|
||||
tx_ring = osi_dma->tx_ring[chan];
|
||||
tx_desc = tx_ring->tx_desc;
|
||||
|
||||
/* FIXME: does it require */
|
||||
for (j = 0; j < TX_DESC_CNT; j++) {
|
||||
tx_desc = tx_ring->tx_desc + j;
|
||||
|
||||
tx_desc->tdes0 = 0;
|
||||
tx_desc->tdes1 = 0;
|
||||
tx_desc->tdes2 = 0;
|
||||
tx_desc->tdes3 = 0;
|
||||
}
|
||||
|
||||
tx_ring->cur_tx_idx = 0;
|
||||
tx_ring->clean_idx = 0;
|
||||
|
||||
Reference in New Issue
Block a user