From patchwork Fri Apr 21 03:46: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: 86130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp794820vqo; Thu, 20 Apr 2023 20:48:52 -0700 (PDT) X-Google-Smtp-Source: AKy350ZnIpMxnjCaVfl8umAwXR/Kht3da73tJxDhjiUoMleuXFaTq+AS0px7/gFwSrcbqXoJ3S2K X-Received: by 2002:a05:6a20:158d:b0:f2:4076:9d1e with SMTP id h13-20020a056a20158d00b000f240769d1emr3017634pzj.2.1682048932535; Thu, 20 Apr 2023 20:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682048932; cv=none; d=google.com; s=arc-20160816; b=YEkUdEQ7KNAl9Gu8m0b8WmESwx43c8MKbJCJJotXPLUTC6+F+1wlVAqDc/lyFaJcOS D6E3289eI56ntwZrJnJA05W9WtgeT6saj0rhGDdWQ23TSbsKH+RzHoI1w2sBwiuUmppi vS/O7fdqtz03C2Y1AUz9T47sRnwHPkw+wvNh4pUNu/3elMLSVEOreIoNzlQlQ28wpcsv CbS9QRB8OzblGwBfo7WHrh09ttRRkmcUkz97836J+t3RoT7xPJTN1sKjdiSc1staKjxI A8bepxKt0gCNbTOGxc2hV3lbD47NeMpqyxHhEyOs8PJx9QUwf+gs7rklXYJBkYsJkKq4 uOEA== 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=OE2thU26tHMsfd6B/Hwy5NAPhiRKfxc48HI/JmWb8I/KaF4hvhjtiXgYSLoNyhdzgB iu/XDn9z242LKG1J1ZUxilfypcVcVMd3ircoG736UG8jsnbgIO6ezMa51E3sB/XlaKmz Kn+kP+pv03nQv+0qtrYUfxfjHZYF1Y7j0ELboFRLTGVCDZQ3hglKwVhS3j91L7Ame3YM lrp27d0zWRl32q6KU087Z/QE6XqmwtQWOrNH4W0AZlasZo9TVyGCQg8bMWgk+O1MmPbM wkioqQkmntmfbaeOCTlfcpxe2QmLXf9NoixH0SJIU276gpq2JVZpCU2oODt6hh9egKc/ 0jPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="FSxOFc/N"; 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 l26-20020a63571a000000b0051b702b179asi3151903pgb.747.2023.04.20.20.48.38; Thu, 20 Apr 2023 20:48:52 -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="FSxOFc/N"; 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 S233689AbjDUDr5 (ORCPT + 99 others); Thu, 20 Apr 2023 23:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233688AbjDUDrx (ORCPT ); Thu, 20 Apr 2023 23:47:53 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F4E49D1 for ; Thu, 20 Apr 2023 20:47:51 -0700 (PDT) X-UUID: 45f2f6b4dff711edb6b9f13eb10bd0fe-20230421 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=FSxOFc/Ni37MP87PSulX/ASb49zzL7pEUN1ulR+wFu3ezRu2Lv4TgmehF/2TexmmviE0f2iOOh1E7GOzKr/NQyRSvvuURvuC/rGXaMPFZPfasiiuqoq13BGM0H4V+i9ojnJE/t6TzsTplOEQvx5vcHrp8YsPO+DJPtgTm+BwPKQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:70bee397-8b78-44fd-808c-2770bf0936e8,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:542fadeb-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: 45f2f6b4dff711edb6b9f13eb10bd0fe-20230421 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 1361055635; Fri, 21 Apr 2023 11:47:44 +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; Fri, 21 Apr 2023 11:47: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; Fri, 21 Apr 2023 11:47: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 v4 1/4] time/sched_clock: Export sched_clock_register() Date: Fri, 21 Apr 2023 11:46:46 +0800 Message-ID: <20230421034649.15247-2-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230421034649.15247-1-walter.chang@mediatek.com> References: <20230421034649.15247-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?1763756141775586374?= X-GMAIL-MSGID: =?utf-8?q?1763756141775586374?= 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 Fri Apr 21 03:46: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: 86131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp794957vqo; Thu, 20 Apr 2023 20:49:16 -0700 (PDT) X-Google-Smtp-Source: AKy350Z83Z8MziJjuc3DdLZKosnV/RoucjE5OREpkCVja81z42OcTQ+M+PJZJUy2XoMscPmJBwo4 X-Received: by 2002:a17:90a:cc0b:b0:237:62f7:3106 with SMTP id b11-20020a17090acc0b00b0023762f73106mr3485735pju.17.1682048955942; Thu, 20 Apr 2023 20:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682048955; cv=none; d=google.com; s=arc-20160816; b=BIWUpI6+xuACJabLnEUfzUYBi2kc0OLE/K8qd83lFNfaVYGv866pqDFknIwBPCdMFA +Uh6Zos/Djvg/EeUqJm+rABq5iOZuBUNT3J+Wwp+Hq0N1Kz3XBaxnWD5fWVMQ85aTKHe FqZtjelzD5BS0YkLbqKhaj9Pk/D2eLJKL1xbXhs/gYMNRgyrdbze03rRdQlGmIpZZ/8J MsNveq8C9oltI4ufCeMZ1IjiBQQm/hJ+da0+2Z6nTSOixknP6u+cexYcZQJfW1zw+Y4l YiCS8/5/9AjrLtx3SFO0NSVCbo9sW9iLS6J/PilfdUWI+8W96DOO30unkbpAKLNAVkBv 5shg== 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=O5j1LWYXPv9XGGOuepbvfSev9jVCmNU5pVZK/mMji4yppdRQ/wCdV9T6THrQTQOgJx JSUVrVQpkY9RZp4q9rFC3RGp2weL7GK7wNIAFLMlPuQyG/bHo3si6XrMYYtYXTog2Ki6 Hgo1wtnks+bbnSk8h/HstQfKcucAvH/jGGEquvWjXCuiSdlb7RiMWzKaEN/yuGyVQ0gA tWd/dwoGjg4ovHwaJshHLZBVigGDB42DzotosJjZVQEQ8EXNBQRiLgY/8iRRWjpevX+k sTvKRuMmie3l0kDaHEKou2zKJTHG2TyCoGTDCKYEs1TuFoTQenk2n9Oh8e7pL9Ycy1hm gJTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=FppUqMuU; 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 w6-20020a170902e88600b001a6c524c18asi1999772plg.40.2023.04.20.20.49.01; Thu, 20 Apr 2023 20:49:15 -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=FppUqMuU; 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 S233719AbjDUDsB (ORCPT + 99 others); Thu, 20 Apr 2023 23:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233699AbjDUDr5 (ORCPT ); Thu, 20 Apr 2023 23:47:57 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D374481 for ; Thu, 20 Apr 2023 20:47:54 -0700 (PDT) X-UUID: 4814df98dff711edb6b9f13eb10bd0fe-20230421 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=FppUqMuU4gcz0NMiKgDRxxsoMasocPzdOVEdDOh/ogmK0x/LBuVOGAtFYtc9FlnOBHR/oXMlC8HB8JWF+XEynP2jv42YHL3QVBFdBkjWIJIXjI6SkGrZzeuu6Poam07d6PKIB8J+mDJ/q9nWZi/1ul2hF1GRZ+O3mh4CKVjpFbk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:e2c56df9-0e1e-4870-b85a-a8417bedd029,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.22,REQID:e2c56df9-0e1e-4870-b85a-a8417bedd029,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:120426c,CLOUDID:b398c684-cd9c-45f5-8134-710979e3df0e,B ulkID:230421114749ZN2FUYUP,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-CID-BAS: 0,NGT,0,_ X-UUID: 4814df98dff711edb6b9f13eb10bd0fe-20230421 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 977640144; Fri, 21 Apr 2023 11:47:47 +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; Fri, 21 Apr 2023 11:47:46 +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; Fri, 21 Apr 2023 11:47:46 +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 v4 2/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Date: Fri, 21 Apr 2023 11:46:47 +0800 Message-ID: <20230421034649.15247-3-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230421034649.15247-1-walter.chang@mediatek.com> References: <20230421034649.15247-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?1763756166204439206?= X-GMAIL-MSGID: =?utf-8?q?1763756166204439206?= 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 Fri Apr 21 03:46: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: 86133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp800825vqo; Thu, 20 Apr 2023 21:04:28 -0700 (PDT) X-Google-Smtp-Source: AKy350aVzlSOhKiBPUr3BGWSwgcCAfvTateVpwME3q1HdQ77pbEQGUYvPf7Iz8xOysgeECOcyeUM X-Received: by 2002:a05:6a21:9982:b0:ec:8f81:e9f7 with SMTP id ve2-20020a056a21998200b000ec8f81e9f7mr5618694pzb.16.1682049867880; Thu, 20 Apr 2023 21:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682049867; cv=none; d=google.com; s=arc-20160816; b=e4p65pWd1zzASs1+zPMCUQTNYIqNXa6bMNtNKx85HnpdMFVS4acrXqkjEPmRYz6JSK mJtKDx0ZYoNmzqLe/vhX9m20WYcsl3ZWQSo2+9pHXZvvra9hsO8au2Ti9yvHPWo+WHce 1IbC47EK475OEop2m8N1eEpsXuGiLSKSbYRghbrHsGL8Fu+th/tpKYXHW1/r82+6fY0x XcfH5WXOEChrHCQldZOJ7aHIsIxZv0I2LJEDBMlgfzlcIEPoJASkRuMaIdb2gMBVQMze NvGR3GtwAnzKJcPPeauVBsjdxfnN7J2uxKLf+QCPSW6flqbrVrm/lN5qVUyVwiMCLujA GX4w== 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=kvgOrKK4N8qBE28Zf2qdxC73OVt2OvX4rKvwgkbfvgjZkSimbgURc7z2ozeYYYM4cd SD2IXzDLfwQFSrrJZ/OVX/kKWB7nTV+g3dsO0RufQqHYY7CkvzhXw0uA5Tw69pC2ZUvr ltigyOBJ+WuVRL30Taly5M6Uzm1lIQq/4gPqbnKSc0B5fRIApKPPrSxqpipy+hJTnGvw NDH1TRu1Ae1sCZIqkkhJWUonekfZhVvWhi8sDxdHzWczDonAn8VV/4a3fixTYvQTkSkG HpgHgLD5QdGF17n3ewkyMSTpxO04bhMUZLF0pBXI5w/SzQk+27e4fVHfAFy7B/PY6xx0 lrqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=a2JTOoiO; 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 w5-20020a626205000000b00624ac1abef6si3488967pfb.218.2023.04.20.21.04.13; Thu, 20 Apr 2023 21:04:27 -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=a2JTOoiO; 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 S233696AbjDUDsM (ORCPT + 99 others); Thu, 20 Apr 2023 23:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233728AbjDUDsC (ORCPT ); Thu, 20 Apr 2023 23:48:02 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 445BC44A2 for ; Thu, 20 Apr 2023 20:47:56 -0700 (PDT) X-UUID: 4a5b49ccdff711eda9a90f0bb45854f4-20230421 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=a2JTOoiO226LwJkA7GXNw21hhLZxL7jH1FIFqJzn3pSmv1uRxoOQ2En2ZwHapXMxblFUsQHJUd4K3shZ0HE9Yu/t8Gu5SmTg/COD6N7yvIre5i9cEbxDoITjjwCCpfxT4MEFbwv6csYP/nBJbmKMaPrv0wZsC+Xr8FYz5C2eBog=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:63013d2b-dd33-4bc2-94c2-dcd3e29f7208,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:df2fadeb-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: 4a5b49ccdff711eda9a90f0bb45854f4-20230421 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 52984891; Fri, 21 Apr 2023 11:47:51 +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; Fri, 21 Apr 2023 11:47:50 +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; Fri, 21 Apr 2023 11:47:50 +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 v4 3/4] clocksource/drivers/timer-of: Remove __init markings Date: Fri, 21 Apr 2023 11:46:48 +0800 Message-ID: <20230421034649.15247-4-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230421034649.15247-1-walter.chang@mediatek.com> References: <20230421034649.15247-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?1763757122657698355?= X-GMAIL-MSGID: =?utf-8?q?1763757122657698355?= 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 Fri Apr 21 03:46:49 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: 86132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp800659vqo; Thu, 20 Apr 2023 21:04:01 -0700 (PDT) X-Google-Smtp-Source: AKy350YArv5zW5ZXU4FIgVYnbrlwV/Fq0GepTpeg2LT0dit/A6FIZUPFBx99ZaoaMN9I57oCd+Q0 X-Received: by 2002:a05:6a20:e68b:b0:ef:70b:42fc with SMTP id mz11-20020a056a20e68b00b000ef070b42fcmr4517422pzb.38.1682049841620; Thu, 20 Apr 2023 21:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682049841; cv=none; d=google.com; s=arc-20160816; b=GiY4eudjnizbHsmDOUBs0kFoJys/qRwaTTwuUCP72iYlXHt543U3E63xrgduhwpL2G W41taT7v57ZMPHde263HL6tr0J762Zu3UG7Jf93bYCkUqFc0N3XMwBEplzrSbphWQ2g3 11YTjh/pKDqX5CEnyTulUFFXt3kD3D5O4hLCesMZLW44VfOJOvuK/4GMX6pL4EAVdSym eOJtNfYzEIRzSR+NYWACOJZMKB8K//p/0PHXN3yNmVVW4HrWADSZjbNFEIblLjNgLApY 7nMJE9lPlgLM96103Ckk7Nfs4J9tsnQ8qckRfp2gBteR/sJ3zsYzhRwc8nKfOoNK49h+ BYBw== 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=hW3Yiugr1dOuuygEOQHIaICWfvXy8XK0+7DIe1YW0hI=; b=w0uRVV8T8NLb7QN+VSjwmJhR0CyjOMkMeFc8/Cs5ri9+VroBkxei2uAKEyn1m2Ph+B GajacX3tbdbbNwZfE5dSJ6seQjL0JcZFPCktfnyuQFSBnUxLkAS4ZBjnByHv+WKOMyrK ooRV3lUApYUvu/TI8U974SgDAYhtwD+L9DfmwuqnxkiFd3ZhQgpGA/VqAS08FaKFMM/a R50WoQmhu40khpKwn6ZhhXtxHqRvAItioj4KzSZaLF3NRp8flzxLWiu9HITImaf3JPmr 2jz2H6UmpAbr0N/BjzFQV5ZD5lqT7M6teW92Zx+rxlT6dYsUSRXLfBEifX90IgkmKut/ ffKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RCHViPe0; 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 p67-20020a625b46000000b0063d2a99e393si3195925pfb.336.2023.04.20.21.03.45; Thu, 20 Apr 2023 21:04:01 -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=RCHViPe0; 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 S233803AbjDUDsT (ORCPT + 99 others); Thu, 20 Apr 2023 23:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233725AbjDUDsH (ORCPT ); Thu, 20 Apr 2023 23:48:07 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E4F524B for ; Thu, 20 Apr 2023 20:48:00 -0700 (PDT) X-UUID: 4c1a34eedff711edb6b9f13eb10bd0fe-20230421 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=hW3Yiugr1dOuuygEOQHIaICWfvXy8XK0+7DIe1YW0hI=; b=RCHViPe0DAhNC5dSYdiCzHZn9kafdbxwfpUubyT8YnE0oF48qifxIYwAYggTUudo3ZRPHlGe3Z5DIBV1BsP4itrTeQlQWYTsUteeI+mGZTt0Ssh6Cm9/1SotREDcujq5+Pdw8Gx72O7qWRe8xJC0rHikLKYZqWbAOhPafH7qGRk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:0c772ebf-4f46-4173-8ab2-43c6b5613f6b,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:120426c,CLOUDID:6399c684-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 X-CID-BAS: 0,_,0,_ X-UUID: 4c1a34eedff711edb6b9f13eb10bd0fe-20230421 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 479279796; Fri, 21 Apr 2023 11:47:54 +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; Fri, 21 Apr 2023 11:47:53 +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; Fri, 21 Apr 2023 11:47:53 +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 v4 4/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Date: Fri, 21 Apr 2023 11:46:49 +0800 Message-ID: <20230421034649.15247-5-walter.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230421034649.15247-1-walter.chang@mediatek.com> References: <20230421034649.15247-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?1763757094663464512?= X-GMAIL-MSGID: =?utf-8?q?1763757094663464512?= 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 --- 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