From: <harald@ccbib.org>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: <rtc-linux@googlegroups.com>, Wolfram Sang <wsa@the-dreams.de>,
Wim Van Sebroeck <wim@iguana.be>,
<linux-watchdog@vger.kernel.org>
Subject: Re: [rtc-linux] [PATCH] watchdog: stmp3xxx: Implement GETBOOTSTATUS
Date: Thu, 01 Oct 2015 19:20:32 +0200 [thread overview]
Message-ID: <c75c3f0a5a1a136bac7c882178b01815@imap.cosmopool.net> (raw)
In-Reply-To: <20150505094031.GH4276@piout.net>
Hi Alexandre,
sorry for the very long delay.
I tried your suggestion to switch the watchdog driver to regmap several
times but couldn't come up with something that wasn't either very ugly
or completely pointless - i.e. no better then passing a pointer to the
register block. See below.
On Tue, 5 May 2015 11:40:31 +0200, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> Hi,
>
> On 20/04/2015 at 09:11:02 +0200, harald@ccbib.org wrote :
>> Hi Alexandre,
>>
>> On Sun, 19 Apr 2015 17:37:43 +0200, Alexandre Belloni
>> <alexandre.belloni@free-electrons.com> wrote:
>> > On 19/04/2015 at 15:41:42 +0200, harald@ccbib.org wrote :
>> >> > - use syscon instead of passing callbacks to the watchdog driver
>> >>
>> >> I will put looking into this onto my todo list, but I'm not familiar
>> >> with syscon yet and it is not obvious to me how to port the rtc
driver
>> >> to syscon without breaking devicetree backwards compatibility. So
I'd
>> >> like to defer this for later unless somebody gives me some guidance.
>> >
>> > As the rtc driver is the one instantiating the watchdog driver, there
>> > is
>> > no reason why the DT ABI would be broken. You simply have to create
>> > the syscon in the RTC driver and then pass it to the watchdog driver,
>> > the same way it is done with the callbacks.
>>
>> Ok, this is less invasive than what I have been thinking. This makes
>> sense.
>
> I realized I confused syscon with regmap. So indeed, switching to syscon
> will require a not nice change to the DT. But what I really meant was
> creating a regmap from the rtc driver and pass it to the watchdog
> driver.
Since the rtc and watchdog drivers need different bits of the same control
register, we would need to use regmap_fields to pass them around.
Unfortunately this means we can't use the _SET and _CLR registers, which
means we need to use regmap everywhere to get proper locking. A lot of
overhead for no benefit.
After reading lots of messages around the genesis and usage of
regmap_mmio,
it seems to me the intended usecases are to fix some endianness issues
and to have a register cache available during suspend - both of which
don't
apply in this case.
If you want to get rid of the callbacks we should just pass the pointer
to the register block to the child device, I think. Which way is
preferable
is probably only a matter of taste so I won't override the driver authors
decision unless there is some clear statement that this is the preferred
style in the rtc subsystem.
I will send the other patch (unify register access macros) you asked about
shortly.
Harald
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-10-01 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 19:45 [PATCH] watchdog: stmp3xxx: Implement GETBOOTSTATUS Harald Geyer
2015-04-17 9:30 ` [rtc-linux] " Alexandre Belloni
2015-04-19 13:41 ` harald
2015-04-19 15:37 ` Alexandre Belloni
2015-04-20 7:11 ` harald
2015-05-05 9:40 ` Alexandre Belloni
2015-10-01 17:20 ` harald [this message]
2015-10-01 18:31 ` 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=c75c3f0a5a1a136bac7c882178b01815@imap.cosmopool.net \
--to=harald@ccbib.org \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=wim@iguana.be \
--cc=wsa@the-dreams.de \
/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