[Bug 93956] Display Port BYT-M [N2807] - Data link training fails sporadically

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Feb 3 07:08:06 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=93956

--- Comment #4 from Zoran Stojsavljevic <zoran.stojsavljevic at intel.com> ---
Hello Jim,

I would write this code differently:

482         struct drm_i915_private *dev_priv = bus->dev_priv;
483 --      int i = 0, inc, try = 0;
483 ++      int i = 0, inc = 1, try = 0;
484         int ret = 0;
485 
486         intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
487         mutex_lock(&dev_priv->gmbus_mutex);
488 
489         if (bus->force_bit) {
490                 ret = i2c_bit_algo.master_xfer(adapter, msgs, num);
491                 goto out;
492         }
493 
494 retry:
495         I915_WRITE(GMBUS0, bus->reg0);
496 
497         for (; i < num; i += inc) {
498 --              inc = 1;
499                 if (gmbus_is_index_read(msgs, i, num)) {
500                         ret = gmbus_xfer_index_read(dev_priv, &msgs[i]);
501                         inc = 2; /* an index read is two msgs */
502                 } else if (msgs[i].flags & I2C_M_RD) {
503                         ret = gmbus_xfer_read(dev_priv, &msgs[i], 0);
504                 } else {
505                         ret = gmbus_xfer_write(dev_priv, &msgs[i]);
506                 }
507 
508                 if (ret == -ETIMEDOUT)
509                         goto timeout;
510                 if (ret == -ENXIO)
511                         goto clear_err;
512 
513                 ret = gmbus_wait_hw_status(dev_priv, GMBUS_HW_WAIT_PHASE,
514                                            GMBUS_HW_WAIT_EN);
515                 if (ret == -ENXIO)
516                         goto clear_err;
517                 if (ret)
518                         goto timeout;
519         }

Since you can be potentially stuck in:
497         for (; i < num; i += inc) {

forever.

Thank you,
Zoran

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20160203/bb8fdad3/attachment-0001.html>


More information about the intel-gfx-bugs mailing list