linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
To: Sanford Rockowitz <rockowitz-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: ddc/ci over i2c
Date: Sun, 10 Aug 2014 21:13:59 +0200	[thread overview]
Message-ID: <20140810211359.5235156f@endymion.delvare> (raw)
In-Reply-To: <53E74487.8020809-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>

On Sun, 10 Aug 2014 03:08:07 -0700, Sanford Rockowitz wrote:
> On 08/10/2014 02:05 AM, Jean Delvare wrote:
> > I suggest that you verify that the master properly handles clock
> > stretching (to give the slave the opportunity to slow down the
> > transfer.) Or simply lower the DDC bus clock speed and see if it helps.
>
> I'm using write() and read() on /dev/i2c-n to communicate with the 
> monitor.  Is there some way to control clock stretching or DDC bus clock 
> speed from userspace?

No, it is handled by the I2C bus driver in the kernel (or i2c-algo-bit
for bit-banged buses which rely on it.) I2C bus controllers and drivers
should always handle clock stretching as it is a fundamental part of
the specification, that's not something you need to be able to switch
on and off.

> I just built a custom kernel (first time in years), with the following 
> lines in config-local:
> 
> CONFIG_I2C_DEBUG_CORE=y
> CONFIG_I2C_DEBUG_BUS=y
> CONFIG_I2C_DEBUG_ALGO=y
> 
> I was puzzling over why I wasn't seeing any output in /var/log/messages 
> when your email came in.  I would have thought I'd  be overwhelmed by 
> output.

Not all code hot paths are verbose in debug mode, most likely you're
only walking paths where no debugging takes place. Also note that
CONFIG_I2C_DEBUG_BUS only affects drivers under drivers/i2c/busses and
drivers/i2c/muxes, so I'm certain it has no effect for anything
DDC-related.

>  But when communicating with the P2411H, I do see repeated lines 
> of the form:
> 
> Aug 10 02:55:34 banner kernel: [ 5006.692794] i2c i2c-0: sendbytes: NAK 
> bailout.

That one comes from i2c-algo-bit, so your driver is using software
bit-banging, which can be unreliable if the system is under stress. The
message above is an error message, not a debug message. A "NAK" from a
slave in the middle of a write means that somehow the slave did not
like what it received. It could be that the data was out of the
expected range, or too long, inconsistent, bad CRC, whatever. But of
course it could come from some data corruption on the bus, causing the
display to receive something different from what you sent.

-- 
Jean Delvare
SUSE L3 Support

      parent reply	other threads:[~2014-08-10 19:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 10:35 ddc/ci over i2c Sanford Rockowitz
     [not found] ` <53BBC97B.5020805-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>
2014-07-08 22:20   ` Jean Delvare
     [not found]     ` <20140709002017.4c2b332e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-07-09 16:31       ` Sanford Rockowitz
     [not found]         ` <53BD6E61.8070101-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>
2014-07-28 10:52           ` Jean Delvare
     [not found]             ` <20140728125248.5bbc0f89-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-08-09 21:18               ` Sanford Rockowitz
     [not found]                 ` <53E6902B.9000104-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>
2014-08-10  9:05                   ` Jean Delvare
     [not found]                     ` <20140810110528.1b5a825f-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-08-10 10:08                       ` Sanford Rockowitz
     [not found]                         ` <53E74487.8020809-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.org>
2014-08-10 19:13                           ` Jean Delvare [this message]

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=20140810211359.5235156f@endymion.delvare \
    --to=jdelvare-l3a5bk7wagm@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rockowitz-9+fK6rGKj7RBDgjK7y7TUQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).