netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: Anant Gole <anantgole-l0cyMroinI0@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org
Subject: Re: [PATCH] net-next:can: add TI CAN (HECC) driver
Date: Mon, 05 Oct 2009 13:25:16 +0200	[thread overview]
Message-ID: <4AC9D79C.1030406@grandegger.com> (raw)
In-Reply-To: <1254736974-6685-1-git-send-email-anantgole-l0cyMroinI0@public.gmane.org>

Anant Gole wrote:
> TI HECC (High End CAN Controller) module is found on many TI devices. It
> has 32 hardware mailboxes with full implementation of CAN protocol 2.0B
> with bus speeds up to 1Mbps. Specifications of the module are available
> on TI web <http://www.ti.com>
> 
> Signed-off-by: Anant Gole <anantgole-l0cyMroinI0@public.gmane.org>

I already reviewed this driver on the Socketcan-core ML and it's almost
OK from the Socket-CAN point of view. Just one issue...

[snip]
> diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
> new file mode 100644
> index 0000000..9090103
> --- /dev/null
> +++ b/drivers/net/can/ti_hecc.c
[snip]
> +static int ti_hecc_set_btc(struct ti_hecc_priv *priv)
> +{
> +	struct can_bittiming *bit_timing = &priv->can.bittiming;
> +	u32 can_btc;
> +
> +	can_btc = (bit_timing->phase_seg2 - 1) & 0x7;
> +	can_btc |= ((bit_timing->phase_seg1 + bit_timing->prop_seg - 1)
> +			& 0xF) << 3;
> +	if (bit_timing->brp > 4 && priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
> +			can_btc |= HECC_CANBTC_SAM;
> +	else
> +		dev_info(priv->ndev->dev.parent,
> +			"WARN: Triple sampling not set due to h/w limitations"
> +			" at %d bitrate", bit_timing->bitrate);

That's not correct from my point of view. The warning message should
only be printed when the user tries to set triple sampling. I think it
should be similar to:

	if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) {
		if (bit_timing->brp > 4)
			can_btc |= HECC_CANBTC_SAM;
		else
			dev_warn(priv->ndev->dev.parent,
			"Triple sampling not set due to h/w "
			limitations");
	}

Apart from that, the patch looks OK.

Wolfgang.

  parent reply	other threads:[~2009-10-05 11:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 10:02 [PATCH] net-next:can: add TI CAN (HECC) driver Anant Gole
     [not found] ` <1254736974-6685-1-git-send-email-anantgole-l0cyMroinI0@public.gmane.org>
2009-10-05 11:25   ` Wolfgang Grandegger [this message]
     [not found] <2A3DCF3DA181AD40BDE86A3150B27B6B02F621106B@dbde02.ent.ti.com>
2009-08-29  7:06 ` Wolfgang Grandegger
2009-08-31  7:22   ` Gole, Anant
2009-08-31  8:59     ` Wolfgang Grandegger
2009-08-31 10:29       ` Oliver Hartkopp
2009-08-31 10:43         ` Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2009-08-28 11:18 Anant Gole
2009-08-28 12:44 ` Oliver Hartkopp
2009-08-28 13:13   ` Gole, Anant
2009-08-28 13:27     ` Oliver Hartkopp
2009-09-01  9:04 ` Wolfram Sang
2009-09-01  9:32   ` Gole, Anant

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=4AC9D79C.1030406@grandegger.com \
    --to=wg-5yr1bzd7o62+xt7jha+gda@public.gmane.org \
    --cc=anantgole-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.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).