linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Kenneth Heitke <kheitke@codeaurora.org>
Cc: davidb@codeaurora.org, dwalker@fifo99.com, ben-linux@fluff.org,
	tsoni@codeaurora.org, linux@arm.linux.org.uk,
	linus.walleij@stericsson.com, linux-arm-msm@vger.kernel.org,
	seth.heasley@intel.com, w.sang@pengutronix.de,
	tomoya-linux@dsn.okisemi.com, arve@android.com,
	"open list:I2C SUBSYSTEM" <linux-i2c@vger.kernel.org>,
	swetland@google.com, khali@linux-fr.org,
	open list <linux-kernel@vger.kernel.org>,
	bryanh@codeaurora.org, sdharia@codeaurora.org,
	"open list:ARM PORT" <linux-arm-kernel@lists.infradead.org>,
	guenter.roeck@ericsson.com
Subject: Re: [PATCH] i2c: QUP based bus driver for Qualcomm MSM chipsets
Date: Tue, 12 Apr 2011 05:57:34 +0100	[thread overview]
Message-ID: <20110412045733.GA21059@sirena.org.uk> (raw)
In-Reply-To: <1302573749-15647-1-git-send-email-kheitke@codeaurora.org>

On Mon, Apr 11, 2011 at 08:02:27PM -0600, Kenneth Heitke wrote:

> mini-core. The driver supports FIFO mode (for low bandwidth applications)
> and block mode (interrupt generated for each block-size data transfer).
> The driver currently does not support DMA transfers.

> +static inline void qup_i2c_pwr_disable(struct qup_i2c_dev *dev)
> +{
> +	dev_dbg(dev->dev, "%s\n", __func__);
> +
> +	if (pm_runtime_enabled(dev->dev)) {
> +		pm_runtime_mark_last_busy(dev->dev);
> +		pm_runtime_put_sync(dev->dev);
> +	} else
> +		qup_i2c_clk_disable(dev);
> +}

What happens if someone changes the pm_runtime configuration in between
a pwr_disable() and the corresponding enable?

> +static void
> +qup_issue_read(struct qup_i2c_dev *dev, struct i2c_msg *msg, int *idx,
> +		uint32_t carry_over)
> +{
> +	uint16_t addr = (msg->addr << 1) | 1;
> +	/*
> +	 * QUP limit 256 bytes per read. By HW design, 0 in the 8-bit field
> +	 * is treated as 256 byte read.
> +	 */
> +	uint16_t rd_len = ((dev->cnt == 256) ? 0 : dev->cnt);

This is a substantila incompatibility with most I2C ccontrollers i the
kernel.  Is it possible for the driver to deal with this transparently,
for example by expanding into a number of continued transfers?  If not
we should add support to the I2C core for determining transfer limits,
the 256 bytes limit is pretty low.

> +		/* HW limits Read upto 256 bytes in 1 read without stop */
> +		if (dev->msg->flags & I2C_M_RD) {
> +			qup_set_read_mode(dev, dev->cnt);
> +			if (dev->cnt > 256)
> +				dev->cnt = 256;

This definitely seems buggy - there's no error returned to the caller?

  reply	other threads:[~2011-04-12  4:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12  2:02 [PATCH] i2c: QUP based bus driver for Qualcomm MSM chipsets Kenneth Heitke
2011-04-12  4:57 ` Mark Brown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-07-23  2:47 Kenneth Heitke
     [not found] ` <1279853264-16311-1-git-send-email-kheitke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2010-07-23  7:11   ` Trilok Soni
     [not found]     ` <4C494086.5080408-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2010-07-23 18:56       ` Kenneth Heitke
     [not found]         ` <4C49E5EE.2070103-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2010-07-24 15:08           ` Trilok Soni
2010-07-26 11:05   ` srinidhi
2010-08-12  1:50     ` Kenneth Heitke
2010-08-09 13:09   ` Ben Dooks

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=20110412045733.GA21059@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=arve@android.com \
    --cc=ben-linux@fluff.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=dwalker@fifo99.com \
    --cc=guenter.roeck@ericsson.com \
    --cc=khali@linux-fr.org \
    --cc=kheitke@codeaurora.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sdharia@codeaurora.org \
    --cc=seth.heasley@intel.com \
    --cc=swetland@google.com \
    --cc=tomoya-linux@dsn.okisemi.com \
    --cc=tsoni@codeaurora.org \
    --cc=w.sang@pengutronix.de \
    /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).