From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Stefano Babic <sbabic@denx.de>, linux-can@vger.kernel.org
Cc: Wolfgang Grandegger <wg@grandegger.com>,
Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [PATCH v5 2/2] CAN: CAN driver to support multiple CAN bus on SPI interface
Date: Wed, 05 Nov 2014 14:15:54 +0100 [thread overview]
Message-ID: <545A230A.4020107@pengutronix.de> (raw)
In-Reply-To: <1406565510-10783-3-git-send-email-sbabic@denx.de>
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
On 07/28/2014 06:38 PM, Stefano Babic wrote:
> This driver implements a simple protocol
> to transfer CAN messages to and from an external
> microcontroller via SPI interface.
> Multiple busses can be tranfered on the same SPI channel.
>
> It was tested on a i.MX35 connected to a Freescale's
> HCS12 16-bit controller with 5 CAN busses.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
No line by line review, but some fundamental comments and questions:
Can you please use a consistent indention scheme for struct and enums, I
favour a single space against aligning with tab, as it ony fits 95% of
the time and breaks during upgrades.
Please only use u16, u32 and friends where the size of the register is
important, use plain int, unsinged int otherwise.
I'm not sure of fiddling with the GPIO which you requested as an
interrupt is a good idea. This is probably not available on all platforms.
Why do you have two functions calculating the checksum? Have you checked
if the kernel offers you a library for this?
Can you explain me the endianess, I don't get why you need
format_frame_output() and format_frame_input() and while your structs
that go over the wire have no specific endianess (i.e. no __be32 in the
struct msg_*).
Have you thought about using threaded interrupts? Or even better make
use of the asynchronous SPI framework?
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: 819 bytes --]
next prev parent reply other threads:[~2014-11-05 13:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 16:38 [PATCH v5 0/2] Adding support for CAN busses via SPI interface Stefano Babic
2014-07-28 16:38 ` [PATCH v5 1/2] Add documentation for SPI to CAN driver Stefano Babic
2014-10-29 20:33 ` Oliver Hartkopp
2014-10-30 16:21 ` Stefano Babic
2014-10-30 20:41 ` Oliver Hartkopp
2014-11-05 12:19 ` Marc Kleine-Budde
2014-11-06 13:48 ` Stefano Babic
2014-07-28 16:38 ` [PATCH v5 2/2] CAN: CAN driver to support multiple CAN bus on SPI interface Stefano Babic
2014-10-29 20:57 ` Oliver Hartkopp
2014-10-31 10:57 ` Stefano Babic
2014-10-31 18:23 ` Oliver Hartkopp
2014-11-05 13:15 ` Marc Kleine-Budde [this message]
2014-11-06 16:13 ` Stefano Babic
2014-08-07 8:06 ` [PATCH v5 0/2] Adding support for CAN busses via " Stefano Babic
2014-09-16 13:01 ` Stefano Babic
2014-10-21 12:25 ` Stefano Babic
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=545A230A.4020107@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=sbabic@denx.de \
--cc=socketcan@hartkopp.net \
--cc=wg@grandegger.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 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).