From patchwork Wed Apr 19 07:49:05 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: 85238 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp194712vqo; Wed, 19 Apr 2023 00:54:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aviQJvZrQ7It3cSYXZJt8K2NSWyfpOCNCQhGTLAF7HONi8aWHi4N5F261WjZj3tfif/YUr X-Received: by 2002:a17:902:e405:b0:1a5:3319:12f7 with SMTP id m5-20020a170902e40500b001a5331912f7mr4049658ple.50.1681890869363; Wed, 19 Apr 2023 00:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890869; cv=none; d=google.com; s=arc-20160816; b=ounA8jwyEPCZ6paxTdYnaXbJdJyyTEqkC1xQW/nZfiTVon8r87NiLL501EVQkaL+6X YrF902fd5UOiMPivZjH0d/RumNteqQPS+P3tmOuaeAnrKRWlcWiRlgO+JzgtUI1su3DN hPTOtc4aM+E37y1l2t/TIVf5dqu3pLFX/sCj+T+YCfkWktYRxRt5nDuG04oylC4y3gJD GDBDpQdCV4OBoIQ0T9lAQtuHgnsYWoMu0HtuDZq5zDH2i8KPrp1FOcTgxpCx3Sa6ziH/ J3l22XCuWov/bX/jzweLSZqy4ap77vp864MowzudE73bSg1z+Hyc6pwOHXxN70sZoKfN VO8w== 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=VEn+3/YIiWPlM7x9l5Pmn7JMAt7e5uPS9Zo77KzFbZEaG0GlSapZTBZtGo+1dGHLeu 1qJb+ZpDJOnS8ARdcejCcEuA1qOjobgXx4gSjnjDuIDA/jWrcBALW8QCaaicH3ErNjQr 5quI1KK1O+fj4uW6dUCeuJvxKJCd+Yydyz0koY1AfvPAfPFgmdQQXgRVZ9rpP0aV7mpx WDlBz5X6JmH953MvHKzswD6rZlsi7KZWseaD8z5l/AiSMuyi+0MDmFfB/Kr83o4Ou9ld RjAjh+Q751f9WmqUwC2THZxBFv5VSXjiLnvqeSMtvoPKrk+tE1vHJeAjv9s7ColoGZi0 Zueg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QQSw9JL9; 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 s1-20020a170902b18100b001a6fe4a8fc3si3593757plr.373.2023.04.19.00.54.17; Wed, 19 Apr 2023 00:54:29 -0700 (PDT) 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=QQSw9JL9; 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 S232432AbjDSHtv (ORCPT + 99 others); Wed, 19 Apr 2023 03:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232457AbjDSHts (ORCPT ); Wed, 19 Apr 2023 03:49:48 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AFAC10E0 for ; Wed, 19 Apr 2023 00:49:45 -0700 (PDT) X-UUID: bcc03b52de8611eda9a90f0bb45854f4-20230419 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=QQSw9JL9NdPf0Y9tBuMgpDH3KDXX1M/N/0PqGsr9KXEEx1oAzUzfyau+zHDnGdQhJtIIRWIEIZFa3HsOorfl1ZYxNhiU8waXPyS89d/pTM2sVbpY1PW9dAk5gfEmUmexNjYvWQpgXARTxqmbtF42nKMHV4/V8NbD42uwgyNXdHg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:0ac8bd2d-b731-4886-b550-720e4261af16,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:a3419084-cd9c-45f5-8134-710979e3df0e,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-CID-BAS: 0,NGT,0,_ X-UUID: bcc03b52de8611eda9a90f0bb45854f4-20230419 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1288790781; Wed, 19 Apr 2023 15:49:39 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.1118.25; Wed, 19 Apr 2023 15:49:37 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 19 Apr 2023 15:49:37 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH linux-next v3 1/4] time/sched_clock: Export sched_clock_register() Date: Wed, 19 Apr 2023 15:49:05 +0800 Message-ID: <20230419074910.10809-2-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230419074910.10809-1-walter.chang@mediatek.com> References: <20230419074910.10809-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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?1763590400226729093?= X-GMAIL-MSGID: =?utf-8?q?1763590400226729093?= 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 Acked-by: John Stultz --- 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 Wed Apr 19 07:49:06 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: 85239 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp194912vqo; Wed, 19 Apr 2023 00:54:54 -0700 (PDT) X-Google-Smtp-Source: AKy350anbULIFIVChvdlN/UhmrVNSF05jcrc3npd9bR1r7LdJwMHeNo4v8s5IGwnXF5y5jr9jwqd X-Received: by 2002:a17:902:cec8:b0:1a6:dba5:2e60 with SMTP id d8-20020a170902cec800b001a6dba52e60mr6019307plg.25.1681890894273; Wed, 19 Apr 2023 00:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890894; cv=none; d=google.com; s=arc-20160816; b=JYMUQTEYPOW1nr3iYtaBkKt8ePQJLkK468rKHjhjiLDNPMveCTIh0yv4SD1x6WK9CV MSIOkaGufaTMlEAMZ4df5Qi5daOehA18g35hNw4oZMS7+kfC11nVyQLxD83VbZx4dZd8 RN3JWQgbmvg4ybOgVRd7+d1kWu8teQUPBHjyOD4nNCe5YUClU6Y2VNyAKAfEcQUPkVCa rNamm1xnNgsHLmgtOILSrDvD1NLg+2gYUamsNYdrrgE42bommIsRdDFsbfcT0lavXP2A ZF176L1qtvrVba6pj0TkmMvLQLc7tlJkKiiZez8SJD11HCHGq7EyIlsLERH7vEsqto7j D01Q== 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=PQUkr1l9wuWs1v7Ghh48p3MDz4m38BiodZy7/nn6tLpYzMMCNmaWzPwFAj2TGk1gd+ KpCgRhsxLqF7hXWPaRyZwd9ywBTncUTIytpk/1CFAJAhP7ekPnkJ2s994MxtPojvBlZM wONikK12uPignkqwSfbQyFWAGhrKLXUrvuRkIdQYUO6nFVRBzriYZG2K0b0gfA3z4CXk V6FFQWTH+HbesulNUICjRuoI+v65/o5BqFbgBUCqMKJHUSKKJA4ijJYgQJ6T1djCuUON 9pYGH3g1lf64rVKtFBrW+o+xJNP3ONqcfKt8ruRi1+/uCGWuF3hjPvULO1uJG+J+gvC6 /6xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SVXGrHgI; 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 me6-20020a17090b17c600b00247303bfcd6si1280658pjb.168.2023.04.19.00.54.42; Wed, 19 Apr 2023 00:54:54 -0700 (PDT) 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=SVXGrHgI; 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 S232553AbjDSHt6 (ORCPT + 99 others); Wed, 19 Apr 2023 03:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232467AbjDSHtt (ORCPT ); Wed, 19 Apr 2023 03:49:49 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA03DE for ; Wed, 19 Apr 2023 00:49:48 -0700 (PDT) X-UUID: bfa9368ede8611eda9a90f0bb45854f4-20230419 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=SVXGrHgIM4g1mC3ak6OWrXReu4ApQ/wcyoqVcmC86mmI3/xftvX2svj8iHMQAGZDNmtxWqqX0jgvGE60gSbqnVIhMeRpvw7pGU8dANS11gClz2ECcsvOWRzsH+W7keip8faF0xAzifxsqkd8nxq4btAqbjagR+baedborHy+AQ8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:d7c0e7fa-da63-42e4-806e-02ee5870f51d,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:120426c,CLOUDID:f2419084-cd9c-45f5-8134-710979e3df0e,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-CID-BAS: 0,NGT,0,_ X-UUID: bfa9368ede8611eda9a90f0bb45854f4-20230419 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 924638229; Wed, 19 Apr 2023 15:49:44 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.1118.25; Wed, 19 Apr 2023 15:49:42 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 19 Apr 2023 15:49:42 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH linux-next v3 2/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Date: Wed, 19 Apr 2023 15:49:06 +0800 Message-ID: <20230419074910.10809-3-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230419074910.10809-1-walter.chang@mediatek.com> References: <20230419074910.10809-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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?1763590426329242040?= X-GMAIL-MSGID: =?utf-8?q?1763590426329242040?= 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 Wed Apr 19 07:49:07 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: 85240 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp195037vqo; Wed, 19 Apr 2023 00:55:06 -0700 (PDT) X-Google-Smtp-Source: AKy350aByJlni9kuqWWVdKmZUnTDyeupCDPq7seg+eTioZEIwxgY8ZY5GC1IbajrihhzxSg+oPtT X-Received: by 2002:a9d:7a93:0:b0:6a5:e9e8:cb1f with SMTP id l19-20020a9d7a93000000b006a5e9e8cb1fmr2489604otn.20.1681890905845; Wed, 19 Apr 2023 00:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890905; cv=none; d=google.com; s=arc-20160816; b=uJZL0uVQ+igO5Nqro2MbP9uuw+3TKlQDWvf2zuPAkr7FBA33voBI75fmOd30gu0jqf C5h138UqG9yOWVOjbhC0k5ITzxBCl7chjBbPLAOWukWuRb6IV3oo6LGWI4lOkcTzUjFD tex5epuH7xDJfD3CoUjQskaI7SAXHp+xqs/UgZ6Gl9j/5BSxGGExC9CbpsYdQAOdl9VI 2uj4VzZCXDKhINytu7Ew0sKY/NyQZKgkprL815nRt78E6Y0fUJ53bNwKtcXqGf8rBQKo yWlfwh35KrgrPgim6VF7TH+l0RK7kxKnLX49cAjWlgjV20blxHEWpLnp9BdS/Tx2zLmM js2g== 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=jyvydnMkYOENSFrtBxlFsy6DR/Y7LLS2zy67z2GpcDs723SOXjvgj5taUxFdlSOlG2 PE/vo7wpvCJGgKxqTGc8k6h0U4/HLz8gyBI6me5HGxWxq9EBaRxMuhniVasbCUi/ETfQ qm1zysTATxdw2faS7IFbV29PY5zTNWyXXJV1MLpeUCXSSMYCWt7j4pZHpeeO6YqqRobk ABIuXCfxSImk5HM4FrXXN7fRpZAPocdEH0PpUV7gSsXLpBL6gU+bePqFQib39rsOzM7J 4yZTL6LGuQX7UkbNZOn/fKms4wEBQDEkNw92WgLGulf4ns77xuWo6NGhIwQVcQkLnCeG NOxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=adiFAyzq; 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 x33-20020a9d37a4000000b006a5bc088e48si9073044otb.103.2023.04.19.00.54.53; Wed, 19 Apr 2023 00:55:05 -0700 (PDT) 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=adiFAyzq; 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 S231644AbjDSHuC (ORCPT + 99 others); Wed, 19 Apr 2023 03:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbjDSHty (ORCPT ); Wed, 19 Apr 2023 03:49:54 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E162097 for ; Wed, 19 Apr 2023 00:49:52 -0700 (PDT) X-UUID: c0e726b4de8611edb6b9f13eb10bd0fe-20230419 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=adiFAyzq+ZjW9+m0qGf8IHZcH8ishYYM2G+4scEhxdQ6Wd/Y2RzoYhr61PUYmwUukfTZyBoy1EtKr7+tCzI1odLDQf5rMc2ajow4ZPGcMKf2r7odYO1B1T0IlnHqUCMTC1rNIjdAXxK1LS3xLpHtlOQ8O/HxHP4zHALIe6wXYh0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:af9121f2-760f-45c8-804a-ed1cff4cc518,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:120426c,CLOUDID:39eb76eb-db6f-41fe-8b83-13fe7ed1ef52,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-CID-BAS: 0,NGT,0,_ X-UUID: c0e726b4de8611edb6b9f13eb10bd0fe-20230419 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 823981223; Wed, 19 Apr 2023 15:49:46 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.1118.25; Wed, 19 Apr 2023 15:49:44 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 19 Apr 2023 15:49:44 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH linux-next v3 3/4] clocksource/drivers/timer-of: Remove __init markings Date: Wed, 19 Apr 2023 15:49:07 +0800 Message-ID: <20230419074910.10809-4-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230419074910.10809-1-walter.chang@mediatek.com> References: <20230419074910.10809-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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?1763590438667787449?= X-GMAIL-MSGID: =?utf-8?q?1763590438667787449?= 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 Wed Apr 19 07:49:08 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: 85241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp195038vqo; Wed, 19 Apr 2023 00:55:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YbbNrvrtyjPOy1SE/yH2C0BQoG2bfWoNq7VNwMS6JF4225/LkWa8tn2TPvr2wBeMxQyDV3 X-Received: by 2002:a05:6a20:6a1e:b0:f0:ac6b:379e with SMTP id p30-20020a056a206a1e00b000f0ac6b379emr3139184pzk.4.1681890905879; Wed, 19 Apr 2023 00:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890905; cv=none; d=google.com; s=arc-20160816; b=Xchk5ATnG1u1cxv2Kgcs/uzXXV6iVQx8NXHpGQl+PJtNZJkMscN8JGLuDDn+WuCJOo SAduQMdHb35MMKRZbyEDEYJr7pc2fUM5zep8WvXEImsvpL+U060FnR4zdpJY0PUXh3IO 8xMgK56c/ENukDKLqHIiADSBGkuVSBugL2L5xkQd53LUu5dXmqbQ8YTzZONTlhdUTbB3 WyOVCxD1gGEmgr0anikpwSBCkxPlHxmmGEdLv3Dzdeq8LqsBzYa8s2Ks4sbjHY2QedZp Gv52Fqstx+Wbkd7D/PJfe/8M3WdM/zcuWDvftgSjPHolXIL7n9M3TmMEwJJjM6BJSrWH d69Q== 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=IHhBOfUYeT77YquBREt22vcfy911MiykLSdiMpD9Yo0=; b=N11bWPgrUvUyTuEiMODJ38AwJraL+Cnj6b5S5YV42kn8PkLpqJDKtC/xCGIQATTfjF oAcqi5uTDtCVHue/I0mPXPeF0o2XMnrpXPK14yBStp2Z5bNSyZF6hZb1cuCcG4lilgi8 hLRoeDCPEuogxo+Nu6jl2OsI+3SDjfe7+7IdB8Q+qmtV3R3VVPtKYMnjkOLU1I2dnlKU pV34e6D4kTlHj7cYkwLvnZEDPsTp2DKoPU2cIfJIHd/HuhDcAxq1On1wHWcxQIdEl08Y PCxx4nse1IxQOmOJx3suGupCuQcJMGPO0yBoQjxoACjxYZRsRUyETsdTF2wVeRo0KBey rKkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rFcmb5xM; 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 n6-20020a63ee46000000b0050f55427e3dsi16318509pgk.701.2023.04.19.00.54.54; Wed, 19 Apr 2023 00:55:05 -0700 (PDT) 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=rFcmb5xM; 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 S232321AbjDSHuI (ORCPT + 99 others); Wed, 19 Apr 2023 03:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbjDSHt4 (ORCPT ); Wed, 19 Apr 2023 03:49:56 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31FE67AB9 for ; Wed, 19 Apr 2023 00:49:54 -0700 (PDT) X-UUID: c34bfc68de8611eda9a90f0bb45854f4-20230419 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=IHhBOfUYeT77YquBREt22vcfy911MiykLSdiMpD9Yo0=; b=rFcmb5xMxej7NRtBhk/SzLJTLmt+c2Cxowdk2S98KjpUHk/hl3u3dgms1J8fArLLXPBArfSgMsIVTmKL8Z/T6KtjEdQ3T2dnc1q2RUzc74U9qW+wGBlDGYxDqGE4PJJ87Q2u3ENhbzzqcwikCgY1EjGD2zsBserZ7wyITvAqafk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:b47f5395-83c6-4a88-954c-d51b21018799,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.22,REQID:b47f5395-83c6-4a88-954c-d51b21018799,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:120426c,CLOUDID:b0429084-cd9c-45f5-8134-710979e3df0e,B ulkID:23041915495126IH8NNF,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-CID-BAS: 0,_,0,_ X-UUID: c34bfc68de8611eda9a90f0bb45854f4-20230419 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 668331487; Wed, 19 Apr 2023 15:49:50 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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.1118.25; Wed, 19 Apr 2023 15:49:48 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 19 Apr 2023 15:49:48 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH linux-next v3 4/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Date: Wed, 19 Apr 2023 15:49:08 +0800 Message-ID: <20230419074910.10809-5-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230419074910.10809-1-walter.chang@mediatek.com> References: <20230419074910.10809-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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?1763590438538232829?= X-GMAIL-MSGID: =?utf-8?q?1763590438538232829?= 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. Tested-by: Walter Chang Signed-off-by: Chun-Hung Wu --- drivers/clocksource/Kconfig | 2 +- drivers/clocksource/timer-mediatek.c | 39 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 526382dc7482..a7413ad7b6ad 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 7bcb4a3f26fb..3448848682c0 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" @@ -337,5 +340,41 @@ 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, + }, + {} +}; + +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); +#endif