netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: netdev@vger.kernel.org
Cc: socketcan-core@lists.berlios.de,
	Kurt Van Dijck <kurt.van.dijck@skynet.be>,
	Wolfgang Grandegger <wg@grandegger.com>
Subject: [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state
Date: Mon, 20 Jul 2009 16:06:41 +0200	[thread overview]
Message-ID: <20090720140638.910228137@denx.de> (raw)
In-Reply-To: 20090720140638.342067093@denx.de

[-- 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;


  parent reply	other threads:[~2009-07-20 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-07-20 19:28 ` [PATCH 0/3] can: various fixes to the device driver interface David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090720140638.910228137@denx.de \
    --to=wg@grandegger.com \
    --cc=kurt.van.dijck@skynet.be \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan-core@lists.berlios.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).