Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2397856rdb; Tue, 14 Nov 2023 22:19:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwVxEyip01Lcs/5WK6ZvIQwxqfW491RyrszTznTDhmOEByPHiJVcPq8oAFpF6d9+laJyaD X-Received: by 2002:a05:6808:2088:b0:3b6:b27c:640a with SMTP id s8-20020a056808208800b003b6b27c640amr16722564oiw.21.1700029154654; Tue, 14 Nov 2023 22:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700029154; cv=none; d=google.com; s=arc-20160816; b=e05QGuPVJ4HDf7oLx7wPU3b2CgXC93IvL+Lw+dTiv+BMUx+d5/Qrk6tBR49CUNdehz 9pNzXWXXiYox+7xoL3+SjkyKUWiIO+qxwmV06pqIghhDop2ZPsWYCtMAGHABBitCzope O2udRtI+1Xqer9zy5h6Lb9FAWwFX7fs8Vdk5WjxIbDgUye3MNN/oGLKyZxPPSlYU5Y2R ac1tDLXIIjl6EPDKQ4AP1LHSpdDmL65sFmnqxn7Hgo3HrVWggsNgKzNPF1vQOiaSkJ5L t5Bz/vjima4VgJ7k4CbPVr4owVTKSSF0JfSvnX/UzC5DrFJx4wB809fBQPcKNEpAE0bE m/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sik5adW80Bz76AB76hD8s8faFNFBNHPwi14GvShjZ50=; fh=dDWVdWxoxdu1HIuuzfPrwpYb/Ru/vsdmeSAG6aE0X68=; b=gtEre23OWUneitIJk346Fg50ooi8fPoX8ZR3n1l6+f3ke8wvnzsZYzxB+gx2z7rTeD v4JRWozIUShCiw5lsgJ47C/pw34NroUYio2NyNkRUGNzzntEvVMKbXAaVM7wIcrGVzOI AAaMWMqcdxRBy6V8OmERc+NrDkLdKbEhcSDHYsuA3idqdJdzs8zfqcMSaOq8rz+R8Ayz KDdoYBQGNO9vMHeXhCekvdTVutio7jl1OMYrmeekL1ZbEm6e3BeFliUJcLX6CyZQTjM0 PxUeNZ3/fY+slrxG3sMmcjBGpSw+94Kst8P28jz4gWsUhGV+O+PLs2hAsGIoC4KWkfE8 LJKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d7-20020a656b87000000b005b9b68add7csi2469936pgw.881.2023.11.14.22.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 22:19:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3E83C80CE7EB; Tue, 14 Nov 2023 22:19:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234545AbjKOGTC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Nov 2023 01:19:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjKOGTB (ORCPT ); Wed, 15 Nov 2023 01:19:01 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B48D5B8 for ; Tue, 14 Nov 2023 22:18:55 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id ACBF024E24A; Wed, 15 Nov 2023 14:18:53 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 15 Nov 2023 14:18:53 +0800 Received: from localhost.localdomain (161.142.156.149) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 15 Nov 2023 14:18:49 +0800 From: Joshua Yeong To: , , , , CC: , , , Joshua Yeong Subject: [PATCH 1/1] clocksource/timer-risc: Add riscv_clock_shutdown callback Date: Wed, 15 Nov 2023 14:18:11 +0800 Message-ID: <20231115061811.10041-1-joshua.yeong@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [161.142.156.149] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 14 Nov 2023 22:19:12 -0800 (PST) Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when switching out riscv timer as clock source Signed-off-by: Joshua Yeong --- drivers/clocksource/timer-riscv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index da3071b387eb..588a05459b6a 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -50,12 +50,19 @@ static int riscv_clock_next_event(unsigned long delta, return 0; } +static int riscv_clock_shutdown(struct clock_event_device *evt) +{ + sbi_set_timer(-1); + return 0; +} + static unsigned int riscv_clock_event_irq; static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = { .name = "riscv_timer_clockevent", .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 100, .set_next_event = riscv_clock_next_event, + .set_state_shutdown = riscv_clock_shutdown, }; /* -- 2.25.1