All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Keith Packard <keithp@keithp.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Benson Leung <bleung@chromium.org>,
	Yufeng Shen <miletus@chromium.org>,
	Sameer Nanda <snanda@chromium.org>
Subject: Re: [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK
Date: Wed, 07 Mar 2012 12:53:21 +0000	[thread overview]
Message-ID: <aefc95$3e4jv1@orsmga001.jf.intel.com> (raw)
In-Reply-To: <CAGS+omByuSWzV1Pa_ODugq9rrZ2DtgU_LPWDAfbrR_q_zuDvYQ@mail.gmail.com>

On Wed, 7 Mar 2012 20:41:03 +0800, Daniel Kurtz <djkurtz@chromium.org> wrote:
> On Wed, Mar 7, 2012 at 8:12 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Wed,  7 Mar 2012 19:50:47 +0800, Daniel Kurtz <djkurtz@chromium.org> wrote:
> >> Return -ENXIO if a device NAKs a transaction.
> >>
> >> Note: We should return -ETIMEDOUT, too if the transaction times out,
> >> however, that error path is currently handled by the 'bit-bang fallback'.
> >>
> >> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> >
> > Can you clarify what the rule is if an error is detected part-way
> > through a xfer?
> 
> A priceless comment from drivers/i2c/i2c-core::i2c_transfer...

Thanks, that is about as consistent as one expects with i2c. ;)
 
> This doesn't specify what to do if the transfer doesn't get an ACK
> during another phase of the transfer.
> However, it does say to send -ENXIO "if no ACK during address phase",
> which is a subset of the possible no-ACK conditions during a transfer.
>  Thus, I choose to return ENXIO in all no-ACK cases, to ensure we send
> it during the one case that is specified.

This (and a summary of the rest) deserves to be captured as a comment in
the code.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Keith Packard <keithp@keithp.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Benson Leung <bleung@chromium.org>,
	Yufeng Shen <miletus@chromium.org>,
	Sameer Nanda <snanda@chromium.org>
Subject: Re: [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK
Date: Wed, 07 Mar 2012 12:53:21 +0000	[thread overview]
Message-ID: <aefc95$3e4jv1@orsmga001.jf.intel.com> (raw)
In-Reply-To: <CAGS+omByuSWzV1Pa_ODugq9rrZ2DtgU_LPWDAfbrR_q_zuDvYQ@mail.gmail.com>

On Wed, 7 Mar 2012 20:41:03 +0800, Daniel Kurtz <djkurtz@chromium.org> wrote:
> On Wed, Mar 7, 2012 at 8:12 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Wed,  7 Mar 2012 19:50:47 +0800, Daniel Kurtz <djkurtz@chromium.org> wrote:
> >> Return -ENXIO if a device NAKs a transaction.
> >>
> >> Note: We should return -ETIMEDOUT, too if the transaction times out,
> >> however, that error path is currently handled by the 'bit-bang fallback'.
> >>
> >> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> >
> > Can you clarify what the rule is if an error is detected part-way
> > through a xfer?
> 
> A priceless comment from drivers/i2c/i2c-core::i2c_transfer...

Thanks, that is about as consistent as one expects with i2c. ;)
 
> This doesn't specify what to do if the transfer doesn't get an ACK
> during another phase of the transfer.
> However, it does say to send -ENXIO "if no ACK during address phase",
> which is a subset of the possible no-ACK conditions during a transfer.
>  Thus, I choose to return ENXIO in all no-ACK cases, to ensure we send
> it during the one case that is specified.

This (and a summary of the rest) deserves to be captured as a comment in
the code.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-03-07 12:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 11:50 [PATCH 0/9] drm/i915/intel_i2c: fix gmbus writes and related issues Daniel Kurtz
2012-03-07 11:50 ` [PATCH 1/9] drm/i915/intel_i2c: cleanup Daniel Kurtz
2012-03-07 11:58   ` Chris Wilson
2012-03-07 11:58     ` Chris Wilson
2012-03-07 11:50 ` [PATCH 2/9] drm/i915/intel_i2c: assign HDMI port D to pin pair 6 Daniel Kurtz
2012-03-07 13:23   ` Chris Wilson
2012-03-07 13:23     ` Chris Wilson
2012-03-07 18:03     ` Daniel Kurtz
     [not found]     ` <CAGS+omDvcmfVAh_Tx64SdC0Ys8FOgZXjbYmPO8SrgQW_1aPOJg@mail.gmail.com>
2012-03-07 18:07       ` Chris Wilson
2012-03-07 18:07         ` Chris Wilson
2012-03-07 11:50 ` [PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus Daniel Kurtz
2012-03-07 12:02   ` Chris Wilson
2012-03-07 12:02     ` Chris Wilson
2012-03-07 12:15   ` Chris Wilson
2012-03-07 12:15     ` Chris Wilson
2012-03-07 11:50 ` [PATCH 4/9] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments Daniel Kurtz
2012-03-07 12:17   ` Chris Wilson
2012-03-07 12:17     ` Chris Wilson
2012-03-07 12:44     ` Daniel Kurtz
2012-03-07 11:50 ` [PATCH 5/9] drm/i915/intel_i2c: add locking around i2c algorithm accesses Daniel Kurtz
2012-03-18 18:19   ` Daniel Vetter
2012-03-18 18:19     ` Daniel Vetter
2012-03-07 11:50 ` [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK Daniel Kurtz
2012-03-07 12:12   ` Chris Wilson
2012-03-07 12:12     ` Chris Wilson
2012-03-07 12:41     ` Daniel Kurtz
2012-03-07 12:53       ` Chris Wilson [this message]
2012-03-07 12:53         ` Chris Wilson
2012-03-07 11:50 ` [PATCH 7/9] drm/i915/intel_i2c: use WAIT cycle, not STOP Daniel Kurtz
2012-03-07 11:50 ` [PATCH 8/9] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions Daniel Kurtz
2012-03-07 11:50 ` [PATCH 9/9] drm/i915/intel_i2c: reuse GMBUS2 value from polling loop Daniel Kurtz
2012-03-07 12:09   ` Chris Wilson
2012-03-07 12:09     ` Chris Wilson

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='aefc95$3e4jv1@orsmga001.jf.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@linux.ie \
    --cc=bleung@chromium.org \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miletus@chromium.org \
    --cc=snanda@chromium.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: 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.