* [PATCH] ravb: fix race updating TCCR
@ 2015-07-16 21:28 Sergei Shtylyov
2015-07-21 3:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2015-07-16 21:28 UTC (permalink / raw)
To: netdev; +Cc: linux-sh
The TCCR.TSRQn bit may get clearead after TCCR gets read, so that TCCR write
would get skipped. We don't need to check this bit before setting.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against Dave Miller's 'net.git' repo plus the patch I sent on
Tuesday.
drivers/net/ethernet/renesas/ravb_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Index: net/drivers/net/ethernet/renesas/ravb_main.c
=================================--- net.orig/drivers/net/ethernet/renesas/ravb_main.c
+++ net/drivers/net/ethernet/renesas/ravb_main.c
@@ -1275,7 +1275,6 @@ static netdev_tx_t ravb_start_xmit(struc
u32 dma_addr;
void *buffer;
u32 entry;
- u32 tccr;
spin_lock_irqsave(&priv->lock, flags);
if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q]) {
@@ -1324,9 +1323,7 @@ static netdev_tx_t ravb_start_xmit(struc
dma_wmb();
desc->die_dt = DT_FSINGLE;
- tccr = ravb_read(ndev, TCCR);
- if (!(tccr & (TCCR_TSRQ0 << q)))
- ravb_write(ndev, tccr | (TCCR_TSRQ0 << q), TCCR);
+ ravb_write(ndev, ravb_read(ndev, TCCR) | (TCCR_TSRQ0 << q), TCCR);
priv->cur_tx[q]++;
if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q] &&
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ravb: fix race updating TCCR
2015-07-16 21:28 [PATCH] ravb: fix race updating TCCR Sergei Shtylyov
@ 2015-07-21 3:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-07-21 3:42 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev, linux-sh
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 17 Jul 2015 00:28:38 +0300
> The TCCR.TSRQn bit may get clearead after TCCR gets read, so that TCCR write
> would get skipped. We don't need to check this bit before setting.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-21 3:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 21:28 [PATCH] ravb: fix race updating TCCR Sergei Shtylyov
2015-07-21 3:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox