All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Mirza Krak <mirza.krak@hostmobility.com>, linux-can@vger.kernel.org
Subject: Re: [PATCH 1/1] net: can: sja1000: Validate initialization state in start method
Date: Thu, 14 Aug 2014 12:18:00 +0200	[thread overview]
Message-ID: <53EC8CD8.2040703@pengutronix.de> (raw)
In-Reply-To: <1407501050-16156-1-git-send-email-mirza.krak@hostmobility.com>

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

On 08/08/2014 02:30 PM, Mirza Krak wrote:
> When sja1000 is not compiled as module the SJA1000 chip is only
> initialized during device registration on kernel boot. Should the chip
> get a hardware reset there is no way to reinitialize it without re-
> booting the Linux kernel.

Not good. :/

However, you can manually unbind the device from the driver:

> ➜ (pts/0) mkl@hermippe:drivers/sja1000_plx_pci ll
> total 0
> lrwxrwxrwx 1 root root    0 Aug 14 12:15 0000:01:02.0 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:01:02.0
> --w------- 1 root root 4096 Aug 14 12:15 bind
> lrwxrwxrwx 1 root root    0 Aug 14 12:15 module -> ../../../../module/plx_pci
> --w------- 1 root root 4096 Aug 14 12:15 new_id
> --w------- 1 root root 4096 Aug 14 12:15 remove_id
> --w------- 1 root root 4096 Aug 14 12:15 uevent
> --w------- 1 root root 4096 Aug 14 12:15 unbind
> ➜ (pts/0) mkl@hermippe:drivers/sja1000_plx_pci echo 0000:01:02.0 | sudo tee unbind

And then rebind it:

> ➜ (pts/0) mkl@hermippe:drivers/sja1000_plx_pci echo 0000:01:02.0 | sudo tee bind

> This patch adds a check in sja1000_start if the chip is initialized, if
> not we initialize it.

Applied to can.

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: 181 bytes --]

  reply	other threads:[~2014-08-14 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 12:30 [PATCH 1/1] net: can: sja1000: Validate initialization state in start method Mirza Krak
2014-08-14 10:18 ` Marc Kleine-Budde [this message]
2014-08-21  8:44   ` Mirza Krak
2014-08-21  9:26     ` Marc Kleine-Budde

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=53EC8CD8.2040703@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mirza.krak@hostmobility.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.