public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH 0/4] drm/i915/dp: native aux read return value fixes and cleanup
Date: Thu, 30 Jan 2014 15:37:43 +0200	[thread overview]
Message-ID: <87k3dh8uag.fsf@intel.com> (raw)
In-Reply-To: <20140130095022.GN17001@phenom.ffwll.local>

On Thu, 30 Jan 2014, Daniel Vetter <daniel@ffwll.ch> wrote:
> How does this fit in with Thierry's dp aux helper improvements? I prefer
> if we start to converge on that sooner than later ...

Patch 1/4 actually fixes a potential bug in intel_dp_sink_crc(), which
now detects failure only if the read returns 0, but plunges on with any
negative error values. So we may want to queue that for fixes.

Patch 2/4 could be dropped.

I'd like to do 3/4 as a prep patch anyway, as it potentially changes
behaviour, and makes conversion to the helpers more straightforward.

Patch 4/4 could be dropped.

To see how this would pan out, I'm almost done with the native aux
conversion (did not look at the i2c-over-aux part yet).

If we use those interfaces directly all over the place, the only
annoyance is the potential for the same confusion that I've tried to
avoid in this series.

The only correct check for success is comparing the transfer function
return value to the number of bytes that was to be transferred:

	if (drm_dp_dpcd_read(&intel_dp->dp_aux, offset, buffer, len) != len)

but len may in fact be a fairly long #define like
DP_DEVICE_SERVICE_IRQ_VECTOR.

I do notice Thierry checks for ret < 0 in his code, although, IIUC, it's
possible the transfer ends with fewer bytes transferred than requested.

I'm beginning to feel like the functions should return and guarantee an
error code < 0 if not all bytes were transferred, just for the ease of
use. I mean, it's a nice feature to be able to make the distinction, but
I can't fathom a practical situation where that would be necessary.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2014-01-30 13:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30  9:37 [PATCH 0/4] drm/i915/dp: native aux read return value fixes and cleanup Jani Nikula
2014-01-30  9:37 ` [PATCH 1/4] drm/i915/dp: make intel_dp_aux_native_read() return bool Jani Nikula
2014-01-30 10:07   ` Chris Wilson
2014-01-30 12:00     ` [PATCH v2] " Jani Nikula
2014-01-30  9:37 ` [PATCH 2/4] drm/i915/dp: move intel_dp_aux_native_read_retry() near other reads Jani Nikula
2014-01-30 12:00   ` [PATCH v2] " Jani Nikula
2014-01-30  9:37 ` [PATCH 3/4] drm/i915/dp: clean up cargo culted intel_dp_aux_native_read_retry() usage Jani Nikula
2014-01-30  9:37 ` [PATCH 4/4] drm/i915/dp: fix intel_dp_aux_native_read_retry() return value check Jani Nikula
2014-01-30  9:50 ` [PATCH 0/4] drm/i915/dp: native aux read return value fixes and cleanup Daniel Vetter
2014-01-30 13:37   ` Jani Nikula [this message]
2014-01-30 15:05   ` Jani Nikula
2014-01-30 15:12     ` Daniel Vetter

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=87k3dh8uag.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thierry.reding@gmail.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