linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 01/15] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
@ 2019-08-29 18:17 Sasha Levin
  2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 02/15] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Sasha Levin
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Sasha Levin @ 2019-08-29 18:17 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Fuqian Huang, David S . Miller, Sasha Levin, netdev

From: Fuqian Huang <huangfq.daxian@gmail.com>

[ Upstream commit 8c25d0887a8bd0e1ca2074ac0c6dff173787a83b ]

As spin_unlock_irq will enable interrupts.
Function tsi108_stat_carry is called from interrupt handler tsi108_irq.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/tundra/tsi108_eth.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 520cf50a3d5a1..93fe0da0f15ea 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -379,9 +379,10 @@ tsi108_stat_carry_one(int carry, int carry_bit, int carry_shift,
 static void tsi108_stat_carry(struct net_device *dev)
 {
 	struct tsi108_prv_data *data = netdev_priv(dev);
+	unsigned long flags;
 	u32 carry1, carry2;
 
-	spin_lock_irq(&data->misclock);
+	spin_lock_irqsave(&data->misclock, flags);
 
 	carry1 = TSI_READ(TSI108_STAT_CARRY1);
 	carry2 = TSI_READ(TSI108_STAT_CARRY2);
@@ -449,7 +450,7 @@ static void tsi108_stat_carry(struct net_device *dev)
 			      TSI108_STAT_TXPAUSEDROP_CARRY,
 			      &data->tx_pause_drop);
 
-	spin_unlock_irq(&data->misclock);
+	spin_unlock_irqrestore(&data->misclock, flags);
 }
 
 /* Read a stat counter atomically with respect to carries.
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-08-29 18:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 18:17 [PATCH AUTOSEL 4.4 01/15] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 02/15] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 03/15] Bluetooth: btqca: Add a short delay before downloading the NVM Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 04/15] ibmveth: Convert multicast list size for little-endian system Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 05/15] gpio: Fix build error of function redefinition Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 06/15] cxgb4: fix a memory leak bug Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 07/15] net: myri10ge: fix memory leaks Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 08/15] cx82310_eth: fix a memory leak bug Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 09/15] net: kalmia: fix memory leaks Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 10/15] wimax/i2400m: fix a memory leak bug Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 11/15] ravb: Fix use-after-free ravb_tstamp_skb Sasha Levin
2019-08-29 18:17 ` [PATCH AUTOSEL 4.4 12/15] Tools: hv: kvp: eliminate 'may be used uninitialized' warning Sasha Levin
2019-08-29 18:18 ` [PATCH AUTOSEL 4.4 13/15] IB/mlx4: Fix memory leaks Sasha Levin
2019-08-29 18:18 ` [PATCH AUTOSEL 4.4 14/15] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr() Sasha Levin
2019-08-29 18:18 ` [PATCH AUTOSEL 4.4 15/15] KVM: arm/arm64: Only skip MMIO insn once Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).