public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
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,
	Daniel Vetter <daniel@ffwll.ch>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Benson Leung <bleung@chromium.org>,
	Yufeng Shen <miletus@chromium.org>
Subject: Re: [PATCH 04/11 v3] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments
Date: Mon, 26 Mar 2012 17:20:11 +0200	[thread overview]
Message-ID: <20120326152011.GT4014@phenom.ffwll.local> (raw)
In-Reply-To: <1332772010-19619-5-git-send-email-djkurtz@chromium.org>

On Mon, Mar 26, 2012 at 10:26:43PM +0800, Daniel Kurtz wrote:
> There is no GMBUS "disabled" port 0, nor "reserved" port 7.
> For the other 6 ports there is a fixed 1:1 mapping between pin pairs and
> gmbus ports, which means every real gmbus port has a gpio pin.
> 
> Given these realizations, clean up gmbus initialization.
> 
> Tested on Sandybridge (gen 6, PCH == CougarPoint) hardware.
> 
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.h  |    1 -
>  drivers/gpu/drm/i915/i915_reg.h  |    2 +-
>  drivers/gpu/drm/i915/intel_i2c.c |   63 ++++++++++++++-----------------------
>  3 files changed, 25 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> @@ -370,16 +365,6 @@ static const struct i2c_algorithm gmbus_algorithm = {
>   */
>  int intel_setup_gmbus(struct drm_device *dev)
>  {
> -	static const char *names[GMBUS_NUM_PORTS] = {
> -		"disabled",
> -		"ssc",
> -		"vga",
> -		"panel",
> -		"dpc",
> -		"dpb",
> -		"dpd",
> -		"reserved",
> -	};
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	int ret, i;
>  
> @@ -397,13 +382,14 @@ int intel_setup_gmbus(struct drm_device *dev)
>  
>  	for (i = 0; i < GMBUS_NUM_PORTS; i++) {
>  		struct intel_gmbus *bus = &dev_priv->gmbus[i];
> +		u32 port = i + 1; /* +1 to map gmbus index to pin pair */

On reconsideration you move around gmbus ports here, which will break
things horribly. I've wondered a bit how that could possible work and
noticed that you fix things up in the a later patch when introducing
get_adapter.

This ordering breaks bisecting is a complete no-go. If you want to do this
(I still think the refactor is nice) you need to introduce get_adapter
first, then change the meaning of the array index in this patch while
adjusting the lookup in the new get_adapter function.

Yours, Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  parent reply	other threads:[~2012-03-26 15:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 14:26 [PATCH 00/11 v3] fix gmbus writes and related issues Daniel Kurtz
2012-03-26 14:26 ` [PATCH 01/11 v3] drm/i915/intel_i2c: cleanup Daniel Kurtz
2012-03-26 15:29   ` Daniel Vetter
2012-03-26 14:26 ` [PATCH 02/11 v3] drm/i915/intel_i2c: assign HDMI port D to pin pair 6 Daniel Kurtz
2012-03-26 14:47   ` Daniel Vetter
2012-03-26 15:08     ` Daniel Vetter
2012-03-26 17:49       ` Daniel Kurtz
2012-03-27  7:54         ` Daniel Vetter
2012-03-26 14:26 ` [PATCH 03/11 v3] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers Daniel Kurtz
2012-03-26 14:49   ` Daniel Vetter
2012-03-26 17:58     ` Daniel Kurtz
2012-03-26 19:06       ` Daniel Vetter
2012-03-26 14:26 ` [PATCH 04/11 v3] drm/i915/intel_i2c: cleanup gmbus/gpio pin assignments Daniel Kurtz
2012-03-26 15:10   ` Daniel Vetter
2012-03-26 15:20   ` Daniel Vetter [this message]
2012-03-26 14:26 ` [PATCH 05/11 v3] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private Daniel Kurtz
2012-03-26 15:10   ` Daniel Vetter
2012-03-26 15:20   ` Daniel Vetter
2012-03-26 14:26 ` [PATCH 06/11 v3] drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter Daniel Kurtz
2012-03-26 15:22   ` Daniel Vetter
2012-03-26 14:26 ` [PATCH 07/11 v3] drm/i915/intel_i2c: handle zero-length writes Daniel Kurtz
2012-03-26 14:26 ` [PATCH 08/11 v3] drm/i915/intel_i2c: always wait for IDLE before clearing NAK Daniel Kurtz
2012-03-26 14:26 ` [PATCH 09/11 v3] drm/i915/intel_i2c: use WAIT cycle, not STOP Daniel Kurtz
2012-03-26 14:26 ` [PATCH 10/11 v3] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions Daniel Kurtz
2012-03-26 14:26 ` [PATCH 11/11 v3] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop Daniel Kurtz
2012-03-26 15:33 ` [PATCH 00/11 v3] fix gmbus writes and related issues 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=20120326152011.GT4014@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=bleung@chromium.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miletus@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox