linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Florian Feldbauer <florian@ep1.ruhr-uni-bochum.de>,
	linux-can@vger.kernel.org
Subject: Re: Writing socketCAN module for my own hardware
Date: Fri, 10 Oct 2014 10:06:33 +0200	[thread overview]
Message-ID: <54379389.5040005@pengutronix.de> (raw)
In-Reply-To: <54378E35.6000205@ep1.ruhr-uni-bochum.de>

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

On 10/10/2014 09:43 AM, Florian Feldbauer wrote:
>>> Although I can see at the scope, that reading register 0 of the SJA1000
>>> returns the value 1 as it should be.
>>> Also, it seems that there is some kind of endless loop reading this
>>> register.
>> No, just a loop of up to 100 :)

> Maybe it's correlated with the issue that the message
> [  129.210423] sja1000_raspi sja1000_raspi.0 can0: bit-timing not yet
> appears over and over again in dmesg, but register 0 is definitely
> read more than 100 times...

As mentioned earlier, you have probably a mechanism running on your
system, that tries to enable the CAN interface. Bringing up the
interface without a set bit-rate is not allowed.

[...]

>>> Any Ideas why the first initialization of the kernel module doesn't
>>> work?
>>> When is the probe function of the module actually called?
>> As soon as there is a matching driver//device combination on a bus.
>> Looking at your driver, it's racy. You should not do any hardware setup
>> in the init function.
> Ok...I moved the whole configuration of the GPIOs into the probe
> function (instead of the init)
> and now it works! Thanks!
> 
> Now I only have to solve the problem, that bringing the interface down
> is not possible....
> Always need to reboot just to change bitrate is no fun.
> Maybe I should consult the Raspberry community, if there is some kind of
> network manager...

What kind of distribution are you using?

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-10-10  8:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  7:51 Writing socketCAN module for my own hardware Florian Feldbauer
2014-08-12  8:24 ` Marc Kleine-Budde
2014-08-12  8:57   ` Florian Feldbauer
2014-08-12 10:01     ` Marc Kleine-Budde
2014-10-01  7:26       ` Florian Feldbauer
2014-10-01  7:49         ` Marc Kleine-Budde
2014-10-01 12:32           ` Florian Feldbauer
2014-10-01 12:41             ` Marc Kleine-Budde
2014-10-01 12:56               ` Florian Feldbauer
2014-10-01 13:11                 ` Marc Kleine-Budde
2014-10-09 15:06               ` Florian Feldbauer
2014-10-09 16:13                 ` Marc Kleine-Budde
2014-10-10  7:43                   ` Florian Feldbauer
2014-10-10  8:06                     ` Marc Kleine-Budde [this message]
2014-10-10  8:09                       ` Florian Feldbauer

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=54379389.5040005@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=florian@ep1.ruhr-uni-bochum.de \
    --cc=linux-can@vger.kernel.org \
    /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).