RE: [Patch V7] i2c: imx: add runtime pm support to improve the performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Uwe Kleine-König <mailto:u.kleine-koenig@xxxxxxxxxxxxxx> Sent: Friday, September 18, 2015 4:14 PM
> To: Gao Pan-B54642
> Cc: wsa@xxxxxxxxxxxxx; Li Frank-B20596; Duan Fugang-B38611; linux-
> i2c@xxxxxxxxxxxxxxx; kernel@xxxxxxxxxxxxxx; hkallweit1@xxxxxxxxx
> Subject: Re: [Patch V7] i2c: imx: add runtime pm support to improve the
> performance
> 
> Hello,
> 
> On Wed, Sep 09, 2015 at 10:12:19AM +0800, Gao Pan wrote:
> >  static irqreturn_t i2c_imx_isr(int irq, void *dev_id) @@ -894,6
> > +893,10 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
> >
> >  	dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
> >
> > +	result = pm_runtime_get_sync(i2c_imx->adapter.dev.parent);
> > +	if (result < 0)
> > +		goto out;
> > +
> >  	/* Start I2C transfer */
> >  	result = i2c_imx_start(i2c_imx);
> >  	if (result)
> > @@ -950,6 +953,10 @@ fail0:
> >  	/* Stop I2C transfer */
> >  	i2c_imx_stop(i2c_imx);
> >
> > +out:
> > +	pm_runtime_mark_last_busy(i2c_imx->adapter.dev.parent);
> > +	pm_runtime_put_autosuspend(i2c_imx->adapter.dev.parent);
> > +
> 
> I doubt that it's correct to call these two functions if
> pm_runtime_get_sync failed. Shouldn't the out label be after the two
> calls?
 
Thanks, will change it in next version.
 
> Other than that I assume you tested your patch with and without CONFIG_PM?

Thanks, I have tested the patch. The function is ok without CONFIG_PM.
The patch uses clk_prepare_enable in the probe. Even if CONFIG_PM is disabled, it still can work.
 
> Best regards
> Uwe
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-König
> |
> Industrial Linux Solutions                 | http://www.pengutronix.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux