From patchwork Wed May 17 02:25:45 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: 95017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp845259vqo; Tue, 16 May 2023 20:10:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qpuyEIrAYM3yqXlRQ03TxIPoRH2b9+Ev5jeE6LZVv+U4AKFClqVzO7hR1hFNAXUp/E2hK X-Received: by 2002:a17:902:e5c8:b0:1ac:b4e3:8aea with SMTP id u8-20020a170902e5c800b001acb4e38aeamr1391131plf.3.1684293057858; Tue, 16 May 2023 20:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684293057; cv=none; d=google.com; s=arc-20160816; b=tu0aLKoKMXy3zEWFcBC3ncnNWtwS8F9hTGR+4rNaLd7wiV/oCbOxd0IdrgrnyL8Jsj lYXmoxpk0cWA5O65Qh1oeDAxPEYOjEdPuPBak/T+8CrC+7XmfET5yvdepFNOeAp7o+yB x/TrY+V/nvCkavU5GR4uD2aa+KCN8I+2J4qPAUmWdCnNGgk9goTlzWR73mf5VjqGBGyi UpHq8ZVZsgcAPZBufeIHLMtM1CWMTjIv2ZA5PKWjJ0pZTrNdguAiZIjlEpRZ1z8stLk1 6Mx/xHUkdjLkpnOklJ4gCigtuBr/LhTykhJz0TxFlKWj7WLyvQUUOkPlOvD7AK/z5HHF XV+w== 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=RexUN+td4e/E4ud86CV5E7wKgvXssOxMb0wiC7TICTw=; b=VqvyQOFPcXOihrJjgDyjCRnqa9Sbc1dYyaTgLYDP5MXWsJf6DPtWDDqFZyJGI8u1X8 fGw37ApT6xKDd0NWLW6EclgD6ZN3Mzu7hqVJgptfErbkCL5Dzjlzs8JQtBd2cc8c28Wz 9LgupQOt9/yST+CR4MrKPSmw+yKI00MSpF/5msnC8VunK6Spg0IzBlGHIa8TZd8HkNob HGog5qk5qenw++Mp2y00njm4HEOaScOQEIy0ptcritCpHEu7KxToKhPmeGmmOp+JB14l 6rwZ0/baYsz2YskSpKfIszZLvhW/9N0dLKkdfETlhQvKNvoWDSDCs/Silq8r7zjI/IDs kpGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hUO4c6X3; 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 c15-20020a170902d48f00b001aaecc8a84dsi20768848plg.645.2023.05.16.20.10.43; Tue, 16 May 2023 20:10:57 -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=hUO4c6X3; 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 S232126AbjEQCly (ORCPT + 99 others); Tue, 16 May 2023 22:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbjEQClx (ORCPT ); Tue, 16 May 2023 22:41:53 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B651706 for ; Tue, 16 May 2023 19:41:50 -0700 (PDT) X-UUID: 3c7ad3b4f45a11ed9cb5633481061a41-20230517 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=RexUN+td4e/E4ud86CV5E7wKgvXssOxMb0wiC7TICTw=; b=hUO4c6X3WKhlrMZ3GAPprd9C1WcOx3qABNvcy1NAFe/QUzdnziavl8pOELjIEcnQaReTIk9oyLdx/7c1omL4Hw537iUcvEEa2M9wr9qlx375XovT5KM38AnQyRdG2SrJb0DcUUNUFaqPtKMljZTv8CmOZ7hiSNtDtVQEwkg2yJk=; X-CID-UNFAMILIAR: 1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:ca85d6ad-f776-4315-8ddf-31b4a43a2f93,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.25,REQID:ca85d6ad-f776-4315-8ddf-31b4a43a2f93,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:d5b0ae3,CLOUDID:74c00c6c-2f20-4998-991c-3b78627e4938,B ulkID:2305171026343BENMZM0,BulkQuantity:0,Recheck:0,SF:48|38|29|28|16|19,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-CID-BAS: 0,NGT,0,_ X-UUID: 3c7ad3b4f45a11ed9cb5633481061a41-20230517 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 976849742; Wed, 17 May 2023 10:26:31 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) 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.26; Wed, 17 May 2023 10:26:30 +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.26 via Frontend Transport; Wed, 17 May 2023 10:26:30 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH v5 1/4] time/sched_clock: Export sched_clock_register() Date: Wed, 17 May 2023 10:25:45 +0800 Message-ID: <20230517022557.24388-2-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230517022557.24388-1-walter.chang@mediatek.com> References: <20230517022557.24388-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?1766109277139932896?= X-GMAIL-MSGID: =?utf-8?q?1766109277139932896?= 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 Signed-off-by: Walter Chang 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 May 17 02:25:46 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: 95007 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp839349vqo; Tue, 16 May 2023 19:55:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6801EbEdI8I8BDPBpbxHgSmiuKlpIFcvvCVMQlZz2LwGyC5aorrcAGSjk+SdSNHF9plPsO X-Received: by 2002:a05:6a20:9385:b0:105:e453:2f30 with SMTP id x5-20020a056a20938500b00105e4532f30mr12592096pzh.57.1684292147218; Tue, 16 May 2023 19:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684292147; cv=none; d=google.com; s=arc-20160816; b=nSduWr4GQHp1OEUcQaWXs7DHITdnVq3azkqjgMpoHxKnycICJteALayacHItH39dG9 LfUym88Da+kv5tGcY9akoC26Un7QnmCotNzM4GvHyxzOXDNYirJN1k8BWSdi5wj62Rmb OJSzC8XP0vLAv+OdqXEhWQLVvOGROZEenQgucWERqYhBnv6RXqW0mT/f2BbRxXwxoxYX rfPWqOyxoOe4har2RbIz6WsK5imI+rGSkE/3FVMjtxEtUGaGoFf0DXg4qi2EQeervaJa mrshk5qT//BZLroLWkj8cNz8E03Vw/VnipaJbTlJe0wy6U2obMeFkYgKy0MJJ3/4MLma p9fA== 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=BiHDgbOEI7ul8fVenUBc4fXvk4qUwYuxHNdXt7Wyg8A=; b=sc4IorHPi6IG6L9JNAUkKrmnrkLlE1NIJ00dbtMzCOKZwhrM2iXybFD07lIUC1aQ4o gALkMuLMPgZbO/wEcZsaBuC7CRRqSR47/xSHVwf/pvFgCmysgaYMe0qj7pFYA0Qz0Dkq UV6r1OJCAusVOi4G7ms9D+k3F3tXdjOittHbdvUaeWmpI9IY+6TWO+H1TFzPgo/kcO/Z Fxf5jsvsr7tW8Oju3AVvcZKp3O2EraVvTBb4xuaSR2Q7HoXLD40hiLqVP+tA1nX+8rIO H/X0CKrnoqmuht1TD4GuBHLtfEq3X5d+q7dkvAbk9xIiLwx90UtO36URX5nFeF0S0kOi sWlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mZdzG1Y4; 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 e30-20020a63745e000000b0053075167160si14485025pgn.329.2023.05.16.19.55.34; Tue, 16 May 2023 19:55:47 -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=mZdzG1Y4; 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 S231936AbjEQC1z (ORCPT + 99 others); Tue, 16 May 2023 22:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbjEQC1s (ORCPT ); Tue, 16 May 2023 22:27:48 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC975BA9 for ; Tue, 16 May 2023 19:27:20 -0700 (PDT) X-UUID: 3da58310f45a11edb20a276fd37b9834-20230517 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=BiHDgbOEI7ul8fVenUBc4fXvk4qUwYuxHNdXt7Wyg8A=; b=mZdzG1Y4i+CLdsUu3xRgBLLB9QbdIcom+BEGwos6rfHrQXuZIUi851cNTJQqOVkS81KfrUWxyzKVDGTgyW0PLbQq9EGKfhEqq9FC/BgWa0r04IfAbXsCu9HWho+58qGqJm4xoWxaw91XY/XvG3/NTqa73BFaDU1PJ7KLrB1LIdc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:b2dc69a7-5c53-4312-abf0-1b1a58835759,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:d5b0ae3,CLOUDID:c21714c1-e32c-4c97-918d-fbb3fc224d4e,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: 3da58310f45a11edb20a276fd37b9834-20230517 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 1682484753; Wed, 17 May 2023 10:26:33 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) 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.26; Wed, 17 May 2023 10:26:32 +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.26 via Frontend Transport; Wed, 17 May 2023 10:26:32 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH v5 2/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Date: Wed, 17 May 2023 10:25:46 +0800 Message-ID: <20230517022557.24388-3-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230517022557.24388-1-walter.chang@mediatek.com> References: <20230517022557.24388-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED 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?1766108323012864439?= X-GMAIL-MSGID: =?utf-8?q?1766108323012864439?= 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 Signed-off-by: Walter Chang Acked-by: John Stultz --- 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 May 17 02:25:47 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: 95016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp845037vqo; Tue, 16 May 2023 20:10:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DiYO7nlRs9QBk0uSrXqaoyEX0r8Q/giE5/a2LOPIIQBBHY6gWNZimvKPngcTcT5lDuu9a X-Received: by 2002:a05:6a21:7894:b0:104:41a0:2b05 with SMTP id bf20-20020a056a21789400b0010441a02b05mr23852736pzc.30.1684293022332; Tue, 16 May 2023 20:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684293022; cv=none; d=google.com; s=arc-20160816; b=oOu0euFMgeHNnmVH1e+ChB4FWVv3Zm4NWeD7zxqzcUT+Im1DXFTq65+CQMQyDHQiK+ ehSIRZjUcbWvSYyoLD4nysS6OdITZ6v/N2iGnFqrh6OkHwtSc2o6CyMwOr+UdvLG4/i2 jil/lJYStclqQcLg9L+wX6abbdHkCvM7lKMO+OyZwmCC9BEiEqJN4Fut3R6I3BYZskpl DJ//fYtvT4i2ocF8pXxnWO0JIQTKLaKh4SI5heAQ0Lm/0zavOk6hvjSrzpo9tlYx+UzW IzxWijpnDhdUmo0r3jwN/Ro9SvD5mQJ69IgHyIaT5mHxkAPmiRQUzuSidlbburjY/vVx E50A== 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=KS2Lo1Yg16q5j8M/EVQ4ZQOglRixqlk/aOX29bWNOZw=; b=QF82i+iabYgGg2dNtd1kaxidl+jRGUWDJaCzMuDfRo63Ww6IX34H7Qh8HBAJJQZsRO Y8qQkMwja7WZ8lmh0vE8zXIhREYYTuoRW4XtXAddYn8GdbwE/fV87rv+Vi+BIh6x+jxR 0J5Zn/2ZsQ07XeMIcUP3iDK6uIYy1F3MQqrGitcbxQhKARZKF7qTLhpxcFfNPCqwlyeq +SDOYFe97dL/wCUn54IPUesztSARJlvK6NTsMZ2RQUji9NUkqz2Im5899fWbgjWhhxfX JhsjYIu0pbFn3oDeUclScuif5AJ3PiR4/LkAIwtaHlwGHdrXWqdRTZC2S2FtlF5a9Zg2 5LWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="Grkm4yB/"; 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 t17-20020a639551000000b004faf33e2755si19533610pgn.349.2023.05.16.20.10.07; Tue, 16 May 2023 20:10:22 -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="Grkm4yB/"; 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 S232055AbjEQC16 (ORCPT + 99 others); Tue, 16 May 2023 22:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjEQC1s (ORCPT ); Tue, 16 May 2023 22:27:48 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBA65B9E for ; Tue, 16 May 2023 19:27:20 -0700 (PDT) X-UUID: 3ea79118f45a11edb20a276fd37b9834-20230517 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=KS2Lo1Yg16q5j8M/EVQ4ZQOglRixqlk/aOX29bWNOZw=; b=Grkm4yB/UYisxPN5pdrENIXybDwe7kj8t+E8bpeeSjSiI94hL2a7p7tg6YioS4SrZSvsdrpaKbww3LAtgj4K2Km4qXdF7AHu6POvlqmD99+EEDQFdceucF5GsZqR1vF5OBhCl4AY0usSC8TUI/I6vFIKNykFxtOnodfGEpWMKN8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:1bec19b7-dba1-489f-8a22-0572f6f56fcc,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:d5b0ae3,CLOUDID:21bd673b-de1e-4348-bc35-c96f92f1dcbb,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: 3ea79118f45a11edb20a276fd37b9834-20230517 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 700545840; Wed, 17 May 2023 10:26:35 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) 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.26; Wed, 17 May 2023 10:26:34 +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.26 via Frontend Transport; Wed, 17 May 2023 10:26:34 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH v5 3/4] clocksource/drivers/timer-of: Remove __init markings Date: Wed, 17 May 2023 10:25:47 +0800 Message-ID: <20230517022557.24388-4-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230517022557.24388-1-walter.chang@mediatek.com> References: <20230517022557.24388-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED 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?1766109240468621111?= X-GMAIL-MSGID: =?utf-8?q?1766109240468621111?= From: Chun-Hung Wu Remove __init markings to allow timer drivers can be compiled as modules. Signed-off-by: Chun-Hung Wu Signed-off-by: Walter Chang Acked-by: John Stultz --- 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 May 17 02:25:48 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: 95010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp839758vqo; Tue, 16 May 2023 19:56:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pcIyeULPHppiFO2708BXV9p57VNQ5x/UiS61+n0AsEbbiFlMjMP6FFCI4KfZTX8o7rdec X-Received: by 2002:a05:6a20:5481:b0:101:7ccd:e195 with SMTP id i1-20020a056a20548100b001017ccde195mr38449690pzk.8.1684292215979; Tue, 16 May 2023 19:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684292215; cv=none; d=google.com; s=arc-20160816; b=MizRpebuLM+bcMkhYwZbG0zyZzb9HwfH/yFlDpfMBLzNDdHsZv8wfLMe2IP48ex2LI UcmJGfN7OR7NAFtlZWw+KxBuCvsir5ifU1A8hI8GcAFP8h4wM/7v+CutKKwNRmxuUFTb NNnfL0dlcsEBoB35C0+yBg7SO3cWlaZg/QKwz0q7N0GX4F2RmMYLeBpKKBTcGni5YM3w sUX/mRIpI87D69dl0MGnd9hRwM6+p5pEuCjs5kjezBrk+zm7Ci5NbRd64dttKGcvQMlo 4ehbdOoXhG5tOMmg23sdGL/mWOSBOO3Cwn+hfThF1yDJTVJbBeGBqVg156jrF+s2Y9Y3 xgvw== 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=nYcNa1U2hxMXAsaheDvMwQHpaoPx+7Gfb4BUUDZeS7c=; b=rRyXRJV9qXQtKv07Eb75xP+BVHBZnQ2aAbBREq94WHN0tKZdxCvRIO7h62XNydrIFq vkI0HpHm8mApkJKKrBPMEaAXibZ2eAuRbJBNOrkeunjOwil1D8+M2momjD4bYXaEyo/5 KeAFEKTUqops2ycSNLTHkz8Gv8/Vvf/8YR50/sRff5+PAgcqoB4BJW1S99vQxTu5gZDS wAgCCN5GtDN+zK45uGjCqRqnk/cOEzraOYePKt8avsgM6A2uJxnq0eVPkYEBwLC6g83g bYLn4NPtla8LBiWTVMKPI0yTuNRNqJAj5AYeYhkUoRN14RqqDjXJoydAKwflBbJvLvv2 U9Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=buUUs8YA; 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 l69-20020a633e48000000b0053045acfebbsi18962132pga.48.2023.05.16.19.56.44; Tue, 16 May 2023 19:56:55 -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=buUUs8YA; 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 S232045AbjEQC1v (ORCPT + 99 others); Tue, 16 May 2023 22:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjEQC1s (ORCPT ); Tue, 16 May 2023 22:27:48 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ADD8268A for ; Tue, 16 May 2023 19:27:20 -0700 (PDT) X-UUID: 404bf158f45a11edb20a276fd37b9834-20230517 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=nYcNa1U2hxMXAsaheDvMwQHpaoPx+7Gfb4BUUDZeS7c=; b=buUUs8YAV65neXQs4VTk7q1d5RjgDEE/q9cykVv4Wbj08iJuiHL2FpEG4DvWmTRqiZxS00mzjYMvZKJd3jXVNtGFRRLjQVvMCT6A1xmkX7Jsatj25tGh3GqXj0TohSeUMcqwPFnNTpO7R6pkBEZZ49I9FtDbP1LNCiREk6Fd1Is=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:c52d6a5e-cf6a-4bd1-a663-6ec42fd28490,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:d5b0ae3,CLOUDID:1fc10c6c-2f20-4998-991c-3b78627e4938,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 X-CID-BAS: 0,_,0,_ X-UUID: 404bf158f45a11edb20a276fd37b9834-20230517 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 1405807776; Wed, 17 May 2023 10:26:38 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) 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.26; Wed, 17 May 2023 10:26:36 +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.26 via Frontend Transport; Wed, 17 May 2023 10:26:36 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , Chun-Hung Wu , , , Subject: [PATCH v5 4/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Date: Wed, 17 May 2023 10:25:48 +0800 Message-ID: <20230517022557.24388-5-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230517022557.24388-1-walter.chang@mediatek.com> References: <20230517022557.24388-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,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED 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?1766108395003947605?= X-GMAIL-MSGID: =?utf-8?q?1766108395003947605?= 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 Signed-off-by: Walter Chang Tested-by: Walter Chang Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat --- drivers/clocksource/Kconfig | 2 +- drivers/clocksource/timer-mediatek.c | 33 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 526382dc7482..62103c0807f7 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..afeacb509481 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,35 @@ static int __init mtk_gpt_init(struct device_node *node) return 0; } + +#ifndef MODULE TIMER_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_gpt_init); TIMER_OF_DECLARE(mtk_mt6765, "mediatek,mt6765-timer", mtk_syst_init); +#else +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 }, + { /* sentinel */ } +}; + +static struct platform_driver mtk_timer_driver = { + .probe = mtk_timer_probe, + .driver = { + .name = "mediatek-timer", + .of_match_table = mtk_timer_match_table, + }, +}; +module_platform_driver(mtk_timer_driver); + +MODULE_DESCRIPTION("MediaTek Timer driver"); +MODULE_LICENSE("GPL v2"); +#endif