lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAfSe-t-qy3smGzMYN_uK+5fMQZeWFKvmp0FJMeVVvg2PBKkLQ@mail.gmail.com>
Date:   Fri, 2 Jul 2021 10:25:16 +0800
From:   Chunyan Zhang <zhang.lyra@...il.com>
To:     Saravana Kannan <saravanak@...gle.com>
Cc:     Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Baolin Wang <baolin.wang7@...il.com>,
        Orson Zhai <orsonzhai@...il.com>,
        Chunyan Zhang <chunyan.zhang@...soc.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] clocksource/drivers/sprd: Add module support to
 Unisoc timer

On Fri, 2 Jul 2021 at 03:18, Saravana Kannan <saravanak@...gle.com> wrote:
>
> On Thu, Jul 1, 2021 at 1:52 AM Chunyan Zhang <zhang.lyra@...il.com> wrote:
> >
> > From: Chunyan Zhang <chunyan.zhang@...soc.com>
> >
> > Timers still have devices created for them. So, when compiling a timer
> > driver as a module, implement it as a normal platform device driver.
> >
> > Original-by: Baolin Wang <baolin.wang7@...il.com>
> > Signed-off-by: Chunyan Zhang <chunyan.zhang@...soc.com>
> > ---
> >  drivers/clocksource/Kconfig      |  2 +-
> >  drivers/clocksource/timer-sprd.c | 15 +++++++++++++--
> >  2 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> > index 39aa21d01e05..9f16c2779edb 100644
> > --- a/drivers/clocksource/Kconfig
> > +++ b/drivers/clocksource/Kconfig
> > @@ -447,7 +447,7 @@ config MTK_TIMER
> >           Support for Mediatek timer driver.
> >
> >  config SPRD_TIMER
> > -       bool "Spreadtrum timer driver" if EXPERT
> > +       tristate "Spreadtrum timer driver" if EXPERT
> >         depends on HAS_IOMEM
> >         depends on (ARCH_SPRD || COMPILE_TEST)
> >         default ARCH_SPRD
> > diff --git a/drivers/clocksource/timer-sprd.c b/drivers/clocksource/timer-sprd.c
> > index 430cb99d8d79..73c7b3f8c901 100644
> > --- a/drivers/clocksource/timer-sprd.c
> > +++ b/drivers/clocksource/timer-sprd.c
> > @@ -5,6 +5,8 @@
> >
> >  #include <linux/init.h>
> >  #include <linux/interrupt.h>
> > +#include <linux/module.h>
> > +#include <linux/platform_device.h>
> >
> >  #include "timer-of.h"
> >
> > @@ -141,7 +143,7 @@ static struct timer_of to = {
> >         },
> >  };
> >
> > -static int __init sprd_timer_init(struct device_node *np)
> > +static int sprd_timer_init(struct device_node *np)
> >  {
> >         int ret;
> >
> > @@ -190,7 +192,7 @@ static struct clocksource suspend_clocksource = {
> >         .flags  = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP,
> >  };
> >
> > -static int __init sprd_suspend_timer_init(struct device_node *np)
> > +static int sprd_suspend_timer_init(struct device_node *np)
> >  {
> >         int ret;
> >
> > @@ -204,6 +206,15 @@ static int __init sprd_suspend_timer_init(struct device_node *np)
> >         return 0;
> >  }
> >
> > +#ifdef MODULE
> > +TIMER_PLATFORM_DRIVER_BEGIN(sprd_timer)
> > +TIMER_MATCH("sprd,sc9860-timer", sprd_timer_init)
> > +TIMER_MATCH("sprd,sc9860-suspend-timer", sprd_suspend_timer_init)
> > +TIMER_PLATFORM_DRIVER_END(sprd_timer);
> > +MODULE_DESCRIPTION("Unisoc broadcast timer module");
> > +MODULE_LICENSE("GPL");
> > +#else
> >  TIMER_OF_DECLARE(sc9860_timer, "sprd,sc9860-timer", sprd_timer_init);
> >  TIMER_OF_DECLARE(sc9860_persistent_timer, "sprd,sc9860-suspend-timer",
> >                  sprd_suspend_timer_init);
> > +#endif
>
> Would it be a problem if you removed the ifdef and dropped these
> TIMER_OF_DECLARE? Doesn't look like either of these timers are needed
> for the early scheduler timer.

Yes, there seems no problem indeed for now, I will drop them.

Thanks,
Chunyan

>
> -Saravana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ