From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>, linux-can@vger.kernel.org
Subject: Re: [PATCH v5 4/6] can: introduce the data bitrate configuration for CAN FD
Date: Fri, 28 Feb 2014 11:56:43 +0100 [thread overview]
Message-ID: <53106B6B.6040307@pengutronix.de> (raw)
In-Reply-To: <530F7E6A.4050307@hartkopp.net>
[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]
On 02/27/2014 07:05 PM, Oliver Hartkopp wrote:
> On 27.02.2014 09:43, Marc Kleine-Budde wrote:
>
>>> + if (priv->do_set_data_bittiming) {
>>> + /* Finally, set the bit-timing registers */
>>> + err = priv->do_set_data_bittiming(dev);
>>> + if (err)
>>> + return err;
>>> + }
>>
>> Do we really need the do_set_data_bittiming() callback? Allmost all
>> drivers set the bitrate during open and not asynchronously (when the
>> interface is down) via the set_bittiming() callback. If there is a
>> driver which really needs this callback, we can introduce it.
>
> No. I assume you did not check the current implementation %-)
Yes, but...no :)
> The bitrate is always set via do_set[_data]_bittiming() when the interface is
> down - and *not* during the open process.
No, not _always_. The flexcan and at91 drivers (maybe others, too) write
the values during open().
> In the open process only the availability of the bitrate(s) is checked before
> the controller is set into operational mode.
Yes, by the framework. This is good.
> It is pretty straight forward to introduce do_set_data_bittiming() as a
> different register set is addressed for CAN FD.
The reason why I don't want to introduce a do_set_data_bittiming() is
that it makes the driver more complicated. If you really want to write
it into the registers, you have to power up you CAN core, as on modern
controllers you cannot write to regs if the clocks are turned off. So
you have to turn on the clock, power up your chip, get into the correct
mode, write the bittiming and power down everything again. During open()
you do the same thing again but don't write the bit timing registers. So
better keep things simple.
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: 242 bytes --]
next prev parent reply other threads:[~2014-02-28 10:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 22:10 [PATCH v5 0/6] Add CAN FD infrastructure for CAN driver Oliver Hartkopp
2014-02-26 22:10 ` [PATCH v5 1/6] can: preserve skbuff protocol in can_put_echo_skb Oliver Hartkopp
2014-02-26 22:10 ` [PATCH v5 2/6] can: only send bitrate data via netlink when available Oliver Hartkopp
2014-02-26 22:10 ` [PATCH v5 3/6] can: provide a separate bittiming_const parameter to bittiming functions Oliver Hartkopp
2014-02-26 22:11 ` [PATCH v5 4/6] can: introduce the data bitrate configuration for CAN FD Oliver Hartkopp
2014-02-27 8:43 ` Marc Kleine-Budde
2014-02-27 18:05 ` Oliver Hartkopp
2014-02-28 10:56 ` Marc Kleine-Budde [this message]
2014-02-28 12:20 ` Oliver Hartkopp
2014-02-28 12:30 ` Marc Kleine-Budde
2014-02-28 12:33 ` Oliver Hartkopp
2014-02-28 12:52 ` Marc Kleine-Budde
2014-02-28 12:58 ` Oliver Hartkopp
2014-02-28 13:05 ` Marc Kleine-Budde
2014-02-28 13:09 ` Oliver Hartkopp
2014-02-28 13:18 ` Marc Kleine-Budde
2014-03-04 20:44 ` Marc Kleine-Budde
2014-02-26 22:11 ` [PATCH v5 5/6] can: allow to change the device mtu for CAN FD capable devices Oliver Hartkopp
2014-02-26 22:11 ` [PATCH v5 6/6] can: add bittiming check at interface open for CAN FD Oliver Hartkopp
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=53106B6B.6040307@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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).