public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nate Case <ncase@xes-inc.com>
To: David Brownell <david-b@pacbell.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc-ds1307: Reset bogus register values on m41t00
Date: Thu, 30 Oct 2008 15:31:31 -0500	[thread overview]
Message-ID: <1225398691.27415.170.camel@localhost.localdomain> (raw)
In-Reply-To: <200810301006.01689.david-b@pacbell.net>

On Thu, 2008-10-30 at 10:06 -0700, David Brownell wrote:
> You'r sure that the m41t00 oscillator keeps going in this odd
> state you're defending against, and it wouldn't suffice to have
> the time and date registers initialized when restarting the
> oscillator?

I'm fairly certain.  I just went back and double-checked, and here is
what happened:

1) I modified rtc-ds1307.c to not do my register resets, left in the
exit-bad-on-bogus-register case, and changed the dev_dbg() call to
dev_warn() in that case so that I could see when the driver was bailing
out.

2) Powered down board, drained supercap so that Vbat is no longer
powering the M41T00.

3) Booted into Linux, and saw the following in the boot log:

     rtc-ds1307 0-0068: bogus register: 11 00 41 09 40 e1 01
     [snip]
     drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

   Already to me this shows the problem.  The driver bailed out,
   but I never see the "SET TIME!" message that would have been
   shown if the driver detected that the oscillator was not running
   and started it manually.
 
4) Just to be sure, I ran some checks once I booted up:

   # Shows that the 'seconds' register is incrementing as expected,
   # indicating that the oscillator is running.
   $ i2cget -f -y 0 0x68 0 b ; sleep 10 ; i2cget -f -y 0 0x68 0 b
   0x31
   0x41

   # Shows that a bogus value is present in the 'months' register
   $ i2cget -f -y 0 0x68 5 b
   0xe1

We use this chip on a lot of different boards here, and I've seen the
problem on multiple designs/platforms ever since we made the switch from
the old m41t00 driver to rtc-ds1307.

It could be that the boot loader is doing something to get the chip into
this state, but FWIW I've seen this happen with 2 or 3 different boot
loaders.

I'll go ahead and re-spin the patch.

-- 
Nate Case <ncase@xes-inc.com>


  reply	other threads:[~2008-10-30 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 17:29 [PATCH] rtc-ds1307: Reset bogus register values on m41t00 Nate Case
2008-10-30  8:16 ` David Brownell
2008-10-30 15:05   ` Nate Case
2008-10-30 17:06     ` David Brownell
2008-10-30 20:31       ` Nate Case [this message]
2008-10-30 21:34         ` Nate Case
2008-10-30 22:11           ` David Brownell

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=1225398691.27415.170.camel@localhost.localdomain \
    --to=ncase@xes-inc.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@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