linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: Do not call dev_put if restart timer is running upon close
@ 2012-11-27  7:52 Alexander Stein
  2012-11-28 15:05 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2012-11-27  7:52 UTC (permalink / raw)
  To: linux-can; +Cc: Wolfgang Grandegger, Marc Kleine-Budde, Alexander Stein

If the restart timer is running due to BUS-OFF and the device is
disconnected an dev_put will decrease the usage counter to -1 thus
blocking the interface removal, resulting in the following dmesg
lines repeating every 10s:
can: notifier: receive list not found for dev can0
can: notifier: receive list not found for dev can0
can: notifier: receive list not found for dev can0
unregister_netdevice: waiting for can0 to become free. Usage count = -1

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/net/can/dev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index b8f5cc9..a45a559 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -609,8 +609,7 @@ void close_candev(struct net_device *dev)
 {
 	struct can_priv *priv = netdev_priv(dev);
 
-	if (del_timer_sync(&priv->restart_timer))
-		dev_put(dev);
+	del_timer_sync(&priv->restart_timer);
 	can_flush_echo_skb(dev);
 }
 EXPORT_SYMBOL_GPL(close_candev);
-- 
1.7.8.6


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

* Re: [PATCH] can: Do not call dev_put if restart timer is running upon close
  2012-11-27  7:52 [PATCH] can: Do not call dev_put if restart timer is running upon close Alexander Stein
@ 2012-11-28 15:05 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2012-11-28 15:05 UTC (permalink / raw)
  To: Alexander Stein; +Cc: linux-can, Wolfgang Grandegger

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

On 11/27/2012 08:52 AM, Alexander Stein wrote:
> If the restart timer is running due to BUS-OFF and the device is
> disconnected an dev_put will decrease the usage counter to -1 thus
> blocking the interface removal, resulting in the following dmesg
> lines repeating every 10s:
> can: notifier: receive list not found for dev can0
> can: notifier: receive list not found for dev can0
> can: notifier: receive list not found for dev can0
> unregister_netdevice: waiting for can0 to become free. Usage count = -1
> 
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>

Looks good, I'll put stable on Cc.

Thanks,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

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

end of thread, other threads:[~2012-11-28 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27  7:52 [PATCH] can: Do not call dev_put if restart timer is running upon close Alexander Stein
2012-11-28 15:05 ` Marc Kleine-Budde

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