Re: [PATCH] rtc-ds1307: Reset bogus register values on m41t00

From: Nate Case
Date: Thu Oct 30 2008 - 11:06:07 EST


On Thu, 2008-10-30 at 01:16 -0700, David Brownell wrote:
> Hmm, you're doing this also for the ds1307 -- not just m41t00.
> Do you know that the ds1307 has this same problem? We've had
> at least one recent report that it doesn't; see LKML archives
> for the discussion preceding the patch at the URL below.

I only intended for this to be for the M41T00, so thanks for catching
this mistake.

> Seems to me it would be good to do this whenever the oscillator
> gets (re)started, not just for m41t00 chips ... when the clock
> value is garbage, it can't hurt to initialize it.
>
> Also, can you rework this so it applies on top of the patch
> removing these register checks? It's in the MM tree now, and
> is archived at
>
>
> http://groups.google.com/group/rtc-linux/browse_thread/thread/96f89b3d8201dfef

Ah, I wasn't aware of this change. The main reason I submitted this
patch was to prevent the driver from bailing out due to the bogus
registers in the m41t00 case. If you're getting rid of those checks, it
makes my patch less urgent.

But, based on what you're saying, it sounds like I should rework this
patch to make a 'ds1307_reset_regs()' function that would be called both
when the registers are found to be in a bogus state (at least for the
m41t00), and also anytime we restart the oscillator for all chips?

> That rework probably won't be more than removing the last bit of
> the patch you sent. (And didn't you get a compiler warning about
> the unused "exit_bad" label?)

I didn't get this warning because with the current mainline + my patch,
exit_bad is used in two places.

Thanks for the feedback.

--
Nate Case <ncase@xxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/