[U-Boot] cmd_date.c error or itention?

Wolfgang Denk wd at denx.de
Mon Jul 5 16:44:10 CEST 2010


Dear Reinhard Meyer,

In message <4C31ED2B.1020707 at emk-elektronik.de> you wrote:
>
> As well as there is a difference between read error and file not found,
> there well might be a difference in clock nonfunctional and time invalid...

Indeed.

> But alas, I will make rtc_get not return an error and zero out the tm
> structure instead when the driver KNOWS the date is not correct.

Why would you do that?  This prevents anybody trying to track down
problems from seeing what is really going on.  When you retrun the
real (incorrect) data, I can see if the attempt to set the date shows
any affect at all - with your method I don't see anything at all.

Did you read my argumentation why I rejected anatolij's patch to "fix"
unaligned bus accesses on the 5200/512x in the "md" command?  That's
the same here.

Do not hush up errors.  Let the user see what is really going on.

If I can see a bogus date but repeated calls show increments in the
seconds register this is much, much more useful than seing zero
values.

> And btw. a low voltage status error from the clock does not necessaryly
> mean the clock cannot be set again, that status (and thats exactly what
> I intended to return) just could mean that the backup voltage was too low
> during a system unpowered time to guarantee a proper date but since
> (in our case) the backup power comes from a GoldCap a new set of the
> clock would heal that status.

This may be the case with your RTC and on your board. Other hardware
may behave differently. I just tried to come up with an example.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If I can have honesty, it's easier to overlook mistakes.
	-- Kirk, "Space Seed", stardate 3141.9


More information about the U-Boot mailing list