Linux I2C development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: linux-i2c@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH] i2c: exynos5: fix arbitration lost handling
Date: Fri, 10 Feb 2017 16:49:27 +0100	[thread overview]
Message-ID: <20170210154927.wypbqfnfkt52wvnc@ninjato> (raw)
In-Reply-To: <1b67bbf6-dd31-c473-8284-dba9a0ffe440@samsung.com>

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

On Fri, Feb 10, 2017 at 08:39:58AM +0100, Andrzej Hajda wrote:
> On 09.02.2017 17:27, Wolfram Sang wrote:
> > On Thu, Jan 05, 2017 at 01:06:53PM +0100, Andrzej Hajda wrote:
> >> In case of arbitration lost adequate interrupt sometimes is not signaled. As
> >> a result transfer timeouts and is not retried, as it should. To avoid such
> >> cases code is added to check transaction status in case of every interrupt.
> >>
> >> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> >> ---
> >> +
> >> +		switch (trans_status & HSI2C_MASTER_ST_MASK) {
> >> +		case HSI2C_MASTER_ST_LOSE:
> >> +			i2c->state = -EAGAIN;
> >> +			goto stop;
> >> +		}
> > Why not using if() instead of switch() as in the rest of the driver?
> 
> Following reasons (not serious ones):

I see. It is probably a taste thing, but a switch() with just one case
in it looks like something has been forgotten :) We can change it back
to switch() if ever more states need to be added.

Given that I am not super strict with the 80 char limit anyhow and it
will miss the limit by a few chars only, I'd prefer the if statement
actually.

Other than this, I am OK with applying the patch for 4.11. Can you
resend with the above change?

Thanks,

   Wolfram


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

      parent reply	other threads:[~2017-02-10 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170105120727eucas1p2b9452792b7d13d551974305b478a26e2@eucas1p2.samsung.com>
2017-01-05 12:06 ` [PATCH] i2c: exynos5: fix arbitration lost handling Andrzej Hajda
2017-01-17  6:47   ` Andi Shyti
2017-01-25 20:55   ` Wolfram Sang
2017-01-25 20:57     ` Wolfram Sang
2017-01-25 22:48       ` Andi Shyti
2017-02-09 16:27   ` Wolfram Sang
2017-02-10  7:39     ` Andrzej Hajda
2017-02-10 11:01       ` Andrzej Hajda
2017-02-10 15:49       ` Wolfram Sang [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=20170210154927.wypbqfnfkt52wvnc@ninjato \
    --to=wsa@the-dreams.de \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=javier@osg.samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.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