From: Wolfram Sang <wsa@the-dreams.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-i2c@vger.kernel.org, linux-sh@vger.kernel.org,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Andrey Danin <danindrey@mail.ru>, Marc Dietrich <marvin24@gmx.de>,
Debora Grosse <debora@mds.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Documentation: i2c: describe the new slave mode
Date: Fri, 20 Mar 2015 09:22:39 +0100 [thread overview]
Message-ID: <20150320082238.GB2071@katana> (raw)
In-Reply-To: <20150320074214.GD10068@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2924 bytes --]
On Fri, Mar 20, 2015 at 08:42:14AM +0100, Uwe Kleine-König wrote:
> Hello Wolfram,
>
> On Fri, Mar 20, 2015 at 08:30:13AM +0100, Wolfram Sang wrote:
> >
> > > > +Finally, Linux can also be an I2C slave in case I2C controllers have slave
> > > > +support. Besides this HW requirement, one also needs a software backend
> > > I wouldn't have written "Finally, ...". While it's great that we have
> > > slave support now, being enthusiastic here looks strange if someone
> > > reads it while slave support has become "normal".
> >
> > OK.
> >
> > > > +providing the actual functionality. An example for this is the slave-eeprom
> > > > +driver, which acts as a dual memory driver. While another I2C master on the bus
> > > > +can access it like a regular eeprom, the Linux I2C slave can access the content
> > > > +via sysfs and retrieve/provide information as needed. The software backend
> > > > +driver and the I2C bus driver communicate via events. Here is a small graph
> > > > +visualizing the data flow and the means by which data is transported. The
> > > > +dotted line marks only one example. The backend could also use e.g. a character
> > > > +device, or use in-kernel mechanisms only, or something completely different:
> > > Or something self contained, so the userspace part is actually optional
> > > (but probably present most of the time).
> >
> > With "in-kernel mechanisms" I meant self-contained. Maybe "be in-kernel
> > only"?
> I'm sure "in-kernel mechanisms" wasn't in the mail I replied to. (Hmm,
> or I must have missed that while reading.)
:) Still, I like "be in-kernel only" better, so I'll rephrase.
> > > Does that mean that I have to pass a valid address, or can I use NULL,
> > > too?
> >
> > Is NULL a valid pointer to val?
> NULL is a pointer and you didn't wrote about "valid" above. I just
But NULL is not a pointer to val.
> wondered if the necessity just comes from the fact that the function
> takes 3 parameters and so you have to give it 3 (this wouldn't needed to
> be pointed out IMHO) or if the value must be valid (then the wording
> isn't optimal).
I'll try to rephrase.
> Is there a technical reason to require val to be valid?
Better be safe than sorry in case for future needs of 'val' I can't see
now.
> > You need to assume that if the next byte is requested, the previous byte
> > made it to the bus. So, you should do pre-increment in
> > I2C_SLAVE_READ_PROCESSED, not post-increment. I didn't want to write
> This might be a correctness problem, right? If we cannot fix it (with
> the current slave abstraction) should this be pointed out somewhere; at
> least in the eeprom driver as this will probably be the reference for
> the next backend?
Adding some more info to the eeprom driver sounds good. Updating this
paragraph with some infos from this discussion, too.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-i2c@vger.kernel.org, linux-sh@vger.kernel.org,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Andrey Danin <danindrey@mail.ru>, Marc Dietrich <marvin24@gmx.de>,
Debora Grosse <debora@mds.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Documentation: i2c: describe the new slave mode
Date: Fri, 20 Mar 2015 08:22:39 +0000 [thread overview]
Message-ID: <20150320082238.GB2071@katana> (raw)
In-Reply-To: <20150320074214.GD10068@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2924 bytes --]
On Fri, Mar 20, 2015 at 08:42:14AM +0100, Uwe Kleine-König wrote:
> Hello Wolfram,
>
> On Fri, Mar 20, 2015 at 08:30:13AM +0100, Wolfram Sang wrote:
> >
> > > > +Finally, Linux can also be an I2C slave in case I2C controllers have slave
> > > > +support. Besides this HW requirement, one also needs a software backend
> > > I wouldn't have written "Finally, ...". While it's great that we have
> > > slave support now, being enthusiastic here looks strange if someone
> > > reads it while slave support has become "normal".
> >
> > OK.
> >
> > > > +providing the actual functionality. An example for this is the slave-eeprom
> > > > +driver, which acts as a dual memory driver. While another I2C master on the bus
> > > > +can access it like a regular eeprom, the Linux I2C slave can access the content
> > > > +via sysfs and retrieve/provide information as needed. The software backend
> > > > +driver and the I2C bus driver communicate via events. Here is a small graph
> > > > +visualizing the data flow and the means by which data is transported. The
> > > > +dotted line marks only one example. The backend could also use e.g. a character
> > > > +device, or use in-kernel mechanisms only, or something completely different:
> > > Or something self contained, so the userspace part is actually optional
> > > (but probably present most of the time).
> >
> > With "in-kernel mechanisms" I meant self-contained. Maybe "be in-kernel
> > only"?
> I'm sure "in-kernel mechanisms" wasn't in the mail I replied to. (Hmm,
> or I must have missed that while reading.)
:) Still, I like "be in-kernel only" better, so I'll rephrase.
> > > Does that mean that I have to pass a valid address, or can I use NULL,
> > > too?
> >
> > Is NULL a valid pointer to val?
> NULL is a pointer and you didn't wrote about "valid" above. I just
But NULL is not a pointer to val.
> wondered if the necessity just comes from the fact that the function
> takes 3 parameters and so you have to give it 3 (this wouldn't needed to
> be pointed out IMHO) or if the value must be valid (then the wording
> isn't optimal).
I'll try to rephrase.
> Is there a technical reason to require val to be valid?
Better be safe than sorry in case for future needs of 'val' I can't see
now.
> > You need to assume that if the next byte is requested, the previous byte
> > made it to the bus. So, you should do pre-increment in
> > I2C_SLAVE_READ_PROCESSED, not post-increment. I didn't want to write
> This might be a correctness problem, right? If we cannot fix it (with
> the current slave abstraction) should this be pointed out somewhere; at
> least in the eeprom driver as this will probably be the reference for
> the next backend?
Adding some more info to the eeprom driver sounds good. Updating this
paragraph with some infos from this discussion, too.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-03-20 8:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 12:42 [PATCH 0/3] i2c: slave: API updates Wolfram Sang
2015-03-12 12:42 ` Wolfram Sang
2015-03-12 12:42 ` Wolfram Sang
2015-03-12 12:42 ` [PATCH 1/3] i2c: slave: rework the slave API Wolfram Sang
2015-03-12 12:42 ` Wolfram Sang
[not found] ` <1426164123-8853-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-19 20:17 ` Uwe Kleine-König
2015-03-19 20:17 ` Uwe Kleine-König
2015-03-19 20:17 ` Uwe Kleine-König
2015-03-20 7:15 ` Wolfram Sang
2015-03-20 7:15 ` Wolfram Sang
2015-03-20 7:24 ` Uwe Kleine-König
2015-03-20 7:24 ` Uwe Kleine-König
2015-03-20 7:24 ` Uwe Kleine-König
2015-03-20 7:31 ` Wolfram Sang
2015-03-20 7:31 ` Wolfram Sang
2015-03-20 7:44 ` Uwe Kleine-König
2015-03-20 7:44 ` Uwe Kleine-König
[not found] ` <20150320074447.GE10068-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-20 8:18 ` Wolfram Sang
2015-03-20 8:18 ` Wolfram Sang
2015-03-20 8:18 ` Wolfram Sang
2015-03-12 12:42 ` [PATCH 2/3] Documentation: i2c: describe the new slave mode Wolfram Sang
2015-03-12 12:42 ` Wolfram Sang
2015-03-12 13:27 ` Geert Uytterhoeven
2015-03-12 13:27 ` Geert Uytterhoeven
2015-03-19 20:11 ` Uwe Kleine-König
2015-03-19 20:11 ` Uwe Kleine-König
[not found] ` <20150319201137.GY10068-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-20 7:30 ` Wolfram Sang
2015-03-20 7:30 ` Wolfram Sang
2015-03-20 7:30 ` Wolfram Sang
2015-03-20 7:42 ` Uwe Kleine-König
2015-03-20 7:42 ` Uwe Kleine-König
2015-03-20 8:22 ` Wolfram Sang [this message]
2015-03-20 8:22 ` Wolfram Sang
2015-03-12 12:42 ` [PATCH 3/3] i2c: slave: add documentation for i2c-slave-eeprom Wolfram Sang
2015-03-12 12:42 ` Wolfram Sang
2015-03-12 13:28 ` [PATCH 0/3] i2c: slave: API updates Geert Uytterhoeven
2015-03-12 13:28 ` Geert Uytterhoeven
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=20150320082238.GB2071@katana \
--to=wsa@the-dreams.de \
--cc=danindrey@mail.ru \
--cc=debora@mds.com \
--cc=geert@linux-m68k.org \
--cc=horms@verge.net.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=marvin24@gmx.de \
--cc=u.kleine-koenig@pengutronix.de \
/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.