public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Sjur Brændeland" <sjur.brandeland@stericsson.com>
Cc: 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: Wed, 7 Dec 2011 12:30:07 +0000	[thread overview]
Message-ID: <201112071230.08019.arnd@arndb.de> (raw)
In-Reply-To: <1323250088-1729-1-git-send-email-sjur.brandeland@stericsson.com>

Hi Sjur,

I've tried to do a review of your code, but I really need to understand
more of the background first, to be able to tell if it's using the
right high-level approach. There are a lot of details I could
comment on, but let's first look at the overall design.

On Wednesday 07 December 2011, Sjur Brændeland 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.

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?

> 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?

> 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?

> Driver model
> ~~~~~~~~~~~~~~
> Current implementation is using the platform bus for XSHM devices.
> The packet channels are named "xshmp", and stream channel "xshms".
>
> /sys/devices:
> |-- platform
> |   |-- uevent
> |   `-- xshm
> |       |-- bootimg
> |       |-- caif_ready
> |       |-- ipc_ready
> |       |-- subsystem -> ../../../bus/platform
> |       |-- xshmp.1
> |       |   |-- driver -> ../../../../bus/platform/drivers/xshmp
> |       |   |-- subsystem -> ../../../../bus/platform
> |       `-- xshms.0
> |           |-- driver -> ../../../../bus/platform/drivers/xshms
> |           |-- misc
> |           |   `-- xshm0
> |           |       |-- device -> ../../../xshms.0
> |           |       |-- subsystem -> ../../../../../../class/misc
> `-- virtual
>     |-- net
>     |   |-- cfshm0

Why are the channels /platform/ devices? With all the infrastructure
you have in the xshm driver, I would think that you should be
able to probe the available channels yourself instead of relying the
board to define them. If you cannot, that is something that I think
needs to be fixed in the interface to the modem. If you can, you
probably should not be using the platform_bus but instead create
your own bus_type.

	Arnd

  parent reply	other threads:[~2011-12-07 12:30 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 ` Arnd Bergmann [this message]
2011-12-07 15:44   ` [PATCH 0/9] XSHM: Shared Memory Driver for ST-E Thor M7400 LTE modem Sjur BRENDELAND
2011-12-09 14:42     ` Arnd Bergmann
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=201112071230.08019.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox