From 9f61b817f750c98e3f37e5aa79620e20382a1288 Mon Sep 17 00:00:00 2001 From: rakesh goyal Date: Thu, 4 Mar 2021 18:17:58 +0530 Subject: [PATCH] nvethernet: use raw_spin_lock_* for RT kernel Issue: raw_spin_lock* should be used with RT kernel Fix: update code to use raw_spin_lock* APIs instead of spin_lock* Bug 200671160 Change-Id: I5a1d187d2ead6394d97bbdcb41533852b4708afe Signed-off-by: rakesh goyal Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2493350 Tested-by: mobile promotions Reviewed-by: mobile promotions --- .../ethernet/nvidia/nvethernet/ether_linux.c | 20 +++++++++---------- .../ethernet/nvidia/nvethernet/ether_linux.h | 6 +++--- drivers/net/ethernet/nvidia/nvethernet/osd.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 47256e30..abfc7d67 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -541,9 +541,9 @@ static irqreturn_t ether_tx_chan_isr(int irq, void *data) unsigned long flags; unsigned long val; - spin_lock_irqsave(&pdata->rlock, flags); + raw_spin_lock_irqsave(&pdata->rlock, flags); osi_disable_chan_tx_intr(osi_dma, chan); - spin_unlock_irqrestore(&pdata->rlock, flags); + raw_spin_unlock_irqrestore(&pdata->rlock, flags); val = osi_core->xstats.tx_normal_irq_n[chan]; osi_core->xstats.tx_normal_irq_n[chan] = @@ -587,9 +587,9 @@ static irqreturn_t ether_rx_chan_isr(int irq, void *data) unsigned int chan = rx_napi->chan; unsigned long val, flags; - spin_lock_irqsave(&pdata->rlock, flags); + raw_spin_lock_irqsave(&pdata->rlock, flags); osi_disable_chan_rx_intr(osi_dma, chan); - spin_unlock_irqrestore(&pdata->rlock, flags); + raw_spin_unlock_irqrestore(&pdata->rlock, flags); val = osi_core->xstats.rx_normal_irq_n[chan]; osi_core->xstats.rx_normal_irq_n[chan] = @@ -728,7 +728,7 @@ static void ether_start_ivc(struct ether_priv_data *pdata) } ictxt->ivc_state = 1; // initialize - spin_lock_init(&ictxt->ivck_lock); + raw_spin_lock_init(&ictxt->ivck_lock); } } @@ -2828,9 +2828,9 @@ static int ether_napi_poll_rx(struct napi_struct *napi, int budget) &more_data_avail); if (received < budget) { napi_complete(napi); - spin_lock_irqsave(&pdata->rlock, flags); + raw_spin_lock_irqsave(&pdata->rlock, flags); osi_enable_chan_rx_intr(osi_dma, chan); - spin_unlock_irqrestore(&pdata->rlock, flags); + raw_spin_unlock_irqrestore(&pdata->rlock, flags); } return received; @@ -2873,9 +2873,9 @@ static int ether_napi_poll_tx(struct napi_struct *napi, int budget) if (processed < budget) { napi_complete(napi); - spin_lock_irqsave(&pdata->rlock, flags); + raw_spin_lock_irqsave(&pdata->rlock, flags); osi_enable_chan_tx_intr(osi_dma, chan); - spin_unlock_irqrestore(&pdata->rlock, flags); + raw_spin_unlock_irqrestore(&pdata->rlock, flags); } return processed; @@ -4386,7 +4386,7 @@ static int ether_probe(struct platform_device *pdev) } - spin_lock_init(&pdata->rlock); + raw_spin_lock_init(&pdata->rlock); init_filter_values(pdata); /* Disable Clocks */ ether_disable_clks(pdata); diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h index f1bdec04..bfe8efbc 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -241,7 +241,7 @@ struct ether_ivc_ctxt { /** ivc cookie */ struct tegra_hv_ivc_cookie *ivck; /** ivc lock */ - spinlock_t ivck_lock; + raw_spinlock_t ivck_lock; /** ivc work */ struct work_struct ivc_work; /** wait for event */ @@ -335,7 +335,7 @@ struct ether_priv_data { atomic_t therm_state; #endif /* THERMAL_CAL */ /** Spin lock for Tx/Rx interrupt enable registers */ - spinlock_t rlock; + raw_spinlock_t rlock; /** max address register count, 2*mac_addr64_sel */ int num_mac_addr_regs; /** Last address reg filter index added in last call*/ diff --git a/drivers/net/ethernet/nvidia/nvethernet/osd.c b/drivers/net/ethernet/nvidia/nvethernet/osd.c index 0dab97d0..212302f2 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/osd.c +++ b/drivers/net/ethernet/nvidia/nvethernet/osd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -448,7 +448,7 @@ int osd_ivc_send_cmd(void *priv, void *data, unsigned int len) } ivc_buf->status = -1; - spin_lock_irqsave(&ictxt->ivck_lock, flags); + raw_spin_lock_irqsave(&ictxt->ivck_lock, flags); if (in_atomic()) { preempt_enable(); is_atomic = 1; @@ -484,7 +484,7 @@ int osd_ivc_send_cmd(void *priv, void *data, unsigned int len) } ret = ivc_buf->status; fail: - spin_unlock_irqrestore(&ictxt->ivck_lock, flags); + raw_spin_unlock_irqrestore(&ictxt->ivck_lock, flags); #endif return ret; }