From: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, kernel-dev@igalia.com
Subject: Re: [PATCH 2/2] m68k: rtc: dp8570a: make it a proper RTC class driver
Date: Fri, 28 Feb 2025 09:05:48 -0300 [thread overview]
Message-ID: <Z8GmnLgCndvht-th@quatroqueijos> (raw)
In-Reply-To: <CAMuHMdW_13wOxD0Q0PVCUXBwC9y8iKXTcwH=m5tvX856S9ZU1w@mail.gmail.com>
On Thu, Feb 27, 2025 at 12:05:26PM +0100, Geert Uytterhoeven wrote:
> Hi Thadeu,
>
> On Wed, 26 Feb 2025 at 13:27, Thadeu Lima de Souza Cascardo
> <cascardo@igalia.com> wrote:
> > In the past, each rtc implementation had to rewrite the same ioctls in
> > order to be compatible. But since 2006, a common RTC interface has been
> > introduced. Use it for the last user of RTC_MINOR.
> >
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
>
> Thanks for your patch!
>
> > --- a/arch/m68k/bvme6000/rtc.c
> > +++ b/arch/m68k/bvme6000/rtc.c
>
> >
> > static int __init rtc_DP8570A_init(void)
> > {
> > + struct platform_device *pdev;
> > +
> > if (!MACH_IS_BVME6000)
> > return -ENODEV;
> >
> > pr_info("DP8570A Real Time Clock Driver v%s\n", RTC_VERSION);
> > - return misc_register(&rtc_dev);
> > +
> > + pdev = platform_device_register_data(NULL, "rtc-generic", -1,
> > + &dp8570a_rtc_ops,
> > + sizeof(dp8570a_rtc_ops));
>
> Doesn't this conflict with the creation of the same device in rtc_init()[1]?
>
I didn't look too deep and just assumed that this would be one of those
cases where this was set for machines other than BVME6000.
Ah, right, that is because of this check around it.
#if defined(CONFIG_M68KCLASSIC) || defined(CONFIG_SUN3).
But CONFIG_M68KCLASSIC is set for BVME6000.
On the other hand, mach_hwclk is accessing the same registers as the rtc.c
code, so they are redundant. One thing that is missing is
local_irq_save/local_irq_restore around it. I can add that and remove
rtc.c, which would make more sense here.
Thanks.
Cascardo.
> On BVME6000, mach_hwclk is set:
>
> arch/m68k/bvme6000/config.c: mach_hwclk = bvme6000_hwclk;
>
> > +
> > + return PTR_ERR_OR_ZERO(pdev);
> > }
> > module_init(rtc_DP8570A_init);
>
> [1] https://elixir.bootlin.com/linux/v6.13.4/source/arch/m68k/kernel/time.c#L144
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
prev parent reply other threads:[~2025-02-28 12:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 12:26 [PATCH 0/2] m68k: bvme6000: rtc: convert to rtc class Thadeu Lima de Souza Cascardo
2025-02-26 12:26 ` [PATCH 1/2] m68k: rtc: dp8570a: split read_time and set_time Thadeu Lima de Souza Cascardo
2025-02-26 12:26 ` [PATCH 2/2] m68k: rtc: dp8570a: make it a proper RTC class driver Thadeu Lima de Souza Cascardo
2025-02-27 11:05 ` Geert Uytterhoeven
2025-02-28 12:05 ` Thadeu Lima de Souza Cascardo [this message]
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=Z8GmnLgCndvht-th@quatroqueijos \
--to=cascardo@igalia.com \
--cc=alexandre.belloni@bootlin.com \
--cc=geert@linux-m68k.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-rtc@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;
as well as URLs for NNTP newsgroup(s).