From 958ea205da9edfcba602d11d615e17e960f401ee Mon Sep 17 00:00:00 2001 From: narayanr Date: Fri, 4 Dec 2020 12:49:23 +0530 Subject: [PATCH] nvethernet: remove setting of dma_mask Issue: Seeing MC errors when setting the DMA mask to 40bit. Fix: Maximum system mask which can be set on tegra is 39bit and is enabled by default for all clients. So removing the setting of DMA mask so that the default value can be used Bug 200681386 Change-Id: I4820a64c011d92bde2947969fdfa535b692c37ab Signed-off-by: narayanr Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2454950 Reviewed-by: Bhadram Varka Reviewed-by: Rakesh Goyal Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- .../ethernet/nvidia/nvethernet/ether_linux.c | 55 ------------------- .../ethernet/nvidia/nvethernet/ether_linux.h | 2 + 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 45bfd50a..820acd38 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -4120,53 +4120,6 @@ static void ether_get_num_dma_chan_mtl_q(struct platform_device *pdev, } } -/** - * @brief Set DMA address mask. - * - * Algorithm: - * Based on the addressing capability (address bit length) supported in the HW, - * the dma mask is set accordingly. - * - * @param[in] pdata: OS dependent private data structure. - * - * @note MAC_HW_Feature1 register need to read and store the value of ADDR64. - * - * @retval 0 on success - * @retval "negative value" on failure. - */ -static int ether_set_dma_mask(struct ether_priv_data *pdata) -{ - int ret = 0; - - /* Set DMA addressing limitations based on the value read from HW if - * dma_mask is not defined in DT - */ - if (pdata->dma_mask == DMA_MASK_NONE) { - switch (pdata->hw_feat.addr_64) { - case OSI_ADDRESS_32BIT: - pdata->dma_mask = DMA_BIT_MASK(32); - break; - case OSI_ADDRESS_40BIT: - pdata->dma_mask = DMA_BIT_MASK(40); - break; - case OSI_ADDRESS_48BIT: - pdata->dma_mask = DMA_BIT_MASK(48); - break; - default: - pdata->dma_mask = DMA_BIT_MASK(40); - break; - } - } - - ret = dma_set_mask_and_coherent(pdata->dev, pdata->dma_mask); - if (ret < 0) { - dev_err(pdata->dev, "dma_set_mask_and_coherent failed\n"); - return ret; - } - - return ret; -} - /** * @brief Set the network device feature flags * @@ -4257,11 +4210,9 @@ static void init_filter_values(struct ether_priv_data *pdata) static inline void tegra_pre_si_platform(struct osi_core_priv_data *osi_core) { /* VDK set true for both VDK/uFPGA */ -#if (KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE) if (tegra_platform_is_vdk()) osi_core->pre_si = 1; else -#endif osi_core->pre_si = 0; } @@ -4370,12 +4321,6 @@ static int ether_probe(struct platform_device *pdev) osi_get_hw_features(osi_core->base, &pdata->hw_feat); - ret = ether_set_dma_mask(pdata); - if (ret < 0) { - dev_err(&pdev->dev, "failed to set dma mask\n"); - goto err_dma_mask; - } - /* Set netdev features based on hw features */ ether_set_ndev_features(ndev, pdata); diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h index 60923222..79784a99 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h @@ -45,6 +45,8 @@ #if (KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE) #include #include +#else +#include #endif #include #include