public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Shubhrajyoti <shubhrajyoti@ti.com>
Cc: balbi@ti.com, Kevin Hilman <khilman@ti.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	NeilBrown <neilb@suse.de>, Russ Dill <russ.dill@gmail.com>
Subject: Re: debug needed: twl4030 RTC wakeups: repeated attempts fail on Beagle
Date: Thu, 23 Aug 2012 14:33:19 +0300	[thread overview]
Message-ID: <20120823113317.GK30710@arwen.pp.htv.fi> (raw)
In-Reply-To: <50361245.1040504@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2378 bytes --]

On Thu, Aug 23, 2012 at 04:51:41PM +0530, Shubhrajyoti wrote:
> On Thursday 23 August 2012 12:12 AM, Felipe Balbi wrote:
> >> >  	if (_dev->flags & OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
> >> >  		omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, 0);
> >> > @@ -1266,6 +1267,15 @@ static int omap_i2c_runtime_resume(struct device *dev)
> >> >  		omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
> >> >  	}
> >> > 
> >> > +	while (!(omap_i2c_read_reg(_dev, OMAP_I2C_SYSS_REG) &
> >> > +			SYSS_RESETDONE_MASK)) {
> >> > +		if (time_after(jiffies, timeout)) {
> >> > +			dev_warn(dev, "timeout waiting for controller reset\n");
> >> > +				return -ETIMEDOUT;
> >> > +		}
> >> > +		msleep(1);
> >> > +	}
> >> > +
> >> >  	/*
> >> >  	 * Don't write to this register if the IE state is 0 as it can
> >> >  	 * cause deadlock.
> > That's weird. i2c has SYSS_HAS_RESET_STATUS set, so hwmod framework
> > should be checking that for us. And, in fact, SYSS_HAS_RESET_STATUS is
> > set on all *data.c files.
> Felipe just like writing to sysc reset.
> 
> writing
> 
> omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, 0);
> 
> [...]
> 
> omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
> 
> is also a reset() and the hwmod is not aware of that.
> 
> 1.Hardware reset: A system bus reset (PIRSTNA = 0).
>  A device reset causes the system bus reset.
> 
> 2. Software reset: A software reset by setting the
> 	SRST bit in the I2C_SYSC register. This bit has exactly the same
> 	action on the module logic as the system bus reset. 
> 
> 3.  Partial reset or controller reset. The I2C_EN bit in the I2C_CON
> 	register can also reset a part of the I^2 C module. When
> 	the system bus reset is removed (PIRSTNA  = 1), I2C_EN = 0 keeps the
> 	functional part of I^2 C module in reset state and all
> 	configuration registers can be accessed.
> 
> 
> Since the case 3 is true in my case I am checking and hwmod is not aware
> of this.
> 
> This read-only bit indicates the state of the reset in case of hardware
> reset, global software reset (I2C_SYSC.SRST) or partial software reset
> (I2C_CON.I2C_EN).
> 
> I am checking for case 3.

aha, ok. Very nice finding :-) I wasn't aware of that. Maybe that's all
we need then ?? But why only on a few boards ? probably some
timing-related behavior, who knows ;-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2012-08-23 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 18:49 debug needed: twl4030 RTC wakeups: repeated attempts fail on Beagle Kevin Hilman
2012-08-10 22:27 ` NeilBrown
2012-08-13 18:24   ` Kevin Hilman
2012-08-22 15:06 ` Datta, Shubhrajyoti
2012-08-22 18:42   ` Felipe Balbi
2012-08-23 11:21     ` Shubhrajyoti
2012-08-23 11:33       ` Felipe Balbi [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=20120823113317.GK30710@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=russ.dill@gmail.com \
    --cc=shubhrajyoti@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox