All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Cory Maccarrone <darkstar6262@gmail.com>
Cc: linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, Rajendra Nayak <rnayak@ti.com>,
	Jouni Hogander <jouni.hogander@nokia.com>,
	Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Jon Hunter <jon-hunter@ti.com>, Hu Tao <taohu@motorola.com>,
	Xiaolong Chen <A21785@motorola.com>
Subject: Re: [PATCH] [I2C] OMAP: Don't write IE state in unidle if 0
Date: Mon, 28 Dec 2009 12:19:41 -0800	[thread overview]
Message-ID: <20091228201941.GO3512@atomide.com> (raw)
In-Reply-To: <1261530373-408-1-git-send-email-darkstar6262@gmail.com>

* Cory Maccarrone <darkstar6262@gmail.com> [091222 17:05]:
> Commit ef871432... (i2c-omap: OMAP3: PM: (re)init for every transfer
> to support off-mode) introduced a change which make the dev->iestate
> contents be written to the OMAP_I2C_IE_REG every time omap_i2c_unidle
> is called.  Previously, the state was only written if it wasn't equal
> to zero.
> 
> In omap_i2c_probe, omap_i2c_unidle() is called prior to omap_i2c_init(),
> in which case dev->iestate has not yet been initialized and will be set
> to zero.  Having this value written to the registers causes deadlock
> while booting.
> 
> As such, this change restores the original functionality.

Looks like initializing dev->iestate to something before calling
omap_i2c_unidle in omap_i2c_probe is not an option in this case.
We'd want to initialize it to zero, which causes the deadlock..

Acked-by: Tony Lindgren <tony@atomide.com>


> 
> Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
> ---
>  drivers/i2c/busses/i2c-omap.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 3440d88..c0bb9eb 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -248,7 +248,13 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
>  		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
>  	}
>  	dev->idle = 0;
> -	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> +
> +	/*
> +	 * Don't write to this register if the IE state is 0 as it can
> +	 * cause deadlock.
> +	 */
> +	if (dev->iestate)
> +		omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
>  }
>  
>  static void omap_i2c_idle(struct omap_i2c_dev *dev)
> -- 
> 1.6.3.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2009-12-28 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23  1:06 [PATCH] [I2C] OMAP: Don't write IE state in unidle if 0 Cory Maccarrone
2009-12-28 20:19 ` Tony Lindgren [this message]

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=20091228201941.GO3512@atomide.com \
    --to=tony@atomide.com \
    --cc=A21785@motorola.com \
    --cc=aaro.koskinen@nokia.com \
    --cc=ben-linux@fluff.org \
    --cc=darkstar6262@gmail.com \
    --cc=j-pakaravoor@ti.com \
    --cc=jon-hunter@ti.com \
    --cc=jouni.hogander@nokia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    --cc=taohu@motorola.com \
    /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.