netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slip: fix spinlock variant
       [not found]             ` <534D3748.6060602@pengutronix.de>
@ 2014-04-26 19:18               ` Oliver Hartkopp
  2014-04-28  3:35                 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2014-04-26 19:18 UTC (permalink / raw)
  To: David Miller; +Cc: Andre Naujoks, Linux Netdev List, linux-can, Alexander Stein

With commit cc9fa74e2a ("slip/slcan: added locking in wakeup function") a
formerly missing locking was added to slip.c and slcan.c by Andre Naujoks.

Alexander Stein contributed the fix 367525c8c2 ("can: slcan: Fix spinlock
variant") as the kernel lock debugging advised to use spin_lock_bh() instead
of just using spin_lock().

This fix has to be applied to the same code section in slip.c for the same
reason too.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

---

diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index cc70ecf..ad4a94e 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -429,13 +429,13 @@ static void slip_write_wakeup(struct tty_struct *tty)
 	if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
 		return;
 
-	spin_lock(&sl->lock);
+	spin_lock_bh(&sl->lock);
 	if (sl->xleft <= 0)  {
 		/* Now serial buffer is almost free & we can start
 		 * transmission of another packet */
 		sl->dev->stats.tx_packets++;
 		clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-		spin_unlock(&sl->lock);
+		spin_unlock_bh(&sl->lock);
 		sl_unlock(sl);
 		return;
 	}
@@ -443,7 +443,7 @@ static void slip_write_wakeup(struct tty_struct *tty)
 	actual = tty->ops->write(tty, sl->xhead, sl->xleft);
 	sl->xleft -= actual;
 	sl->xhead += actual;
-	spin_unlock(&sl->lock);
+	spin_unlock_bh(&sl->lock);
 }
 
 static void sl_tx_timeout(struct net_device *dev)




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

* Re: [PATCH] slip: fix spinlock variant
  2014-04-26 19:18               ` [PATCH] slip: fix spinlock variant Oliver Hartkopp
@ 2014-04-28  3:35                 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-04-28  3:35 UTC (permalink / raw)
  To: socketcan; +Cc: nautsch2, netdev, linux-can, alexander.stein

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Sat, 26 Apr 2014 21:18:32 +0200

> With commit cc9fa74e2a ("slip/slcan: added locking in wakeup function") a
> formerly missing locking was added to slip.c and slcan.c by Andre Naujoks.
> 
> Alexander Stein contributed the fix 367525c8c2 ("can: slcan: Fix spinlock
> variant") as the kernel lock debugging advised to use spin_lock_bh() instead
> of just using spin_lock().
> 
> This fix has to be applied to the same code section in slip.c for the same
> reason too.
> 
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2014-04-28  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+s8ZrqFBun4bo2rJJFHb0FrV7m7PLybUVM+jjahKsdW8bdnaQ@mail.gmail.com>
     [not found] ` <164afc991761b9eeb0eec6902814d00e@grandegger.com>
     [not found]   ` <534D0F00.7000202@hartkopp.net>
     [not found]     ` <CA+s8Zrqrd_U0g1GRCDzXncgWLA_kO3Hyhjwy6Oe1S0cYohm2og@mail.gmail.com>
     [not found]       ` <534D1F63.6080101@hartkopp.net>
     [not found]         ` <534D270D.5060705@pengutronix.de>
     [not found]           ` <534D31EF.6050107@hartkopp.net>
     [not found]             ` <534D3748.6060602@pengutronix.de>
2014-04-26 19:18               ` [PATCH] slip: fix spinlock variant Oliver Hartkopp
2014-04-28  3:35                 ` David Miller

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).