<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 20, 2015 at 12:55 PM, Gary Buhrmaster <span dir="ltr"><<a href="mailto:gary.buhrmaster@gmail.com" target="_blank">gary.buhrmaster@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Jun 20, 2015 at 4:23 PM, Joseph Fry <<a href="mailto:joe@thefrys.com">joe@thefrys.com</a>> wrote:<br>
.....<br>
<span class="">> In the function description you see that it says it returns a negative error<br>
> number, or the number of bytes written. If you look at the actual return<br>
> statement, it's returning the count (or the error from i2c_transfer).<br>
><br>
> I think I need to patch lirc_zilog:<br>
><br>
> for (i = 0; i < 10; i++) {<br>
> ret = i2c_master_send(tx->c, buf, 1);<br>
> - if (ret == 1)<br>
> + if (ret > 0)<br>
> break;<br>
> udelay(100);<br>
> }<br>
><br>
> Can anyone confirm my conclusion? My programming skills are limited to<br>
> scripts... so this is new territory for me.<br>
<br>
</span>Since the return is the count, and you only send 1 character,<br>
a "successful" send would be the count passed in, or 1.<br>
<br>
So, while you may be on the right track, this does not seem<br>
to be the bug you are looking for (and btw, if you write <n><br>
bytes, if the return is not <n>, you need to handle the short<br>
write case in some form, as the code immediately above<br>
does for a return not equal to the 2 case.).</blockquote><div><br></div><div>I just tested this... and indeed your right. I added in some debug output and see that the pause is occuring after the "sent code..." message. And I was able to confirm that i2c_master_send is returning 1 every time.</div><div><br></div><div>so... time to keep digging. </div></div></div></div>