From patchwork Tue Feb 14 10:53:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2FsdGVyIENoYW5nICjlvLXntq3lk7Ip?= X-Patchwork-Id: 56866 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2901745wrn; Tue, 14 Feb 2023 03:05:56 -0800 (PST) X-Google-Smtp-Source: AK7set+cCA/B9khBl3nds5TUiMggWZneLlgl3k4DTNnjePrrx+VSi2mozwG9oW9x0KPNT2g90s2u X-Received: by 2002:a50:bae7:0:b0:499:d1ca:6d83 with SMTP id x94-20020a50bae7000000b00499d1ca6d83mr1955054ede.2.1676372756089; Tue, 14 Feb 2023 03:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676372756; cv=none; d=google.com; s=arc-20160816; b=TMm0pkeUgtgrKr1NibeYAsdcTCimoVCEJbJdfCg+Jw0dc2KB2Vm/wgs0qm6gmIkHYj OEN1OF+qXucKV06eaoFopwHxVfhDZQpxj4EDMxmRy3TxWK+RjqZbHoASrXw14eAQM4cL TLZfMK4+i9P/1KPE/UUmo2PO2sLX2tFpVytkU88ajF6Hr96fdL2l1MsUP88zRhg/gd7m rqS1CbUWdYFoKZFePhTpBvQ80fFMtNOQcYBNbj4IA5+dWoELbEf+SlHc5xBMWrDtEqAV 3OFJzBlSLgqEVLWuA4We3P60dIMt00W7oFEFWEisCkzVwSqZT7g1Z5kVcMSgHUqy6jpX X+gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kV0J1/FM+1iF9G81TOXk0JsrKpONZFmg5K8V55ImZCc=; b=ov4IqtFwL5Y9q/SRwpFbqytiljLWs+UzpTVe6ivYjTw9s2fxA2RDehwnxXQ4YDd+CA rbhlmJyLaVWKE5mK5qJVwAxRAkDpOutq0kaG9QCbqgKZSuitKMGgAG/e5AxSfp88IKne V58pJmGgp3aDxKPGdAEUpcw+R9fbtx7+F+aMBhGrlsa/zJr1jk5olPx+Qle/42ZHAg6s 2v3NqzUbQb4XUP4YOmRcnmqHAJLVrpYGF3xkP6zItuwKEhKe6lLFr53JEwZrWihRbF+W SUe6ymDQDmi+U5x1Or5MMlxunBrFTYeySNuhgC3kewi6e85ctre/Yyby2cEqmjhIR2WI Yoqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RepwRWiB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a170906001800b008b13495ef93si566791eja.988.2023.02.14.03.05.33; Tue, 14 Feb 2023 03:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RepwRWiB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbjBNK4a (ORCPT + 99 others); Tue, 14 Feb 2023 05:56:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjBNK42 (ORCPT ); Tue, 14 Feb 2023 05:56:28 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E36259F6 for ; Tue, 14 Feb 2023 02:56:27 -0800 (PST) X-UUID: 3895816eac5611eda06fc9ecc4dadd91-20230214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=kV0J1/FM+1iF9G81TOXk0JsrKpONZFmg5K8V55ImZCc=; b=RepwRWiBWI6i45+6C6PeDRP2m9i89Gvrf4GAjBk7ITvuyiHJhnn7uo/GX2L+EtjH3dkjXElft8jVadvf0YaoO80vR7HBUheCOuue6MoqIJB10eqA9apn3dTofTzgcvmwGnW8LOdcSJjFHzVVg2+snTWLhH5xotb4J+7AqtTc1RY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:18e0cb29-2856-447f-b843-7efa5073caf2,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:100 X-CID-INFO: VERSION:1.1.19,REQID:18e0cb29-2856-447f-b843-7efa5073caf2,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:100 X-CID-META: VersionHash:885ddb2,CLOUDID:5cbb69b0-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:23021418562454WU8JHL,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 3895816eac5611eda06fc9ecc4dadd91-20230214 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1501535501; Tue, 14 Feb 2023 18:56:23 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Tue, 14 Feb 2023 18:56:22 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 14 Feb 2023 18:56:22 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz , "Krzysztof Kozlowski" CC: , , , , Chun-Hung Wu , , , Subject: [PATCH v2 1/4] time/sched_clock: Export sched_clock_register() Date: Tue, 14 Feb 2023 18:53:11 +0800 Message-ID: <20230214105412.5856-2-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230214105412.5856-1-walter.chang@mediatek.com> References: <20230214105412.5856-1-walter.chang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757804239445455042?= X-GMAIL-MSGID: =?utf-8?q?1757804239445455042?= From: Chun-Hung Wu clocksource driver may use sched_clock_register() to resigter itself as a sched_clock source. Export it to support building such driver as module, like timer-mediatek.c Signed-off-by: Chun-Hung Wu --- kernel/time/sched_clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 8464c5acc913..8e49e87d1221 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -150,8 +150,7 @@ static enum hrtimer_restart sched_clock_poll(struct hrtimer *hrt) return HRTIMER_RESTART; } -void __init -sched_clock_register(u64 (*read)(void), int bits, unsigned long rate) +void sched_clock_register(u64 (*read)(void), int bits, unsigned long rate) { u64 res, wrap, new_mask, new_epoch, cyc, ns; u32 new_mult, new_shift; @@ -223,6 +222,7 @@ sched_clock_register(u64 (*read)(void), int bits, unsigned long rate) pr_debug("Registered %pS as sched_clock source\n", read); } +EXPORT_SYMBOL_GPL(sched_clock_register); void __init generic_sched_clock_init(void) { From patchwork Tue Feb 14 10:53:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2FsdGVyIENoYW5nICjlvLXntq3lk7Ip?= X-Patchwork-Id: 56864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2901150wrn; Tue, 14 Feb 2023 03:04:48 -0800 (PST) X-Google-Smtp-Source: AK7set/tsSpxmfHgOHdrdWINv2FKODgaMno46HfTV7WMHoaI/2m/F0bFvqyVSr0lMDcFQkf3J5Sd X-Received: by 2002:a17:906:3510:b0:8b1:2e7c:df58 with SMTP id r16-20020a170906351000b008b12e7cdf58mr1697157eja.73.1676372686947; Tue, 14 Feb 2023 03:04:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676372686; cv=none; d=google.com; s=arc-20160816; b=nNdNyR60BMHHfxeOp/NJRw44Cf//PoeVk6SwFW4gXMLxMGGMZoyCeyqAcikCERYtXd CDO3soy8816l3he5flCdeXeVmhK8ELNixOs5+KAvcwXkY5UxsaKHxd6VcQwLWKv0S6LP 4PiexcGLDz14qozLZBwAfDN0fIZDWvJEdOYPreMkTD+2NbKjGlhoupjUzWkA5kiQgmxp V5+RI43XgGh3YaQsi0xiZ/Q3H7YdpczNUr7dhh+HauKcyFyAswEwkX7n/jNjn6xz0KFu Jwq73fXiq4iVxhpzPSYGWlXTFaa2OWkX9aOroo01BS3LEG2FX1YU1vFb02WD1vE1cWmK D65Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=53j2Zr5g1CHI4OUeg0l8fF8afX2h7OOtLqGtKgBQpXk=; b=pAJ+Xgd/m4Fu8Fn/3I+1Mi22SEo23iwz60WQzxfD92aQ72btciSZun3MlI39sLAzPp /PI3Iwi0KCSMXvc//tv4IHP+BThxGqNjgwc6x4xTk9pzzXgGgCX2lZ3i+dhwd5ow0AM1 tCyhlb5X9zG2UZYwZCnttjk7i6aaxAWCpy02pjOD97/du7LryuHsqos21yo4lUehilZ4 pigp3yVbiNn+M1YtmJ4AuSoa62mQPUmQgys8c7A/1pruQotNpoutJS0ivBU3S0s/KMYH kpC7BqOzcuFpjBEV2MJKi2x5NOZDxaLD2B3WzZhx65EJwhQ9dnA47OdXWtqwaQiXIG1K gK8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="W62tWo/y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a17090620cb00b008b1311f85e3si1883441ejc.70.2023.02.14.03.04.23; Tue, 14 Feb 2023 03:04:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="W62tWo/y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbjBNK5d (ORCPT + 99 others); Tue, 14 Feb 2023 05:57:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjBNK5c (ORCPT ); Tue, 14 Feb 2023 05:57:32 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828A359F6 for ; Tue, 14 Feb 2023 02:57:30 -0800 (PST) X-UUID: 571bafbeac5611ed945fc101203acc17-20230214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=53j2Zr5g1CHI4OUeg0l8fF8afX2h7OOtLqGtKgBQpXk=; b=W62tWo/yU8G/rN4xWB1VWl5tJniJ0Y8IW562Q04flL1IHk+H0VnbkamOnjSyHKiajmBdRAdYbRLGVEnFC7n5EM2yz5Ev0IxuGZIWwoPWzhxbp/ltJQPTulFLNVC5r5HDTjj7z8RXjjREBTULy0KEJg2YiOm02NCl1oggUhdtItE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:f85f9659-e8b3-42f0-b9ba-497bc4a5b9c6,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:885ddb2,CLOUDID:e01d8925-564d-42d9-9875-7c868ee415ec,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 571bafbeac5611ed945fc101203acc17-20230214 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 337619719; Tue, 14 Feb 2023 18:57:14 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Tue, 14 Feb 2023 18:57:13 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 14 Feb 2023 18:57:13 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz , "Krzysztof Kozlowski" CC: , , , , Chun-Hung Wu , , , Subject: [PATCH v2 2/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Date: Tue, 14 Feb 2023 18:53:12 +0800 Message-ID: <20230214105412.5856-3-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230214105412.5856-1-walter.chang@mediatek.com> References: <20230214105412.5856-1-walter.chang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757804166937033751?= X-GMAIL-MSGID: =?utf-8?q?1757804166937033751?= From: Chun-Hung Wu Export clocksource_mmio_init() and clocksource_mmio_readl_up() to support building clocksource driver as module, such as timer-mediatek.c. Signed-off-by: Chun-Hung Wu --- drivers/clocksource/mmio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c index 9de751531831..b08b2f9d7a8b 100644 --- a/drivers/clocksource/mmio.c +++ b/drivers/clocksource/mmio.c @@ -21,6 +21,7 @@ u64 clocksource_mmio_readl_up(struct clocksource *c) { return (u64)readl_relaxed(to_mmio_clksrc(c)->reg); } +EXPORT_SYMBOL_GPL(clocksource_mmio_readl_up); u64 clocksource_mmio_readl_down(struct clocksource *c) { @@ -46,9 +47,9 @@ u64 clocksource_mmio_readw_down(struct clocksource *c) * @bits: Number of valid bits * @read: One of clocksource_mmio_read*() above */ -int __init clocksource_mmio_init(void __iomem *base, const char *name, - unsigned long hz, int rating, unsigned bits, - u64 (*read)(struct clocksource *)) +int clocksource_mmio_init(void __iomem *base, const char *name, + unsigned long hz, int rating, unsigned bits, + u64 (*read)(struct clocksource *)) { struct clocksource_mmio *cs; @@ -68,3 +69,4 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name, return clocksource_register_hz(&cs->clksrc, hz); } +EXPORT_SYMBOL_GPL(clocksource_mmio_init); From patchwork Tue Feb 14 10:53:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2FsdGVyIENoYW5nICjlvLXntq3lk7Ip?= X-Patchwork-Id: 56862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2899526wrn; Tue, 14 Feb 2023 03:02:00 -0800 (PST) X-Google-Smtp-Source: AK7set9A/ve1oJW7ZpyCZ1DYTdvP9wKSKitLttg0zgyFO3n+5105+/2B2XAtUE2ABXxjH2kzaP4I X-Received: by 2002:a17:902:c944:b0:196:191b:6b22 with SMTP id i4-20020a170902c94400b00196191b6b22mr2579835pla.59.1676372520475; Tue, 14 Feb 2023 03:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676372520; cv=none; d=google.com; s=arc-20160816; b=FSuXdgX4tVC1uSwbKIGui0YBg7hxA9T4jVpy8q2QzvrK5JG63ikqZeN9Uqkp8T6aSX 57Zg6umdgVWENTmzhgeR8477ZySyeX3D6D3YnyBSCI71THFYw3w4XPBK8PH9WADdMg92 TQ+9PoDUjoQ3136GC1CuYl+ItXB1WAmVaBPdV26hhXO5dgLURqqOR5hnqkx1/sReYi2o VdaTRas37zKrOfjx2omi/yCCb8fgDJHXOgOPpV5ii8bLqlwpeaCLJAVfmzy+o1ZZRGb7 kPy7BTMobLJZdC+kpzd9dZbZiNk/9Fyc9XfwFyAJy1Z7KJGUMxMaiDzJBmkBDPQIlpha Db5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VDM/X9Rv4Dnk0OZyDBmi3fSTCK369lUNj0HJzi93FoY=; b=HlCN29ACnPhdbBpThG7w6SNH/m07ELhvjVTDTUGgq9zPX3HKnu9iF2wJSh5iz5SakV u6d+v5GQ5LB7J8DpxTjBYBSuSrslMPxrN/IrR0GVsiEBdQeOje7+a59SmLgagJgXPV++ v9eos9BmS27nFPAGdV4+Z2JihCAJ2ERQ+TEd8kAtatgL3AGhHX8NJSNjRoAkcZdjQBQt qmQZTq+45THdxf+mQ34lf56VKPnHy6mswDXZWbQgzRE7/Tdp3IbY8eM3EvcodXb213mS nbRRCKAgMEfSYevIXq7qEzB83RaYUemUqrG8CMejbF9yTiGzwvX7EhRIAhKlPchFxtmp HKmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=R8jNUMUi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a170902b78100b0019a9d83f8d9si5550575pls.458.2023.02.14.03.01.48; Tue, 14 Feb 2023 03:02:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=R8jNUMUi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbjBNK6c (ORCPT + 99 others); Tue, 14 Feb 2023 05:58:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjBNK6a (ORCPT ); Tue, 14 Feb 2023 05:58:30 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8645E22789 for ; Tue, 14 Feb 2023 02:58:28 -0800 (PST) X-UUID: 798a1e64ac5611ed945fc101203acc17-20230214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=VDM/X9Rv4Dnk0OZyDBmi3fSTCK369lUNj0HJzi93FoY=; b=R8jNUMUirQEa5FpHn+sxhkUMBEHkni8O+0vPtmBbo7oateGQW05d4oU3r4WhaTOxFYg1OHil2j3eF8zD7ipLXY619I2kIWQ0B1Op8pS1KFzqZ49pLk9AWB2lmSvLLBo22flHkl82CzGDPj/xA5ECvCnNLIIBWRtuzvFMSFsu5eg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:05c2e37e-409b-406a-9784-cb33fc571f03,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.19,REQID:05c2e37e-409b-406a-9784-cb33fc571f03,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:885ddb2,CLOUDID:cd218925-564d-42d9-9875-7c868ee415ec,B ulkID:230214185814PHV5GKMY,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 798a1e64ac5611ed945fc101203acc17-20230214 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2048553882; Tue, 14 Feb 2023 18:58:12 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Tue, 14 Feb 2023 18:58:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 14 Feb 2023 18:58:11 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz , "Krzysztof Kozlowski" CC: , , , , Chun-Hung Wu , , , Subject: [PATCH v2 3/4] clocksource/drivers/timer-of: Remove __init markings Date: Tue, 14 Feb 2023 18:53:13 +0800 Message-ID: <20230214105412.5856-4-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230214105412.5856-1-walter.chang@mediatek.com> References: <20230214105412.5856-1-walter.chang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757803992084341783?= X-GMAIL-MSGID: =?utf-8?q?1757803992084341783?= From: Chun-Hung Wu Remove __init markings to allow timer drivers can be compiled as modules. Signed-off-by: Chun-Hung Wu --- drivers/clocksource/timer-of.c | 23 ++++++++++++----------- drivers/clocksource/timer-of.h | 6 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index c3f54d9912be..59bc5921acad 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -19,7 +19,7 @@ * * Free the irq resource */ -static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) +static void timer_of_irq_exit(struct of_timer_irq *of_irq) { struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); @@ -47,8 +47,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) * * Returns 0 on success, < 0 otherwise */ -static __init int timer_of_irq_init(struct device_node *np, - struct of_timer_irq *of_irq) +static int timer_of_irq_init(struct device_node *np, + struct of_timer_irq *of_irq) { int ret; struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); @@ -91,7 +91,7 @@ static __init int timer_of_irq_init(struct device_node *np, * * Disables and releases the refcount on the clk */ -static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) +static void timer_of_clk_exit(struct of_timer_clk *of_clk) { of_clk->rate = 0; clk_disable_unprepare(of_clk->clk); @@ -107,8 +107,8 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) * * Returns 0 on success, < 0 otherwise */ -static __init int timer_of_clk_init(struct device_node *np, - struct of_timer_clk *of_clk) +static int timer_of_clk_init(struct device_node *np, + struct of_timer_clk *of_clk) { int ret; @@ -146,13 +146,13 @@ static __init int timer_of_clk_init(struct device_node *np, goto out; } -static __init void timer_of_base_exit(struct of_timer_base *of_base) +static void timer_of_base_exit(struct of_timer_base *of_base) { iounmap(of_base->base); } -static __init int timer_of_base_init(struct device_node *np, - struct of_timer_base *of_base) +static int timer_of_base_init(struct device_node *np, + struct of_timer_base *of_base) { of_base->base = of_base->name ? of_io_request_and_map(np, of_base->index, of_base->name) : @@ -165,7 +165,7 @@ static __init int timer_of_base_init(struct device_node *np, return 0; } -int __init timer_of_init(struct device_node *np, struct timer_of *to) +int timer_of_init(struct device_node *np, struct timer_of *to) { int ret = -EINVAL; int flags = 0; @@ -209,6 +209,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) timer_of_base_exit(&to->of_base); return ret; } +EXPORT_SYMBOL_GPL(timer_of_init); /** * timer_of_cleanup - release timer_of resources @@ -217,7 +218,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) * Release the resources that has been used in timer_of_init(). * This function should be called in init error cases */ -void __init timer_of_cleanup(struct timer_of *to) +void timer_of_cleanup(struct timer_of *to) { if (to->flags & TIMER_OF_IRQ) timer_of_irq_exit(&to->of_irq); diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h index a5478f3e8589..5d1472846346 100644 --- a/drivers/clocksource/timer-of.h +++ b/drivers/clocksource/timer-of.h @@ -66,9 +66,9 @@ static inline unsigned long timer_of_period(struct timer_of *to) return to->of_clk.period; } -extern int __init timer_of_init(struct device_node *np, - struct timer_of *to); +extern int timer_of_init(struct device_node *np, + struct timer_of *to); -extern void __init timer_of_cleanup(struct timer_of *to); +extern void timer_of_cleanup(struct timer_of *to); #endif From patchwork Tue Feb 14 10:53:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2FsdGVyIENoYW5nICjlvLXntq3lk7Ip?= X-Patchwork-Id: 56863 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2900397wrn; Tue, 14 Feb 2023 03:03:26 -0800 (PST) X-Google-Smtp-Source: AK7set+z3U7iCPDVAZn+tfrd+hipuZrxJU0z6lAfjwxYuZAUpJT2OppDTi4jGN4CLD27Z6RN+IEx X-Received: by 2002:a17:906:c7c4:b0:87f:89f2:c012 with SMTP id dc4-20020a170906c7c400b0087f89f2c012mr2165608ejb.24.1676372606576; Tue, 14 Feb 2023 03:03:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676372606; cv=none; d=google.com; s=arc-20160816; b=0tNAq81NKNCn/SbYH+yE4a7MxObHmrnzHNVXFGuarhuS5Lj1uCgxO5CB/oK0UUKqcK ZPmKjydoNgV41wx3e4j925LQLRDhdbIl1GmLmdXtJ8V3OrCq8ergnm8dwVWcI6KBgU+O aOyLW/kOLxT1ZNms0+f2U5M29YupZ04VzQkHvGNoCq5eJD9fk1xUzkaMNShwDUOwZMBL 2F2619rlvUqoGpta3uIlHfvOHSz05ThDNKtg2nmn5oFIDZeMIFio544RVshYHFYMBeMS OoC3Mh8EC4poB7xurvTp+6mVI62BryL0g4GWUoM3SuCLR1cc3Qo8srq0lO22x5HmMDe/ nz0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=iRRgupLKW01XSW/nrlYdZ3P4d4sh6AvIuaQPkTFiPU4=; b=RMz88qtrn87R6m6nd6a0w0ox0MLt3T84rRJSvP4QsSRQ38kf45bswsWhVlbeAFbRo/ K1VFOdaergY0WwOJ11WntSDQpEF/IprikrSUnHUp6f1E2RQ+6WfXqq+uqiTFAsjmeLx/ d45KF4ujCo7d+iRy7n+vuD+kqRNiFV/hAL6pV6QbeqQ2ZpU9sSdgHSXxo0cN9T9fiJ6+ j7Qe3UGCjnj0T1BL3uVaDqryy/M5m9IZmeGtZQ64zFQlONcfZojUL6W+4ZPTZ/wonp/s FzGWd06v0oTuXvRGPswNVI0J6CRrS4NrQetuu80o+bowNL8eU8RxsoLmFKBmxPP8ARwI QbUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CEo+flD0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fh22-20020a1709073a9600b0089c2387faf6si19771169ejc.232.2023.02.14.03.03.03; Tue, 14 Feb 2023 03:03:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CEo+flD0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232027AbjBNK7V (ORCPT + 99 others); Tue, 14 Feb 2023 05:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjBNK7U (ORCPT ); Tue, 14 Feb 2023 05:59:20 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F539222C6 for ; Tue, 14 Feb 2023 02:59:18 -0800 (PST) X-UUID: 9e5730baac5611eda06fc9ecc4dadd91-20230214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=iRRgupLKW01XSW/nrlYdZ3P4d4sh6AvIuaQPkTFiPU4=; b=CEo+flD0xBylDqLQlczNcWwu2iU4ppNUCqR1Au/JoTtPMkhGCFV1vzKN6FpjS3RRPPxYxB/jG08FYq0Dl8mKEwZoLaqXFK+/o/vcYw2SqX4pbO3ONBRx5pG87S7BxKDKspmdNQ76w8QEkzn5+S7Y2KvRp1qWLiCVFGpTGz8CQmk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:24d4c749-52ae-4db4-a0d1-6d101ad1e99f,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.19,REQID:24d4c749-52ae-4db4-a0d1-6d101ad1e99f,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:885ddb2,CLOUDID:202bf7f2-ddba-41c3-91d9-10eeade8eac7,B ulkID:2302141859150H8WTIT6,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: 9e5730baac5611eda06fc9ecc4dadd91-20230214 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 707606000; Tue, 14 Feb 2023 18:59:14 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Tue, 14 Feb 2023 18:59:13 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 14 Feb 2023 18:59:13 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz , "Krzysztof Kozlowski" CC: , , , , Chun-Hung Wu , , , Subject: [PATCH v2 4/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Date: Tue, 14 Feb 2023 18:53:14 +0800 Message-ID: <20230214105412.5856-5-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230214105412.5856-1-walter.chang@mediatek.com> References: <20230214105412.5856-1-walter.chang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757804082499518667?= X-GMAIL-MSGID: =?utf-8?q?1757804082499518667?= From: Chun-Hung Wu Make the timer-mediatek driver which can register an always-on timer as tick_broadcast_device on MediaTek SoCs become loadable module in GKI. Signed-off-by: Chun-Hung Wu --- drivers/clocksource/Kconfig | 2 +- drivers/clocksource/timer-mediatek.c | 43 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 4469e7f555e9..41345827055b 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -472,7 +472,7 @@ config SYS_SUPPORTS_SH_CMT bool config MTK_TIMER - bool "Mediatek timer driver" if COMPILE_TEST + tristate "Mediatek timer driver" depends on HAS_IOMEM select TIMER_OF select CLKSRC_MMIO diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c index d5b29fd03ca2..3358758ea694 100644 --- a/drivers/clocksource/timer-mediatek.c +++ b/drivers/clocksource/timer-mediatek.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include #include #include "timer-of.h" @@ -450,6 +453,46 @@ static int __init mtk_gpt_init(struct device_node *node) return 0; } + +#ifdef MODULE +static int mtk_timer_probe(struct platform_device *pdev) +{ + int (*timer_init)(struct device_node *node); + struct device_node *np = pdev->dev.of_node; + + timer_init = of_device_get_match_data(&pdev->dev); + return timer_init(np); +} + +static const struct of_device_id mtk_timer_match_table[] = { + { + .compatible = "mediatek,mt6577-timer", + .data = mtk_gpt_init, + }, + { + .compatible = "mediatek,mt6765-timer", + .data = mtk_syst_init, + }, + { + .compatible = "mediatek,mt6795-systimer", + .data = mtk_cpux_init, + }, + {} +}; + +static struct platform_driver mtk_timer_driver = { + .probe = mtk_timer_probe, + .driver = { + .name = "mtk-timer", + .of_match_table = mtk_timer_match_table, + }, +}; +module_platform_driver(mtk_timer_driver); + +MODULE_DESCRIPTION("MediaTek Module Timer driver"); +MODULE_LICENSE("GPL v2"); +#else TIMER_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_gpt_init); TIMER_OF_DECLARE(mtk_mt6765, "mediatek,mt6765-timer", mtk_syst_init); TIMER_OF_DECLARE(mtk_mt6795, "mediatek,mt6795-systimer", mtk_cpux_init); +#endif