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 <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2493350
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
rakesh goyal
2021-03-04 18:17:58 +05:30
committed by Revanth Kumar Uppala
parent 8363bf6e9d
commit 9f61b817f7
3 changed files with 16 additions and 16 deletions

View File

@@ -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);

View File

@@ -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*/

View File

@@ -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;
}