mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suneel Garapati <suneel.garapati@xilinx.com>
To: Soren Brinkmann <sorenb@xilinx.com>,
	Mike Looijmans <mike.looijmans@topic.nl>,
	Michal Simek <michals@xilinx.com>
Cc: git <git@xilinx.com>, "wsa@the-dreams.de" <wsa@the-dreams.de>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] i2c-cadence: Do not let signals interrupt I2C transfers
Date: Tue, 11 Mar 2014 04:49:16 +0000	[thread overview]
Message-ID: <b6f0755f-cfc9-4962-851f-5eeac767e93e@AM1EHSMHS008.ehs.local> (raw)
In-Reply-To: <20140310215952.GF13293@xsjandreislx>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3140 bytes --]

Hi Mike/Soren,

> -----Original Message-----
> From: Sören Brinkmann [mailto:soren.brinkmann@xilinx.com]
> Sent: Tuesday, March 11, 2014 03:30
> To: Mike Looijmans; Michal Simek
> Cc: git; wsa@the-dreams.de; linux-i2c@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH] i2c-cadence: Do not let signals interrupt I2C transfers
>
> Hi Mike,
>
> The cadence driver is not in mainline yet. I think for our vendor tree we can
> pretty much take it this way.
> Regarding getting this into mainline, I'll send another iteration of the change
> set and include these changes.
>
> On Mon, 2014-03-10 at 12:12PM +0100, Mike Looijmans wrote:
> > Pressing CTRL-C while communicating with an I2C device leads to
> > erratic behaviour. The cause is that the controller will interrupt the
> > I2C transfer in progress, and leave the client device in an undefined
> > state. Many drivers do not handle error return codes on I2C transfers.
> > The calling driver has no way of telling how much of the transfer has
> > actually completed, so it cannot reliably determine the device's state.
> >
> > The best solution here is to not handle signals in the I2C bus driver
> > at all, but always complete a transaction before returning control.
> >
> > See for a related patch and discussion on this topic:
> > http://lkml.org/lkml/2014/1/9/246
>
> Can we get your Signed-off-by, please?
>
> > ---
> >  drivers/i2c/busses/i2c-cadence.c |   12 ++++--------
> >  1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-cadence.c
> > b/drivers/i2c/busses/i2c-cadence.c
> > index 86713d6..32ce2ee 100644
> > --- a/drivers/i2c/busses/i2c-cadence.c
> > +++ b/drivers/i2c/busses/i2c-cadence.c
> > @@ -452,16 +452,12 @@ static int cdns_i2c_process_msg(struct cdns_i2c
> *id, struct i2c_msg *msg,
> >                     cdns_i2c_msend(id);
> >
> >             /* Wait for the signal of completion */
> > -           ret = wait_for_completion_interruptible_timeout(
> > -                                                   &id->xfer_done, HZ);
> > -           if (ret < 1) {
> > +           ret = wait_for_completion_timeout(&id->xfer_done, HZ);
> > +           if (ret == 0) {
>
> To match the style used throughout the file this should just be
>       if (!ret) {
Instead of discarding Ctrl+C, Can we wait until the current msg transfer completes
[to avoid client undefined state or re-init the host to a known state]

I see da-vinci driver handling in a similar way.

Regards,
Suneel

>
>
> Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
>
>       Thanks,
>       Sören



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  parent reply	other threads:[~2014-03-11  4:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 11:12 Mike Looijmans
2014-03-10 21:59 ` Sören Brinkmann
     [not found] ` <20140310215952.GF13293@xsjandreislx>
2014-03-11  4:49   ` Suneel Garapati [this message]
2014-03-11  6:59     ` Mike Looijmans
2014-03-11  7:07 ` Mike Looijmans
2014-03-11 16:00   ` Sören Brinkmann

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=b6f0755f-cfc9-4962-851f-5eeac767e93e@AM1EHSMHS008.ehs.local \
    --to=suneel.garapati@xilinx.com \
    --cc=git@xilinx.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=mike.looijmans@topic.nl \
    --cc=sorenb@xilinx.com \
    --cc=wsa@the-dreams.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 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®