Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1239290pxb; Fri, 20 Aug 2021 00:48:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7N/SpJY7TrkaLOSYf5MTtGW1Cv6Nu6TbpZ5i9lMvxqdH4utW4DzdoYhUskoaIVIrEzBQd X-Received: by 2002:a92:cb47:: with SMTP id f7mr12988445ilq.64.1629445683097; Fri, 20 Aug 2021 00:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629445683; cv=none; d=google.com; s=arc-20160816; b=rQB5H6MXnnV6vv/EqmThbOqQFF4hzT3aAR6xJaAzMhCY8fOl7+atO73Tr4tqB4Pi/0 QtgjrhibWS4jHN0g6CPSBNH3RQwTqxcbeb+UxSVI6FKHowIEYV5T68eo+WRRNBjP7dY0 yqDvvVu1DCbR5U2Wgw4nYwbho1OrWQZgRiSEjdo1fac+LnkjxG8xfoWAruNI9qq3l9/9 HT2v2k3YhYMQF+swGqSxIEqZLjKJlUOuY8YFIPw0DRondRRc2Gf9SdYysjRiCphHGFyz OBSxAW8js7rKm94+YiRtqng8e6Mgqi/0bckL7p+Pr1Mr44V9uWyEuuO95pl/p1l5T63W 9jTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=X/2GAbppTE9OSGgG1A1OZF+8Y2MWWqsdhY6crguMTvk=; b=UOqKf++8ggOGwQ/1fmAWDbzr5r+4UjJg3IdaTi8cOqtFHjA/C8x9Rsty8oUhgMsaqj 43jy2Z9ZA9SkV8G1uxojmjAgFkYtkQlfbxr5b5/mC0fj5vf8ZmN4wnChGgXtVQcGlVUX 7Twi/spIcVH3LqT6R5xngX7r7xJow7trOcvBcTjQnUy6Eivbix87agZkTuSvRD2jEJFv szTH9GkH0FcMqQGKPMY2i4kWHxb86nYQe6qUY+EYUAh60d5duRxzr/5hZARBuFAPJwmq /r5thqC1kA02F/+RYWEQkOf2amyxEddhoxx7gg1rnYdXVX46sHExigkpBzRbaxAhELqv grRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CFe6IR04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si5921666ios.58.2021.08.20.00.47.52; Fri, 20 Aug 2021 00:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CFe6IR04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238920AbhHTHri (ORCPT + 99 others); Fri, 20 Aug 2021 03:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238664AbhHTHrh (ORCPT ); Fri, 20 Aug 2021 03:47:37 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5BFC061575 for ; Fri, 20 Aug 2021 00:47:00 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id a201-20020a1c7fd2000000b002e6d33447f9so6638452wmd.0 for ; Fri, 20 Aug 2021 00:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=X/2GAbppTE9OSGgG1A1OZF+8Y2MWWqsdhY6crguMTvk=; b=CFe6IR04cSEVT71m9OhQvtAcEVOF9HPMr0lcoCrj7+uJezaF1xBQ4Cr0vhTx1zwlDU bFub2fwS9IDgxdWr+NJKV49JCpAxKUy0rbHhw6qtKcUXWpb0xqYU2KD1hKLTIFgrZRFJ GN6pkJC88ywRlbT6e1IldahGq4Z7/H4prQkaUP/WqDmaq5fZcjbWm+Eh3b2s6aGaeL2F 4bVaOaXn0+oopjvnHyYA7WJuaex0PReqxAwRuPb+zZARaUyo/Nhr3eBVFvHE/q+RhvaZ x0KIgA7S1Hi8mpe6jZzIvE6KELkSIGMYpgVRQepBtlRjwGAXMTzSxjUATRz3BJnlcg+0 1sdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=X/2GAbppTE9OSGgG1A1OZF+8Y2MWWqsdhY6crguMTvk=; b=QOELNpjjcBQI/GdsSRqXZm3SYOLUTGiRJfGZhWD7cfAVSWD8APJYOkE5iqgW/aUad3 NVmpUpufCg5fIemJdjB5tUeBxElvXTJE6L5QgudUvmSVftPv4nYVntJTlzTFROkGOpdE vVqiwg/Wyru4ykeriHGWUlSewBj6L8CI9GN4woD3vrowhupxi2Y1jM2EYyl7+xj+SADn d5LKEkVQZUuKQ/xn/symgU+KKDVmwCvxYlzL+vH2I6XSZKmtFXfzVTFIK5b0260BTiBi HvjK8eHx/zguR83AOeO/UibVniNb4Ag8hBq7lFvZ/881bAgcHdFigEbT2NfNZS3NmnUD MzRg== X-Gm-Message-State: AOAM530aKCTdaXOu1fwAKqLAAykvkrOl0qYLIAhHLM5Refgkt08C5AdJ o2YXjBPmoQGI9x8PAD/jhwQzKt9YVCr1gYfXrpw= X-Received: by 2002:a1c:f60c:: with SMTP id w12mr2422502wmc.3.1629445618481; Fri, 20 Aug 2021 00:46:58 -0700 (PDT) MIME-Version: 1.0 References: <20210715065455.392923-1-zhang.lyra@gmail.com> <20210715065455.392923-4-zhang.lyra@gmail.com> <47dcce5a-f438-9f12-5b60-651dc5f2b92c@linaro.org> In-Reply-To: <47dcce5a-f438-9f12-5b60-651dc5f2b92c@linaro.org> From: Chunyan Zhang Date: Fri, 20 Aug 2021 15:46:22 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] clocksource/drivers/sprd: Add module support to Unisoc timer To: Daniel Lezcano Cc: Thomas Gleixner , Saravana Kannan , Baolin Wang , Orson Zhai , Chunyan Zhang , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On Sat, 14 Aug 2021 at 00:00, Daniel Lezcano wr= ote: > > On 15/07/2021 08:54, Chunyan Zhang wrote: > > From: Chunyan Zhang > > > > 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 > > Signed-off-by: Chunyan Zhang > > --- > > drivers/clocksource/Kconfig | 2 +- > > drivers/clocksource/timer-sprd.c | 15 ++++++++++----- > > 2 files changed, 11 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig > > index eb661b539a3e..a5a5b7c883ec 100644 > > --- a/drivers/clocksource/Kconfig > > +++ b/drivers/clocksource/Kconfig > > @@ -461,7 +461,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/tim= er-sprd.c > > index 430cb99d8d79..a8a7d3ea3464 100644 > > --- a/drivers/clocksource/timer-sprd.c > > +++ b/drivers/clocksource/timer-sprd.c > > @@ -5,6 +5,8 @@ > > > > #include > > #include > > +#include > > +#include > > > > #include "timer-of.h" > > > > @@ -141,7 +143,7 @@ static struct timer_of to =3D { > > }, > > }; > > > > -static int __init sprd_timer_init(struct device_node *np) > > +static int sprd_timer_init(struct device_node *np) > > Does the __init annotation really need to be removed ? Yes, since sprd_timer_init() would be invoked by platform_timer_probe() which seems not able to be marked as __init. > > > { > > int ret; > > > > @@ -190,7 +192,7 @@ static struct clocksource suspend_clocksource =3D { > > .flags =3D CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NON= STOP, > > }; > > > > -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,9 @@ static int __init sprd_suspend_timer_init(struct de= vice_node *np) > > return 0; > > } > > > > -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); > > +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); > > Please replace the above by something like: > > TIMER_PLATFORM_DECLARE(sc9860_timer, > "sprd,sc9860-timer", > sprd_timer_init); > > TIMER_PLATFORM_DECLARE(sc9860_persistent_timer, > "sprd,sc9860-suspend-timer", > sprd_suspend_timer_init); > > Without TIMER_PLATFORM_DRIVER_BEGIN/END, and if possible the > MODULE_DESCRIPTION/LICENSE in the TIMER_PLATFORM_DECLARE macro itself. > The module description could be the first argument of the timer platform > declaration. I hope I got your point, will address this in the next version. Let's see if changes are what you want then. Thanks for your review, Chunyan > > > +MODULE_DESCRIPTION("Unisoc broadcast timer module"); > > +MODULE_LICENSE("GPL"); > > > > -- > Linaro.org =E2=94=82 Open source software for AR= M SoCs > > Follow Linaro: Facebook | > Twitter | > Blog