Linux CAN drivers development
 help / color / mirror / Atom feed
From: John Whitmore <arigead@gmail.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org
Subject: Re: mcp251x can't drop the can0 Interface
Date: Mon, 10 Feb 2014 22:28:18 +0000	[thread overview]
Message-ID: <20140210222543.GA28211@griso.site> (raw)
In-Reply-To: <52F66505.6090303@pengutronix.de>

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

On Sat, Feb 08, 2014 at 06:10:29PM +0100, Marc Kleine-Budde wrote:
> On 02/07/2014 09:12 PM, John Whitmore wrote:
> > I guess you might say that I'm playing with an MCP2515 connected to a
> > RaspberryPi. I've got a problem which I've asked about on the RaspberryPi
> > forum but have never received an answer, so as a last resort I thought I'd try
> > here.
> > 
> > Basically I bring up the MCP2515 in listen mode at a certain baud rate. I
> > wanted to work on auto detetection of baud rate. So after listening for a
> > period of time at a certain baud rate I try to change the baud rate but I
> > can't do that with the linux mcp251x driver (I don't think it's the driver's
> > fault but have no idea whose it is). I've put in some debug statements
> > to see what happens when I execute "ifconfig can0 down" and basically the
> > interface goes down momentarily and then gets brough straight back up
> > again. So when I try to use the "ip" command to set the new baud rate I get an
> > error that the device is busy. 
> 
> Please add this patch to the driver:
> 
> -------->8-------->8-------->8-------->8-------->8-------->8-------->8--------
> diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
> index cdb9808..b1ea15c 100644
> --- a/drivers/net/can/mcp251x.c
> +++ b/drivers/net/can/mcp251x.c
> @@ -697,6 +697,8 @@ static int mcp251x_stop(struct net_device *net)
>         struct mcp251x_priv *priv = netdev_priv(net);
>         struct spi_device *spi = priv->spi;
> 
> +       dump_stack();
> +
>         close_candev(net);
> 
>         priv->force_quit = 1;
> @@ -941,6 +943,8 @@ static int mcp251x_open(struct net_device *net)
>         unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_FALLING;
>         int ret;
> 
> +       dump_stack();
> +
>         ret = open_candev(net);
>         if (ret) {
>                 dev_err(&spi->dev, "unable to set initial baudrate!\n");
> 
> -------->8-------->8-------->8-------->8-------->8-------->8-------->8--------
> 
> Then reproduce your problem, then send dmesg output.
> 

Sorry for the slight delay went from the RaspberryPi 3.6 Kernel to the 3.10 to
see if maybe the later version worked. I'm afraid neither worked.

John


> 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: dmesg.zip --]
[-- Type: application/zip, Size: 15873 bytes --]

  reply	other threads:[~2014-02-10 22:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 20:12 mcp251x can't drop the can0 Interface John Whitmore
2014-02-08 17:10 ` Marc Kleine-Budde
2014-02-10 22:28   ` John Whitmore [this message]
2014-02-10 22:34     ` Marc Kleine-Budde
2014-02-10 22:43       ` John Whitmore

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=20140210222543.GA28211@griso.site \
    --to=arigead@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.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