[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
On Wed, Mar 28, 2012 at 3:14 AM, Chris Wilson wrote: > On Wed, 28 Mar 2012 02:36:17 +0800, Daniel Kurtz > wrote: >> A common method of probing an i2c bus is trying to do a zero-length write. >> Handle this case by checking the length first before decrementing it. >> >> This is actually importan

[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Chris Wilson
On Wed, 28 Mar 2012 19:32:27 +0800, Daniel Kurtz wrote: > Unfortunately there is a bug in both my original patch (it wasn't > incrementing loop), and in your suggested cleanup (it always > decrements len, even when it is already 0... or if the loop test > fails). How about the following; despite

Re: [PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
On Wed, Mar 28, 2012 at 3:14 AM, Chris Wilson wrote: > On Wed, 28 Mar 2012 02:36:17 +0800, Daniel Kurtz wrote: >> A common method of probing an i2c bus is trying to do a zero-length write. >> Handle this case by checking the length first before decrementing it. >> >> This is actually important, s

Re: [PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Chris Wilson
On Wed, 28 Mar 2012 19:32:27 +0800, Daniel Kurtz wrote: > Unfortunately there is a bug in both my original patch (it wasn't > incrementing loop), and in your suggested cleanup (it always > decrements len, even when it is already 0... or if the loop test > fails). How about the following; despite

[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-28 Thread Daniel Kurtz
A common method of probing an i2c bus is trying to do a zero-length write. Handle this case by checking the length first before decrementing it. This is actually important, since attempting a zero-length write is one of the ways that i2cdetect and i2c_new_probed_device detect whether there is devi

[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-27 Thread Daniel Kurtz
A common method of probing an i2c bus is trying to do a zero-length write. Handle this case by checking the length first before decrementing it. This is actually important, since attempting a zero-length write is one of the ways that i2cdetect and i2c_new_probed_device detect whether there is devi

[PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-27 Thread Chris Wilson
On Wed, 28 Mar 2012 02:36:17 +0800, Daniel Kurtz wrote: > A common method of probing an i2c bus is trying to do a zero-length write. > Handle this case by checking the length first before decrementing it. > > This is actually important, since attempting a zero-length write is one > of the ways t

Re: [PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes

2012-03-27 Thread Chris Wilson
On Wed, 28 Mar 2012 02:36:17 +0800, Daniel Kurtz wrote: > A common method of probing an i2c bus is trying to do a zero-length write. > Handle this case by checking the length first before decrementing it. > > This is actually important, since attempting a zero-length write is one > of the ways th