From: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> To: Wolfram Sang <wsa@kernel.org> Cc: linux-i2c <linux-i2c@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>, Lori Hikichi <lori.hikichi@broadcom.com>, Robert Richter <rrichter@marvell.com>, Nishka Dasgupta <nishkadg.linux@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-arm Mailing List <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH v2 1/2] i2c: add PEC error event Date: Fri, 24 Jul 2020 14:52:00 +0530 [thread overview] Message-ID: <CAHO=5PHk=Vozd8ipTp_6tYzTiaS++p7C1XWTRC7QdpjWV6OyCw@mail.gmail.com> (raw) In-Reply-To: <20200723201634.GC908@ninjato> On Fri, Jul 24, 2020 at 1:46 AM Wolfram Sang <wsa@kernel.org> wrote: > > On Fri, Jul 17, 2020 at 02:31:54PM +0530, Rayagonda Kokatanur wrote: > > Add new event I2C_SLAVE_PEC_ERR to list of slave events. > > This event will be used by slave bus driver to indicate > > PEC error to slave client or backend driver. > > > > Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> > > Definately needs documentation in Documentation/i2c/slave-interface.rst. Okay, I will update the doc. > > What is a backend supposed to do? Does 'value' have a meaning? According to SMBUS spec, during slave receive transfer, it is encouraged to issue NACK if the received PEC is not correct. Also PEC errors discovered above the data link layer may also be indicated with a NACK if the device is fast enough to discover and indicate the error when the NACK is due. If a device doesn't support issuing NACK and issuing NACK above the data link layer is not possible because the device is not fast then in that case we can send error code (I2C_SLAVE_PEC_ERR ) to the backend driver. Backend drivers which support PEC should check for this error code and take action such as discarding the data. Best regards, Rayagonda > > > --- > > include/linux/i2c.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/linux/i2c.h b/include/linux/i2c.h > > index b8b8963f8bb9..e04acd04eb48 100644 > > --- a/include/linux/i2c.h > > +++ b/include/linux/i2c.h > > @@ -370,6 +370,7 @@ enum i2c_slave_event { > > I2C_SLAVE_READ_PROCESSED, > > I2C_SLAVE_WRITE_RECEIVED, > > I2C_SLAVE_STOP, > > + I2C_SLAVE_PEC_ERR, > > }; > > > > int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb); > > -- > > 2.17.1 > >
WARNING: multiple messages have this Message-ID (diff)
From: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> To: Wolfram Sang <wsa@kernel.org> Cc: Lori Hikichi <lori.hikichi@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Ray Jui <rjui@broadcom.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Robert Richter <rrichter@marvell.com>, BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>, linux-i2c <linux-i2c@vger.kernel.org>, Nishka Dasgupta <nishkadg.linux@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-arm Mailing List <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH v2 1/2] i2c: add PEC error event Date: Fri, 24 Jul 2020 14:52:00 +0530 [thread overview] Message-ID: <CAHO=5PHk=Vozd8ipTp_6tYzTiaS++p7C1XWTRC7QdpjWV6OyCw@mail.gmail.com> (raw) In-Reply-To: <20200723201634.GC908@ninjato> On Fri, Jul 24, 2020 at 1:46 AM Wolfram Sang <wsa@kernel.org> wrote: > > On Fri, Jul 17, 2020 at 02:31:54PM +0530, Rayagonda Kokatanur wrote: > > Add new event I2C_SLAVE_PEC_ERR to list of slave events. > > This event will be used by slave bus driver to indicate > > PEC error to slave client or backend driver. > > > > Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> > > Definately needs documentation in Documentation/i2c/slave-interface.rst. Okay, I will update the doc. > > What is a backend supposed to do? Does 'value' have a meaning? According to SMBUS spec, during slave receive transfer, it is encouraged to issue NACK if the received PEC is not correct. Also PEC errors discovered above the data link layer may also be indicated with a NACK if the device is fast enough to discover and indicate the error when the NACK is due. If a device doesn't support issuing NACK and issuing NACK above the data link layer is not possible because the device is not fast then in that case we can send error code (I2C_SLAVE_PEC_ERR ) to the backend driver. Backend drivers which support PEC should check for this error code and take action such as discarding the data. Best regards, Rayagonda > > > --- > > include/linux/i2c.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/linux/i2c.h b/include/linux/i2c.h > > index b8b8963f8bb9..e04acd04eb48 100644 > > --- a/include/linux/i2c.h > > +++ b/include/linux/i2c.h > > @@ -370,6 +370,7 @@ enum i2c_slave_event { > > I2C_SLAVE_READ_PROCESSED, > > I2C_SLAVE_WRITE_RECEIVED, > > I2C_SLAVE_STOP, > > + I2C_SLAVE_PEC_ERR, > > }; > > > > int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb); > > -- > > 2.17.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-24 9:22 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-17 9:01 [PATCH v2 0/2] add PEC support on slave side Rayagonda Kokatanur 2020-07-17 9:01 ` Rayagonda Kokatanur 2020-07-17 9:01 ` [PATCH v2 1/2] i2c: add PEC error event Rayagonda Kokatanur 2020-07-17 9:01 ` Rayagonda Kokatanur 2020-07-23 20:16 ` Wolfram Sang 2020-07-23 20:16 ` Wolfram Sang 2020-07-24 9:22 ` Rayagonda Kokatanur [this message] 2020-07-24 9:22 ` Rayagonda Kokatanur 2020-07-17 9:01 ` [PATCH v2 2/2] i2c: iproc: add slave pec support Rayagonda Kokatanur 2020-07-17 9:01 ` Rayagonda Kokatanur 2020-07-23 20:20 ` Wolfram Sang 2020-07-23 20:20 ` Wolfram Sang 2020-07-24 9:37 ` Rayagonda Kokatanur 2020-07-24 9:37 ` Rayagonda Kokatanur 2020-07-22 11:07 ` [PATCH v2 0/2] add PEC support on slave side Andy Shevchenko 2020-07-22 11:07 ` Andy Shevchenko
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='CAHO=5PHk=Vozd8ipTp_6tYzTiaS++p7C1XWTRC7QdpjWV6OyCw@mail.gmail.com' \ --to=rayagonda.kokatanur@broadcom.com \ --cc=andriy.shevchenko@linux.intel.com \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lori.hikichi@broadcom.com \ --cc=nishkadg.linux@gmail.com \ --cc=rjui@broadcom.com \ --cc=rrichter@marvell.com \ --cc=sbranden@broadcom.com \ --cc=wsa@kernel.org \ /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: linkBe 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.