diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-03-07 10:56:57 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-03-11 03:23:28 -0500 |
commit | 0bbca274a31c2366414d8d3f95e03d1c4674d93f (patch) | |
tree | afe4fe667610d628afd23905c5ecfb236f7ee846 /drivers/gpu | |
parent | 2f791908a70e95768596f5bb9e6de4f441d7bf13 (diff) |
drm/i915: Actually retry with bit-banging after GMBUS timeout
After the GMBUS transfer times out, we set force_bit=1 and
return -EAGAIN expecting the i2c core to call the .master_xfer
hook again so that we will retry the same transfer via bit-banging.
This is in case the gmbus hardware is somehow faulty.
Unfortunately we left adapter->retries to 0, meaning the i2c core
didn't actually do the retry. Let's tell the core we want one retry
when we return -EAGAIN.
Note that i2c-algo-bit also uses this retry count for some internal
retries, so we'll end up increasing those a bit as well.
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: drm-intel-fixes@lists.freedesktop.org
Fixes: bffce907d640 ("drm/i915: abstract i2c bit banging fallback in gmbus xfer")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1457366220-29409-2-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 8b1f165a4a8f64c28cf42d10e1f4d3b451dedc51)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_i2c.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index deb8282c26d8..52fbe530fc9e 100644 --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c | |||
@@ -664,6 +664,12 @@ int intel_setup_gmbus(struct drm_device *dev) | |||
664 | 664 | ||
665 | bus->adapter.algo = &gmbus_algorithm; | 665 | bus->adapter.algo = &gmbus_algorithm; |
666 | 666 | ||
667 | /* | ||
668 | * We wish to retry with bit banging | ||
669 | * after a timed out GMBUS attempt. | ||
670 | */ | ||
671 | bus->adapter.retries = 1; | ||
672 | |||
667 | /* By default use a conservative clock rate */ | 673 | /* By default use a conservative clock rate */ |
668 | bus->reg0 = pin | GMBUS_RATE_100KHZ; | 674 | bus->reg0 = pin | GMBUS_RATE_100KHZ; |
669 | 675 | ||