lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Mar 2012 16:47:11 +0200
From:	Daniel Vetter <daniel@...ll.ch>
To:	Daniel Kurtz <djkurtz@...omium.org>
Cc:	Keith Packard <keithp@...thp.com>, David Airlie <airlied@...ux.ie>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	Daniel Vetter <daniel@...ll.ch>,
	Chris Wilson <chris@...is-wilson.co.uk>,
	Benson Leung <bleung@...omium.org>,
	Yufeng Shen <miletus@...omium.org>
Subject: Re: [PATCH 02/11 v3] drm/i915/intel_i2c: assign HDMI port D to pin
 pair 6

On Mon, Mar 26, 2012 at 10:26:41PM +0800, Daniel Kurtz wrote:
> According to i915 documentation [1], "Port D" (DP/HDMI Port D) is
> actually gmbus pin pair 6 (gmbus0.2:0 == 110b GPIOF), not 7 (111b).
> Pin pair 7 is a reserved pair.
> 
> [1] Documentation for [DevSNB+] and [DevIBX], as found on
> http://intellinuxgraphics.org
> 
> Note: the "reserved" and "disabled" pairs do not actually map to a
> physical pair of pins, nor GPIO regs and shouldn't be initialized or used.
> Fixing this is left for a later patch.
> 
> This bug has not been noticed for two reasons:
>  1) "gmbus" mode is currently disabled - all transfers are actually using
>     "bit-bang" mode which uses the GPIO port 5 (the "HDMI/DPD CTLDATA/CLK"
>     pair), at register 0x5024 (defined as GPIOF i915_reg.h).
>     Since this is the correct pair of pins for HDMI1, transfers succeed.

... this is no longer true on drm-intel-next.

>  2) Even if gmbus mode is re-enabled, the first attempted transaction
>     will fail because it tries to use the wrong ("Reserved") pin pair.
>     However, the driver immediately falls back again to the bit-bang
>     method, which correctly uses GPIOF, so again, transfers succeed.
> 
> However, if gmbus mode is re-enabled and the GPIO fall-back mode is
> disabled, then reading an attached monitor's EDID fail.
> 
> Signed-off-by: Daniel Kurtz <djkurtz@...omium.org>

Otherwise this looks ok to me - I've checked with gen3 Bspec and we seem
to indeed have a 1:1 mapping, see "Display Registers", 1.5.3 "GPIO Control
Registers", the list right below the heading.

Reviewed-by: Daniel Vetter <daniel.vetter@...ll.ch>

When resending, can you please add the Bspec reference above?

Thanks, Daniel

> ---
>  drivers/gpu/drm/i915/i915_reg.h  |    6 +++---
>  drivers/gpu/drm/i915/intel_i2c.c |    4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index f3609f2..accd8ee 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -742,9 +742,9 @@
>  #define   GMBUS_PORT_PANEL	3
>  #define   GMBUS_PORT_DPC	4 /* HDMIC */
>  #define   GMBUS_PORT_DPB	5 /* SDVO, HDMIB */
> -				  /* 6 reserved */
> -#define   GMBUS_PORT_DPD	7 /* HDMID */
> -#define   GMBUS_NUM_PORTS       8
> +#define   GMBUS_PORT_DPD	6 /* HDMID */
> +#define   GMBUS_PORT_RESERVED	7 /* 7 reserved */
> +#define   GMBUS_NUM_PORTS	8
>  #define GMBUS1			0x5104 /* command/status */
>  #define   GMBUS_SW_CLR_INT	(1<<31)
>  #define   GMBUS_SW_RDY		(1<<30)
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index 86b1861..54f85a1 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -148,8 +148,8 @@ intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
>  		GPIOC,
>  		GPIOD,
>  		GPIOE,
> -		0,
>  		GPIOF,
> +		0,
>  	};
>  	struct i2c_algo_bit_data *algo;
>  
> @@ -359,8 +359,8 @@ int intel_setup_gmbus(struct drm_device *dev)
>  		"panel",
>  		"dpc",
>  		"dpb",
> -		"reserved",
>  		"dpd",
> +		"reserved",
>  	};
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	int ret, i;
> -- 
> 1.7.7.3
> 

-- 
Daniel Vetter
Mail: daniel@...ll.ch
Mobile: +41 (0)79 365 57 48
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ