From: "Jonas Mark (BT-FIR/ENG1)" <Mark.Jonas@de.bosch.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"hs@denx.de" <hs@denx.de>,
"ZHU Yi (BT-FIR/ENG1-Zhu)" <Yi.Zhu5@cn.bosch.com>
Subject: Re: [PATCH 0/5] can: enable multi-queue for SocketCAN devices
Date: Thu, 7 Jun 2018 08:06:17 +0000 [thread overview]
Message-ID: <e8c47bca2ea64b5ab900f4f1e98bb405@de.bosch.com> (raw)
Hi Oliver,
> > The driver suite consists of three separate drivers. The following
> > diagram illustrates the dependencies in layers.
> >
> > /dev/companion SocketCAN User Space
> > -------------------------------------------------------------------
> > +----------------+ +---------------+
> > | companion-char | | companion-can |
> > +----------------+ +---------------+
> > +----------------------------------+
> > | companion-spi |
> > +----------------------------------+
> > +----------------------------------+
> > | standard SPI subsystem |
> > +----------------------------------+ Linux Kernel
> > -------------------------------------------------------------------
> > | | | | | | Hardware
> > CS-+ | | | | +-BUSY
> > CLK--+ | | +---REQUEST
> > MOSI---+ |
> > MISO-----+
> >
> > companion-spi
> > core.c: handles SPI, sysfs entry and interface to upper layer
> > protocol-manager.c: handles protocol with the SPI HW
> > queue-manager.c: handles buffering and packets scheduling
> >
> > companion-can
> > makes use of multi-queue support and allows to use tc to configure
> > the queuing discipline (e.g. mqprio). Together with the SO_PRIORITY
> > socket option this allows to specify the FIFO a CAN frame shall be
> > sent to.
> >
> > companion-char
> > handles messages to other undisclosed functionality beyond CAN.
> > .../devicetree/bindings/spi/bosch,companion.txt | 82 ++
> > drivers/char/Kconfig | 7 +
> > drivers/char/Makefile | 2 +
> > drivers/char/companion-char.c | 367 ++++++
> > drivers/net/can/Kconfig | 8 +
> > drivers/net/can/Makefile | 1 +
> > drivers/net/can/companion-can.c | 694 ++++++++++++
>
> Please place the companion driver in
>
> drivers/net/can/spi/companion.c
>
> It also makes more sense in the Kconfig structure.
>
> Probably this naming scheme also makes sense for
>
> linux/drivers/char/spi/companion.c
>
> then ...
>
> If not it should be named at least
>
> drivers/char/companion-spi.c
>
> or
>
> drivers/char/spi-companion.c
We intentionally left out the spi in the driver path / name because
only the drivers/spi/companion/* driver knows that that it is connected
to SPI. The others (drivers/net/can/companion-can.c and
drivers/char/companion-char.c) only know the API. This could also be
supplied by a driver which talks to the Companion via a different
interface. Actually, we started with a UART connection but switched to
SPI due to latency issues.
Should we still change it?
> > drivers/net/can/dev.c | 8 +-
> > drivers/spi/Kconfig | 2 +
> > drivers/spi/Makefile | 2 +
> > drivers/spi/companion/Kconfig | 5 +
> > drivers/spi/companion/Makefile | 2 +
> > drivers/spi/companion/core.c | 1189 ++++++++++++++++++++
> > drivers/spi/companion/protocol-manager.c | 1035 +++++++++++++++++
> > drivers/spi/companion/protocol-manager.h | 348 ++++++
> > drivers/spi/companion/protocol.h | 273 +++++
> > drivers/spi/companion/queue-manager.c | 146 +++
> > drivers/spi/companion/queue-manager.h | 245 ++++
> > include/linux/can/dev.h | 7 +-
> > include/linux/companion.h | 258 +++++
> > 20 files changed, 4677 insertions(+), 4 deletions(-)
> > create mode 100644
> Documentation/devicetree/bindings/spi/bosch,companion.txt
> > create mode 100644 drivers/char/companion-char.c
> > create mode 100644 drivers/net/can/companion-can.c
> > create mode 100644 drivers/spi/companion/Kconfig
> > create mode 100644 drivers/spi/companion/Makefile
> > create mode 100644 drivers/spi/companion/core.c
> > create mode 100644 drivers/spi/companion/protocol-manager.c
> > create mode 100644 drivers/spi/companion/protocol-manager.h
> > create mode 100644 drivers/spi/companion/protocol.h
> > create mode 100644 drivers/spi/companion/queue-manager.c
> > create mode 100644 drivers/spi/companion/queue-manager.h
> > create mode 100644 include/linux/companion.h
Greetings,
Mark
Building Technologies, Panel Software Fire (BT-FIR/ENG1)
Bosch Sicherheitssysteme GmbH | Postfach 11 11 | 85626 Grasbrunn | GERMANY | www.boschsecurity.com
Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 23118
Aufsichtsratsvorsitzender: Stefan Hartung; Geschäftsführung: Gert van Iperen, Andreas Bartz, Thomas Quante, Bernhard Schuster
next reply other threads:[~2018-06-07 8:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 8:06 Jonas Mark (BT-FIR/ENG1) [this message]
2018-06-07 9:49 ` Oliver Hartkopp
-- strict thread matches above, loose matches on Subject: below --
2018-06-07 15:20 Jonas Mark (BT-FIR/ENG1)
2018-06-07 15:14 Jonas Mark (BT-FIR/ENG1)
2018-06-11 4:41 ` Oleksij Rempel
2018-06-05 18:43 Mark Jonas
2018-06-06 18:06 ` Andy Shevchenko
2018-06-07 7:22 ` 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=e8c47bca2ea64b5ab900f4f1e98bb405@de.bosch.com \
--to=mark.jonas@de.bosch.com \
--cc=Yi.Zhu5@cn.bosch.com \
--cc=hs@denx.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--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
all inboxes | Powered by JetHome®