From: Arnd Bergmann <arnd@arndb.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
RTCLINUX <rtc-linux@googlegroups.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] char: PC rtc: replace blacklist with whitelist
Date: Sun, 17 Apr 2016 23:37:12 +0200 [thread overview]
Message-ID: <4192558.Mh1hb3LCLb@wuerfel> (raw)
In-Reply-To: <CAMuHMdU26GkyUYxs3DJOFRB5LTdYCOaGTMUwFMd9YXYhkS1W3g@mail.gmail.com>
On Wednesday 02 March 2016 11:22:04 Geert Uytterhoeven wrote:
> On Wed, Mar 2, 2016 at 10:48 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > Every new architecture has to add itself to the growing list of those
> > that do not support the legacy PC RTC driver.
> >
> > This replaces the long list of architectures that don't support it
> > with a shorter list of those that do.
> >
> > The list is taken from those architectures that have a non-empty
> > asm/mc146818rtc.h header file and were not explicitly blacklisted.
>
> M68K was blacklisted...
I never got back to you on this topic, sorry about that. I've fixed
up the patch to leave out m68k now.
On a semi-related note, I see that m68k is one of the few architectures
still using the (other) genrtc driver. It would be nice to reduce that
list and change m68k to use its own rtc driver (ideally one per
platform), but the q40 platform is the only one providing
get_rtc_pll()/set_rtc_pll() for the RTC_PLL_GET/RTC_PLL_SET ioctl
commands.
If we do this change on top of the other m68k patch I have, the
rtc-generic driver should be usable as a full replacement for
genrtc.c on m68k and we can remove all the set_rtc_pll/get_rtc_pll
handling from genrtc.
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 773b2187210d..f4781d612c37 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -100,7 +100,32 @@ static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm)
return 0;
}
+static int rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
+{
+ struct rtc_pll_info pll;
+ struct rtc_pll_info __user *argp = (void __user *)arg;
+
+ switch (cmd) {
+ case RTC_PLL_GET:
+ if (!mach_get_rtc_pll || mach_get_rtc_pll(&pll))
+ return -EINVAL;
+ return copy_to_user(argp, &pll, sizeof pll) ? -EFAULT : 0;
+
+ case RTC_PLL_SET:
+ if (!mach_set_rtc_pll)
+ return -EINVAL;
+ if (!capable(CAP_SYS_TIME))
+ return -EACCES;
+ if (copy_from_user(&pll, argp, sizeof(pll)))
+ return -EFAULT;
+ return mach_set_rtc_pll(&pll);
+ }
+
+ return -ENOIOCTLCMD;
+}
+
static const struct rtc_class_ops generic_rtc_ops = {
+ .ioctl = rtc_ioctl,
.read_time = rtc_generic_get_time,
.set_time = rtc_generic_set_time,
};
Arnd
next prev parent reply other threads:[~2016-04-17 21:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 9:48 [PATCH 1/2] char: PC rtc: replace blacklist with whitelist Arnd Bergmann
2016-03-02 9:48 ` [PATCH 2/2] char: genrtc: " Arnd Bergmann
2016-03-02 10:03 ` Alexandre Belloni
2016-03-02 10:25 ` Geert Uytterhoeven
2016-03-02 10:03 ` [PATCH 1/2] char: PC rtc: " Alexandre Belloni
2016-03-02 10:22 ` Geert Uytterhoeven
2016-04-10 15:43 ` Alexandre Belloni
2016-04-17 16:16 ` Arnd Bergmann
2016-04-17 21:37 ` Arnd Bergmann [this message]
2016-04-18 7:09 ` Geert Uytterhoeven
2016-04-18 11:41 ` Arnd Bergmann
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=4192558.Mh1hb3LCLb@wuerfel \
--to=arnd@arndb.de \
--cc=alexandre.belloni@free-electrons.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.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