Linux RTC
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>,
	Steve Twiss <stwiss.opensource@diasemi.com>
Cc: rtc-linux@googlegroups.com,
	Alessandro Zummo <a.zummo@towertech.it>,
	Support Opensource <support.opensource@diasemi.com>
Subject: Re: [rtc-linux] Re: [PATCH] rtc-da9063: avoid writing undefined data to rtc
Date: Fri, 27 Nov 2015 16:57:29 +0100	[thread overview]
Message-ID: <20151127155729.GB22136@piout.net> (raw)
In-Reply-To: <ly1tbbea3m.fsf@ensc-virt.intern.sigma-chemnitz.de>

On 27/11/2015 at 16:27:25 +0100, Enrico Scholz wrote :
> > Unfortunately, the datasheets are behind a register wall and I can't
> > check. Is there any meaningful bits mixed in the date/time registers?
> 
> We can set "RTC_EN and CRYSTAL writing disabled" (COUNT_Y[6]) randomly;
> this bit has a different meaning for read ("RTC clock okay") and write
> ("disable writing"; not clearable).
> 
> ALARM_MO[4] "Period of the Tick (0: every second, 1: every minute)" or
> ALARM_Y[7+6] (enable tick/alarm) should not be set randomly either.
> 
> 
> I think, it is always a bad idea to write random data from stack to a
> device.
> 

I agree.

> 
> > I think this was intended to keep those bits to their previous value but
> > this is not yet implemented.
> 
> Datasheet does not say how to deal with "reserved" bits; but it would be
> imo overkill to apply a regmap_update_bits() like access to the RTC
> registers.
> 

It depends on how much you care about those bits across reboots.

I'll take your patch anyway, unless Steve has another opinion on that.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2015-11-27 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 12:02 [rtc-linux] [PATCH] rtc-da9063: avoid writing undefined data to rtc Enrico Scholz
2015-11-27 15:01 ` [rtc-linux] " Alexandre Belloni
2015-11-27 15:27   ` Enrico Scholz
2015-11-27 15:57     ` Alexandre Belloni [this message]
2015-11-30  2:47       ` Opensource [Steve Twiss]
2015-11-30 14:32       ` Opensource [Steve Twiss]
2015-11-30 19:07 ` Alexandre Belloni

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=20151127155729.GB22136@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=rtc-linux@googlegroups.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=support.opensource@diasemi.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