netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] can: various fixes to the device driver interface
@ 2009-07-20 14:06 Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 1/3] can: sja1000: remove duplicated includes Wolfgang Grandegger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core

Hello,

this patch series fixes the following issues with CAN device driver
interface and the SJA1000 driver:

[PATCH 1/3] can: sja1000: remove duplicated includes
[PATCH 2/3] can: restart device even if dev_alloc_skb() fails
[PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state

Wolfgang.



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

* [PATCH 1/3] can: sja1000: remove duplicated includes
  2009-07-20 14:06 [PATCH 0/3] can: various fixes to the device driver interface Wolfgang Grandegger
@ 2009-07-20 14:06 ` Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 2/3] can: restart device even if dev_alloc_skb() fails Wolfgang Grandegger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core, Huang Weiyi, Wolfgang Grandegger

[-- Attachment #1: sja1000-remove-duplicate-includes.patch --]
[-- Type: text/plain, Size: 713 bytes --]

Remove duplicated #include('s) in
  drivers/net/can/sja1000/sja1000.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/sja1000/sja1000.c |    1 -
 1 file changed, 1 deletion(-)

Index: net-next-2.6/drivers/net/can/sja1000/sja1000.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/sja1000/sja1000.c	2009-07-20 15:04:52.150997074 +0200
+++ net-next-2.6/drivers/net/can/sja1000/sja1000.c	2009-07-20 15:33:22.289997606 +0200
@@ -63,7 +63,6 @@
 #include <linux/can.h>
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
-#include <linux/can/dev.h>
 
 #include "sja1000.h"
 


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

* [PATCH 2/3] can: restart device even if dev_alloc_skb() fails
  2009-07-20 14:06 [PATCH 0/3] can: various fixes to the device driver interface Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 1/3] can: sja1000: remove duplicated includes Wolfgang Grandegger
@ 2009-07-20 14:06 ` Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state Wolfgang Grandegger
  2009-07-20 19:28 ` [PATCH 0/3] can: various fixes to the device driver interface David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core, Kurt Van Dijck, Wolfgang Grandegger

[-- Attachment #1: busoff-restart.patch --]
[-- Type: text/plain, Size: 1149 bytes --]

If dev_alloc_skb() failed in can_restart(), the device was left behind
in the bus-off state. This patch restarts the device nevertheless.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/dev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c	2009-06-09 12:45:38.446934371 +0200
+++ net-next-2.6/drivers/net/can/dev.c	2009-07-20 16:03:19.129997395 +0200
@@ -346,7 +346,7 @@
 	skb = dev_alloc_skb(sizeof(struct can_frame));
 	if (skb == NULL) {
 		err = -ENOMEM;
-		goto out;
+		goto restart;
 	}
 	skb->dev = dev;
 	skb->protocol = htons(ETH_P_CAN);
@@ -361,13 +361,13 @@
 	stats->rx_packets++;
 	stats->rx_bytes += cf->can_dlc;
 
+restart:
 	dev_dbg(dev->dev.parent, "restarted\n");
 	priv->can_stats.restarts++;
 
 	/* Now restart the device */
 	err = priv->do_set_mode(dev, CAN_MODE_START);
 
-out:
 	netif_carrier_on(dev);
 	if (err)
 		dev_err(dev->dev.parent, "Error %d during restart", err);


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

* [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state
  2009-07-20 14:06 [PATCH 0/3] can: various fixes to the device driver interface Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 1/3] can: sja1000: remove duplicated includes Wolfgang Grandegger
  2009-07-20 14:06 ` [PATCH 2/3] can: restart device even if dev_alloc_skb() fails Wolfgang Grandegger
@ 2009-07-20 14:06 ` Wolfgang Grandegger
  2009-07-20 19:28 ` [PATCH 0/3] can: various fixes to the device driver interface David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core, Kurt Van Dijck, Wolfgang Grandegger

[-- Attachment #1: can-bus-off-carrier.patch --]
[-- Type: text/plain, Size: 829 bytes --]

This patch fixes a problem when a device is stopped while in the
bus-off state. Then the carrier remains off forever.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@skynet.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/net/can/dev.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c	2009-07-20 16:03:35.083997416 +0200
+++ net-next-2.6/drivers/net/can/dev.c	2009-07-20 16:03:35.100998431 +0200
@@ -473,6 +473,10 @@
 		return -EINVAL;
 	}
 
+	/* Switch carrier on if device was stopped while in bus-off state */
+	if (!netif_carrier_ok(dev))
+		netif_carrier_on(dev);
+
 	setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
 
 	return 0;


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

* Re: [PATCH 0/3] can: various fixes to the device driver interface
  2009-07-20 14:06 [PATCH 0/3] can: various fixes to the device driver interface Wolfgang Grandegger
                   ` (2 preceding siblings ...)
  2009-07-20 14:06 ` [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state Wolfgang Grandegger
@ 2009-07-20 19:28 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-07-20 19:28 UTC (permalink / raw)
  To: wg; +Cc: netdev, socketcan-core

From: Wolfgang Grandegger <wg@grandegger.com>
Date: Mon, 20 Jul 2009 16:06:38 +0200

> this patch series fixes the following issues with CAN device driver
> interface and the SJA1000 driver:
> 
> [PATCH 1/3] can: sja1000: remove duplicated includes
> [PATCH 2/3] can: restart device even if dev_alloc_skb() fails
> [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state

All applied, thanks.

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

end of thread, other threads:[~2009-07-20 19:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 14:06 [PATCH 0/3] can: various fixes to the device driver interface Wolfgang Grandegger
2009-07-20 14:06 ` [PATCH 1/3] can: sja1000: remove duplicated includes Wolfgang Grandegger
2009-07-20 14:06 ` [PATCH 2/3] can: restart device even if dev_alloc_skb() fails Wolfgang Grandegger
2009-07-20 14:06 ` [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state Wolfgang Grandegger
2009-07-20 19:28 ` [PATCH 0/3] can: various fixes to the device driver interface 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).