All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sjur BRENDELAND <sjur.brandeland@stericsson.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Paul Bolle <pebolle@tiscali.nl>
Subject: Re: [PATCH 0/9] XSHM: Shared Memory Driver for ST-E Thor M7400 LTE modem
Date: Fri, 9 Dec 2011 14:42:04 +0000	[thread overview]
Message-ID: <201112091442.04294.arnd@arndb.de> (raw)
In-Reply-To: <81C3A93C17462B4BBD7E272753C105791FB0D15949@EXDCVYMBSTM005.EQ1STM.local>

On Wednesday 07 December 2011, Sjur BRENDELAND wrote:

> > > Introduction:
> > > ~~~~~~~~~~~~~
> > > This patch-set introduces the Shared Memory Driver for ST-Ericsson's
> > > Thor M7400 LTE modem.
> > > The shared memory model is implemented for Chip-to-chip and
> > > uses a reserved memory area and a number of bi-directional
> > > channels. Each channel has it's own designated data area where
> > payload
> > > data is copied into.
> > 
> > Can you explain what the scope of this framework is? What I don't
> > understand from the code is whether this is meant to be very
> > broadly applicable to a lot of devices and competing with e.g.
> > rpmsg from Ohad Ben-Cohen, or whether this is really speciific
> > to one hardware implementation for caif.
> 
> This is primarily designed for supporting the ST-Ericsson's M7400 product
> and future modem platforms supporting shared memory.
> There are some parts with a rather tight coupling to the modem such as
> synchronization of the startup phases "ipc_ready" and "caif_ready" and
> how we store the 1st stage boot images in shared memory.
> However there are other concepts and parts of the implementation 
> that probably is possible to reuse.

Ok.

> > Also, to what degree is the protocol design flexible? Is the modem
> > side fixed, so you have to live with any shortcomings of the interface,
> > or are you at this point able to improve both sides when something
> > is found to be lacking?
> 
> As I see it, this interface to the modem is pretty much set, and isn't
> going to change a lot for the M7400 product.
> 
> However for the long term perspective: we expect this interface to evolve
> for future products, so suggestions and input for improvements is welcome.
> rpmsg or at least the use of virtio-ring combined with a true end-to-end
> zero copy is something we definitely are interested to look into for the
> future.

Is the rpmsg support something that can be done with the current low-level
protocol? It would be really nice if you could at least share some code
for the general infrastructure, even if both the underlying transport
and the high-level protocols are different.

> > > Two different channel types are defined, one stream channel which is
> > > implemented as a traditional ring-buffer, and a packet channel which
> > > is a ring-buffer of fix sized buffers where each buffer contains
> > > an array of CAIF frames.
> > >
> > > The notification of read and write index updates are handled in a
> > > separate driver called c2c_genio. This driver will be contributed
> > separately,
> > > but the API is included in this patch-set.
> > >
> > > The channel configuration is stored in shared memory, each channel
> > > has a designated area in shared memory for configuration data,
> > > read and write indexes and a data area.
> > 
> > How many channels will there be on of each type in a typical system,
> > and respectively in the maximum you can realistically expect over
> > the next 10 years?
> 
> Currently we have defined the following channels:
> 
> Ch#	Type		Used for				RX size	TX size
> ------------------------------------------------------------------
> 1	Stream	Modem Crash dump			64 kB		4 kB
> 2	Stream	Flash-less Boot Protocol	4 kB		256 kB
> 3	Stream	Boot Logging			8 kB		4kB
> 4	Packet	CAIF high speed 			8*16 kB	8*16kB
> 5	Packet	CAIF low latency			4*1kB		4*1kB
> 
> The modem is doing a multi stage boot, where it initially reads
> boot images stored in shared memory. This will boot-strap the
> 2nd boot stage where the Flash-less Boot Protocol is used.
> In this phase channel #2 and #3 is used. At this stage only a
> very basic OS-less runtime system is available, so CAIF protocol
> cannot be running on the modem.
> 
> When the 2nd boot stage is complete, channel #4 and #5 will be used.
> CAIF is a multiplexing protocol allowing multiple connections,
> so the reason for two channels is to be able to separate high
> throughput traffic such as IP + Logging from traffic with low-latency
> requirements such as control (e.g. AT commands) and audio.
> 
> In case of modem crash-dump the modem is running in OS-less mode, and 
> transfers dump over channel #1.
> 
> Initially I have implemented separate memory areas for
> the different channels and the initial boot images, however
> the channel specification and netlink interface supports
> overlapping channels. This is a possible future improvement.

ok

> > > Stream data
> > > ~~~~~~~~~~~
> > > The driver for the stream channel is implemented as a character device
> > > interface to user space. The character device implements non-blocking open
> > > and non-blocking IO in general. The character device is implementing
> > > a traditional circular buffer directly in the shared memory region for
> > > the channel.
> > 
> > It seems unusual to have both a socket interface and a character device
> > interface. What is the motivation behind this? Why can't you use the
> > socket for non-blocking I/O?
> 
> As mentioned above, the modem is in different run modes, stream device
> is only used when modem runs in OS-less mode, during boot or crash-dump.
> Except for boot and crash-dump the CAIF stack is used.
> A similar approach is used for HSI, where we use a bare
> HSI channel in OS-less mode, and CAIF over HSI otherwise.

My feeling is that a character device is not the ideal implementation here,
but I'm not sure what is. One option I can see is to declare the stream
interface part of the configuration logic and do everything through netlink,
packetizing the stream data in netlink frames. Alternatively, a tty port
device might be more appropriate than a plain chardev. Both of these
are likely a bit slower than what you have today, but my impression is that
performance is not the main design goal for the stream interface. If it is,
the best option would probably be to allow user space to mmap the buffer and
do the implementation in an application outside of the kernel.

	Arnd

  reply	other threads:[~2011-12-09 14:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07  9:27 [PATCH 0/9] XSHM: Shared Memory Driver for ST-E Thor M7400 LTE modem Sjur Brændeland
2011-12-07  9:28 ` [PATCH 1/9] xshm: Shared Memory layout for ST-E M7400 driver Sjur Brændeland
2011-12-07  9:28 ` [PATCH 2/9] xshm: Channel config definitions " Sjur Brændeland
2011-12-07  9:28 ` [PATCH 3/9] xshm: Config data use for platform devices Sjur Brændeland
2011-12-07  9:28 ` [PATCH 4/9] xshm: geni/geno driver interface Sjur Brændeland
2011-12-07  9:28 ` [PATCH 5/9] xshm: genio dummy driver Sjur Brændeland
2011-12-07  9:28 ` [PATCH 6/9] xshm: Platform device for XSHM Sjur Brændeland
2011-12-07  9:28 ` [PATCH 7/9] xshm: Character device for XSHM channel access Sjur Brændeland
2011-12-07  9:28 ` [PATCH 8/9] xshm: Makefile and Kconfig for M7400 Shared Memory Drivers Sjur Brændeland
2011-12-07 12:57   ` Linus Walleij
2011-12-07  9:28 ` [PATCH 9/9] caif-xshm: Add CAIF driver for Shared memory for M7400 Sjur Brændeland
2011-12-07 12:30 ` [PATCH 0/9] XSHM: Shared Memory Driver for ST-E Thor M7400 LTE modem Arnd Bergmann
2011-12-07 15:44   ` Sjur BRENDELAND
2011-12-09 14:42     ` Arnd Bergmann [this message]
2011-12-12  9:05       ` Sjur BRENDELAND
2012-03-22 14:31       ` Sjur BRENDELAND
2012-03-22 16:57         ` Arnd Bergmann
2012-03-27 13:15           ` Using remoteproc with ST-Ericsson modem Sjur BRENDELAND
2012-03-27 13:56             ` Ohad Ben-Cohen
2012-03-28  9:33               ` Sjur BRENDELAND
2012-03-28 15:55                 ` Ohad Ben-Cohen
2012-03-28 17:31                   ` Sjur BRENDELAND
2012-03-31 19:04                     ` Ohad Ben-Cohen
2012-03-31 21:25                       ` Sjur Brændeland
2012-04-01  6:15                         ` Ohad Ben-Cohen
2011-12-07 12:50 ` [PATCH 0/9] XSHM: Shared Memory Driver for ST-E Thor M7400 LTE modem Linus Walleij

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=201112091442.04294.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=sjur.brandeland@stericsson.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.