Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1538560rwd; Tue, 16 May 2023 19:53:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vL4O9R4l78PCLys0T5gf2+CRpK4UygQj5kwTu7fBALW+cIfrGdFxRo4WN5K3rnUiPJ4Sf X-Received: by 2002:a17:903:44b:b0:1ab:f74:a111 with SMTP id iw11-20020a170903044b00b001ab0f74a111mr39428624plb.63.1684292016962; Tue, 16 May 2023 19:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684292016; cv=none; d=google.com; s=arc-20160816; b=XkI37qSzrfNTjpP/fvBgXc59yc6ybLw2OtrLzsrnkcQFbRRPjSQdPOu4d9KRooqHO9 v3n12MqcB4XMD7zGxBHCnYGugVQRRVF36qu/D8KdksfYUwgiBBo2evhZ6+H4mTVlNx0p 5jYinq9/NkyvHBN+zVCVOs4XvxjP5vS5FFyZeJjZOXgVxmfEuOWbjhIK22xrELfq0dQk 7ku/VRNl3ycygxXf8vzE6bv2vBm7KnZA31y1BHIKQe9pZmnEZZHq5rwYBSzB7WNhgY0v tBB3xClIEuzsk2nhSTnhZDRSon0LraZIDzV8aSsyl8QSa5+V2KxIPMfMgyvqtXZGG1Ul Uv1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=XT0aWLrHFibG11Unqwd1/RdVtuvwg1ngn+cr6gZ0zko=; b=yYpXoUuMSjklOk+9yqInDyFQBjqHNMOPPYK8nNt5O/116OXcqFfpnXQK83VyLG8hHm 5rDYWOX7NNgTIqFJPqzetIETlK/MZUVTUA/sS5J7L7InEv8W59YyXGtaTNKagetmUrQA QTbRqhRH81RB3WyL9Mk/Ww2GYUx0nfVQOzrwOJDEBV0MHqX3E2MiI16e4x0UhOadjInc Uuqisz5tspBt7CBmzNReEYBp4mD0i84lLamlG32FrYSKIJ8mciI4j2t9uNSSVZO6+s5b rqVgHGr1cB//36Hra+yNnMfl6FEqFtQvwcohLWOfCRzVQqVJJe+2z33RZcB3j86jv2+8 XsTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="LnTYq/QK"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a170902e84700b001ac615350b6si21481470plg.516.2023.05.16.19.53.25; Tue, 16 May 2023 19:53:36 -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="LnTYq/QK"; 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 S231744AbjEQC2A (ORCPT + 99 others); Tue, 16 May 2023 22:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232025AbjEQC1s (ORCPT ); Tue, 16 May 2023 22:27:48 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C7F5246 for ; Tue, 16 May 2023 19:27:22 -0700 (PDT) X-UUID: 3b633390f45a11ed9cb5633481061a41-20230517 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=XT0aWLrHFibG11Unqwd1/RdVtuvwg1ngn+cr6gZ0zko=; b=LnTYq/QK+Mnx4P9JaLjilrHtv1j3T6N3ULhkDlQwREQskdmi7a+2viNAF6RUnUURF9P7DtroO1JkqffhrLTeqTAmvzyf6E82ffhykxYsXXhccPxdS9rc/U47WJg4te2y/CVeTryQGzg6x282bubNMHBnBM9H6QSQOjoVg3CQAX0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:bb6c198b-15dd-494d-b0d7-29d755afec7d,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:6cbc673b-de1e-4348-bc35-c96f92f1dcbb,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,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: 3b633390f45a11ed9cb5633481061a41-20230517 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 2010033819; Wed, 17 May 2023 10:26:29 +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:28 +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:28 +0800 From: To: Daniel Lezcano , Thomas Gleixner , Matthias Brugger , AngeloGioacchino Del Regno , "Maciej W . Rozycki" , John Stultz CC: , , , , , , , Subject: [PATCH v5 0/4] Support timer drivers as loadable modules Date: Wed, 17 May 2023 10:25:44 +0800 Message-ID: <20230517022557.24388-1-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain 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 From: Walter Chang This set of patches aims to make SoC related timer drivers, such as timer-mediatek.c become loadable modules for the Generic Kernel Image (GKI). This driver registers an always-on timer as tick_broadcast_device on MediaTek SoCs. If the system does not load this module at startup, system will also boot normally by using built-in `bc_hrtimer` instead. Besides, the previous experiment [1] indicates that the SYST/GPT, in combination with a loadable module, is fully operational. The first three patches export functions and remove __init markings to support loadable timer modules. The fourth patch makes timer-mediatek.c become loadable module for GKI. [1] https://lore.kernel.org/all/32777456f8e0f98e4cd5b950f421d21f71b149cf.camel@mediatek.com/#t [v5] - Add Signed-off-by tags in all patches - Add Acked-by tags and Reviewed-by tags [v4] - Fix review comments pointed by Angelo [v3] - Rebase on linux-next [v2] - Convert timer-mediatek.c driver to loadable module Chun-Hung Wu (4): time/sched_clock: Export sched_clock_register() clocksource/drivers/mmio: Export clocksource_mmio_init() clocksource/drivers/timer-of: Remove __init markings clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module drivers/clocksource/Kconfig | 2 +- drivers/clocksource/mmio.c | 8 ++++--- drivers/clocksource/timer-mediatek.c | 33 ++++++++++++++++++++++++++++ drivers/clocksource/timer-of.c | 23 +++++++++---------- drivers/clocksource/timer-of.h | 6 ++--- kernel/time/sched_clock.c | 4 ++-- 6 files changed, 56 insertions(+), 20 deletions(-) -- 2.18.0