public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
To: Jarkko Nikula <jhnikula@gmail.com>
Cc: "khilman@deeprootsystems.com" <khilman@deeprootsystems.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/1] OMAP: I2C: Add mpu wake up latency constraint in i2c
Date: Thu, 1 Oct 2009 10:56:39 +0300	[thread overview]
Message-ID: <1254383799.22468.140.camel@ubuntu> (raw)
In-Reply-To: <20091001091040.dcc24d47.jhnikula@gmail.com>

On Thu, 2009-10-01 at 09:10 +0300, Jarkko Nikula wrote:
> Hi Kalle
> 
> Few minor comments below.
> 
> On Thu, 17 Sep 2009 19:28:43 +0300
> Kalle Jokiniemi <kalle.jokiniemi@digia.com> wrote:
> 
> > -static u32 i2c_rate[ARRAY_SIZE(i2c_resources)];
> > +static struct omap_i2c_bus_platform_data i2c_pdata[ARRAY_SIZE(i2c_resources)];
> >  static struct platform_device omap_i2c_devices[] = {
> > -	I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_rate[0]),
> > +	I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
> >  #if	defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
> > -	I2C_DEV_BUILDER(2, i2c_resources[1], &i2c_rate[1]),
> > +	I2C_DEV_BUILDER(2, i2c_resources[1], &i2c_pdata[1]),
> >  #endif
> >  #if	defined(CONFIG_ARCH_OMAP34XX)
> > -	I2C_DEV_BUILDER(3, i2c_resources[2], &i2c_rate[2]),
> > +	I2C_DEV_BUILDER(3, i2c_resources[2], &i2c_pdata[2]),
> >  #endif
> >  };
> This is good idea. IRCC, e.g. the I2C_SCL t_high and t_low timing values
> can be board dependent values so passing just the i2c_rate as a
> platform_data seems to be not enough in the future.

I gather that this t_high/t_low passing change can be added later ;)


> 
> > @@ -526,8 +529,10 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
> >  	 * REVISIT: We should abort the transfer on signals, but the bus goes
> >  	 * into arbitration and we're currently unable to recover from it.
> >  	 */
> > +	dev->set_mpu_wkup_lat(dev->dev, 1);
> >  	r = wait_for_completion_timeout(&dev->cmd_complete,
> >  					OMAP_I2C_TIMEOUT);
> > +	dev->set_mpu_wkup_lat(dev->dev, 0);
> 
> These lines here and lines below in omap_i2c_probe looks suspicious. I
> would rather allow callback to be NULL (and then you would not need
> empty function in arch/arm/plat-omap/i2c.c) and just test it here
> before executing. Looks much more safe code then.

Yes, this needs to be fixed. Otherwise we could get null pointer calls.
Nice catch.

- Kalle

> 
> > +	if (pdata != NULL) {
> > +		speed = pdata->clkrate;
> > +		dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
> > +	} else {
> > +		speed = 100;	/* Default speed */
> > +		dev->set_mpu_wkup_lat = NULL;
> > +	}
> 
> 


  reply	other threads:[~2009-10-01  7:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 16:28 [PATCH 0/1] OMAP: I2C: Add mpu wake up latency constraint Kalle Jokiniemi
2009-09-17 16:28 ` [PATCH 1/1] OMAP: I2C: Add mpu wake up latency constraint in i2c Kalle Jokiniemi
2009-09-30 16:36   ` Kevin Hilman
2009-10-01  7:44     ` Kalle Jokiniemi
2009-10-01 11:41       ` Aaro Koskinen
2009-10-02 10:59         ` Kalle Jokiniemi
2009-10-07 18:52           ` Woodruff, Richard
2009-10-09  4:50             ` Kalle Jokiniemi
2009-10-01 14:58       ` Kevin Hilman
2009-10-01  6:10   ` Jarkko Nikula
2009-10-01  7:56     ` Kalle Jokiniemi [this message]
2009-10-05 17:08   ` Pandita, Vikram
2009-10-07 10:10     ` Kalle Jokiniemi
2009-10-07 10:49       ` Nishanth Menon
     [not found]         ` <1254927643.22468.315.camel@ubuntu>
2009-10-07 15:34           ` Sonasath, Moiz

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=1254383799.22468.140.camel@ubuntu \
    --to=kalle.jokiniemi@digia.com \
    --cc=jhnikula@gmail.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.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