linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: khali@linux-fr.org, xyzzy@speakeasy.org, i2c@lm-sensors.org,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH] i2c: Renesas Highlander FPGA SMBus support, v2.
Date: Wed, 06 Aug 2008 02:42:33 +0000	[thread overview]
Message-ID: <20080806024233.GB581@linux-sh.org> (raw)
In-Reply-To: <20080805143751.3c98b1ac.akpm@linux-foundation.org>

On Tue, Aug 05, 2008 at 02:37:51PM -0700, Andrew Morton wrote:
> On Thu, 31 Jul 2008 19:43:54 +0900
> Paul Mundt <lethal@linux-sh.org> wrote:
> > +	/*
> > +	 * The R0P7780LC0011RL FPGA needs a significant delay between
> > +	 * data read cycles, otherwise the transciever gets confused and
> > +	 * garbage is returned when the read is subsequently aborted.
> > +	 *
> > +	 * It is not sufficient to wait for BBSY.
> > +	 *
> > +	 * While this generally only applies to the older SH7780-based
> > +	 * Highlanders, the same issue can be observed on SH7785 ones,
> > +	 * albeit less frequently. SH7780-based Highlanders may need
> > +	 * this to be as high as 1000 ms.
> > +	 */
> > +	if (iic_read_delay && time_before(jiffies, dev->last_read_time +
> > +				 msecs_to_jiffies(iic_read_delay)))
> > +		msleep_interruptible(jiffies_to_msecs((dev->last_read_time +
> > +				msecs_to_jiffies(iic_read_delay)) - jiffies));
> 
> If this task has signal_pending(), msleep_interruptible() will
> immediately return.
> 
> > +	cnt = (dev->buf_len + 1) >> 1;
> > +	for (i = 0; i < cnt; i++) {
> > +		data[i] = ioread16(dev->base + SMTRDR + (i * sizeof(u16)));
> > +		dev_dbg(dev->dev, "read data[%x] 0x%04x\n", i, data[i]);
> > +	}
> > +
> > +	smbus_read_data(data, dev->buf, dev->buf_len);
> > +
> > +	dev->last_read_time = jiffies;
> 
> In which case I assume that the above will screw up.
> 
Ah, right. Yes, that should be switched to msleep instead. Feel free to
drop the _interruptible part from the patch, or I can send an update if
you prefer.

  reply	other threads:[~2008-08-06  2:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25  6:32 [PATCH] i2c: Renesas Highlander FPGA SMBus support Paul Mundt
2008-04-23 11:41 ` Jean Delvare
2008-04-23 18:11   ` Manuel Lauss
2008-04-23 18:31     ` Jean Delvare
2008-04-25  1:30       ` Paul Mundt
2008-04-25  6:12         ` Andrew Morton
2008-04-25  6:22           ` Paul Mundt
2008-04-25 10:03             ` Jean Delvare
2008-04-25  9:38 ` Jean Delvare
     [not found]   ` <20080425113835.5c212918-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-26  7:26     ` [i2c] " Trent Piepho
2008-07-31 10:43 ` [PATCH] i2c: Renesas Highlander FPGA SMBus support, v2 Paul Mundt
2008-08-05 21:37   ` Andrew Morton
2008-08-06  2:42     ` Paul Mundt [this message]
2008-08-06  3:41       ` Andrew Morton
2008-08-08  7:15         ` Paul Mundt
2008-08-10 14:29   ` Jean Delvare
2008-08-10 14:50     ` Paul Mundt
2008-08-10 15:13       ` Jean Delvare
2008-08-10 15:31         ` Paul Mundt

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=20080806024233.GB581@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=akpm@linux-foundation.org \
    --cc=i2c@lm-sensors.org \
    --cc=khali@linux-fr.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=xyzzy@speakeasy.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).