All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
Cc: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [stable] [PATCH] i2c: fix bit algorithm timeout for low values.
Date: Tue, 5 May 2009 08:05:43 +0200	[thread overview]
Message-ID: <20090505080543.50b9e569@hyperion.delvare> (raw)
In-Reply-To: <20090504215325.GA31248-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>

Hi Greg,

On Mon, 4 May 2009 14:53:25 -0700, Greg KH wrote:
> On Fri, Apr 24, 2009 at 11:42:59AM +0200, Jean Delvare wrote:
> > Hi Dave,
> > 
> > On Fri, 24 Apr 2009 09:09:13 +1000, Dave Airlie wrote:
> > > From: Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > 
> > > When fetching DDC using i2c algo bit, we were often seeing timeouts
> > > before getting valid EDID on a retry. The VESA spec states 2ms is the
> > > DDC timeout, so when this translates into 1 jiffie and we are close
> > > to the end of the time period, it could return with a timeout less than
> > > 2ms.
> > > 
> > > Change this code to use time_after instead of time_after_eq.
> > > 
> > > Signed-off-by: Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > ---
> > >  drivers/i2c/algos/i2c-algo-bit.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
> > > index d420cc5..e25e139 100644
> > > --- a/drivers/i2c/algos/i2c-algo-bit.c
> > > +++ b/drivers/i2c/algos/i2c-algo-bit.c
> > > @@ -104,7 +104,7 @@ static int sclhi(struct i2c_algo_bit_data *adap)
> > >  		 * chips may hold it low ("clock stretching") while they
> > >  		 * are processing data internally.
> > >  		 */
> > > -		if (time_after_eq(jiffies, start + adap->timeout))
> > > +		if (time_after(jiffies, start + adap->timeout))
> > >  			return -ETIMEDOUT;
> > >  		cond_resched();
> > >  	}
> > 
> > Applied, thanks. I agree this should go in stable.
> 
> I don't see this in Linus's tree anywhere, am I just missing it?

You're correct, it's not there yet, I'll push it to Linus today. Busy
busy busy.

-- 
Jean Delvare

WARNING: multiple messages have this Message-ID (diff)
From: Jean Delvare <khali@linux-fr.org>
To: Greg KH <greg@kroah.com>
Cc: stable@kernel.org, Dave Airlie <airlied@redhat.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [stable] [PATCH] i2c: fix bit algorithm timeout for low values.
Date: Tue, 5 May 2009 08:05:43 +0200	[thread overview]
Message-ID: <20090505080543.50b9e569@hyperion.delvare> (raw)
In-Reply-To: <20090504215325.GA31248@kroah.com>

Hi Greg,

On Mon, 4 May 2009 14:53:25 -0700, Greg KH wrote:
> On Fri, Apr 24, 2009 at 11:42:59AM +0200, Jean Delvare wrote:
> > Hi Dave,
> > 
> > On Fri, 24 Apr 2009 09:09:13 +1000, Dave Airlie wrote:
> > > From: Dave Airlie <airlied@redhat.com>
> > > 
> > > When fetching DDC using i2c algo bit, we were often seeing timeouts
> > > before getting valid EDID on a retry. The VESA spec states 2ms is the
> > > DDC timeout, so when this translates into 1 jiffie and we are close
> > > to the end of the time period, it could return with a timeout less than
> > > 2ms.
> > > 
> > > Change this code to use time_after instead of time_after_eq.
> > > 
> > > Signed-off-by: Dave Airlie <airlied@redhat.com>
> > > ---
> > >  drivers/i2c/algos/i2c-algo-bit.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
> > > index d420cc5..e25e139 100644
> > > --- a/drivers/i2c/algos/i2c-algo-bit.c
> > > +++ b/drivers/i2c/algos/i2c-algo-bit.c
> > > @@ -104,7 +104,7 @@ static int sclhi(struct i2c_algo_bit_data *adap)
> > >  		 * chips may hold it low ("clock stretching") while they
> > >  		 * are processing data internally.
> > >  		 */
> > > -		if (time_after_eq(jiffies, start + adap->timeout))
> > > +		if (time_after(jiffies, start + adap->timeout))
> > >  			return -ETIMEDOUT;
> > >  		cond_resched();
> > >  	}
> > 
> > Applied, thanks. I agree this should go in stable.
> 
> I don't see this in Linus's tree anywhere, am I just missing it?

You're correct, it's not there yet, I'll push it to Linus today. Busy
busy busy.

-- 
Jean Delvare

  parent reply	other threads:[~2009-05-05  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 23:09 [PATCH] i2c: fix bit algorithm timeout for low values Dave Airlie
2009-04-23 23:09 ` Dave Airlie
2009-04-24  9:42 ` Jean Delvare
     [not found]   ` <20090424114259.70f74ccd-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-05-04 21:53     ` [stable] " Greg KH
2009-05-04 21:53       ` Greg KH
     [not found]       ` <20090504215325.GA31248-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2009-05-05  6:05         ` Jean Delvare [this message]
2009-05-05  6:05           ` Jean Delvare

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=20090505080543.50b9e569@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stable-DgEjT+Ai2ygdnm+yROfE0A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.