linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Shardar Mohammed <smohammed@nvidia.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"wsa@the-dreams.de" <wsa@the-dreams.de>,
	"gnurou@gmail.com" <gnurou@gmail.com>
Subject: Re: [PATCH] i2c: tegra: proper handling of error cases
Date: Mon, 18 Apr 2016 09:31:18 +0200	[thread overview]
Message-ID: <20160418073118.GC13078@ulmo.ba.sec> (raw)
In-Reply-To: <73535dcc422441d3a981208dae1a2bad@bgmail102.nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]

On Sat, Apr 16, 2016 at 08:08:50AM +0000, Shardar Mohammed wrote:
> Thanks for the review, updated with comments inline with Shardar.
> 
> > On Fri, Apr 15, 2016 at 06:51:47PM +0530, Shardar Shariff Md wrote:
> > > From: Shardar Shariff Md <smohammed@nvidia.com>
> > >
> > > To summarize the issue observed in error cases:
> > >
> > > In SW: For i2c message transfer, packet header and data payload is
> > > posted and then required error/packet completion interrupts are
> > > enabled later.
> > >
> > > In HW flow: HW process the packet just after packet header is posted,
> > > if ARB lost/NACK error occurs (SW will not handle immediately when
> > > error happens as error interrupts are not enabled at this point). HW
> > > assumes error is acknowledged and clears current data in FIFO, But SW
> > > here posts the remaining data payload which still stays in FIFO as
> > > stale data (data without packet header).
> > >
> > > Now once the interrupts are enabled, SW handles ARB lost/NACK error by
> > > clearing the ARB lost/NACK interrupt. Now HW assumes that SW attended
> > > the error and will parse/process stale data (data without packet
> > > header) present in FIFO which causes invalid NACK errors.
> > >
> > > Fix: Enable the error interrupts before posting the packet into FIFO
> > > which make sure HW to not clear the fifo. Also disable the packet mode
> > > before acknowledging errors (ARB lost/NACK error) to not process any
> > > stale data.
> > >
> > > As error interrupts are enabled before posting the packet header use
> > > spinlock to avoid preempting.
> > 
> > Please try to use up the full 78 characters per line in the commit message
> > (with the exception being the subject line that should be shorter).
> 
> [Shardar] Will take care of this.

I just realized my comment was wrong. The rule is to use 72 characters
per line for the commit message. Sorry about that.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-04-18  7:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1460726507-9170-1-git-send-email-smohammed@nvdiia.com>
     [not found] ` <1460726507-9170-1-git-send-email-smohammed-85njD5c96MTQT0dZR+AlfA@public.gmane.org>
2016-04-15 14:15   ` [PATCH] i2c: tegra: proper handling of error cases Thierry Reding
2016-04-16  8:08     ` Shardar Mohammed
2016-04-18  7:26       ` Thierry Reding
2016-04-18  7:31       ` Thierry Reding [this message]

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=20160418073118.GC13078@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=smohammed@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --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;
as well as URLs for NNTP newsgroup(s).