Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3038458rdb; Wed, 15 Nov 2023 20:08:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEocxjFWUX//pbBwv8QVp1HV7hrT4ZMKCzu5aqFO5SIqt5bEzu8AdiBhWCEJPht2BBGSezc X-Received: by 2002:a17:902:ccc5:b0:1cc:3b87:8997 with SMTP id z5-20020a170902ccc500b001cc3b878997mr8247650ple.57.1700107708224; Wed, 15 Nov 2023 20:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700107708; cv=none; d=google.com; s=arc-20160816; b=un0Xp7zvHqJI3W04Q3I2pd8Sf9kujhYa9qM/XoJtuKjRPa7EF2vkyCK/aTN0+T2laY 1JicaojtoozBmtMo2BCciHcOIsnfv5hLnvOw8Ze8o/Uy/Vkl8OvugC8km6hYPJnQfkMn NH/0MlF+PCcncOBSGoVuw7usJle/WNYO/pQfooA5ARGGSUS0ZRcn3miMu5tK1C3mBJ1c E01YrNdB6ntoJM5+GbkCbrAF4/Gt6uiyAp4U2n3BG33QfUAmS2qa7Yng6mhPI01RMhfj 0MBHFZYYxtIO1iBJ1vTj2cpUd0lqye2UG7NdLj2MmXlfKCjWx7GXyKwlRJN/uu1viuNV VO+g== 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=8Ijt5qzEoOhsErqZBpzAVUY/ua97B8nzSlZy1SVOa1k=; fh=dDWVdWxoxdu1HIuuzfPrwpYb/Ru/vsdmeSAG6aE0X68=; b=vHOuJtGwHAFJn+DOqomm/19O1+FxXwOqmV5qOZCm6n5iwqS4jkk+it02eZgc3E+1wx vNh1WfnbKSypPNjMkeojxDNIy8GbcCyhebu6K8BrPOMeaj1G4ZvS1UhcBzoq7wqotLXN 45nqdAXb4FgiYPgBLJY4bbwjxl7yVJFpL05bTnh5UNqF5I7b78zJq4hipRrmj17FrfqI bj34QK72l4dJ8PbO2vITxu5T+TTjH32lurS164VMrjKlmZUpAbb9DiFyU7nM8YY8dLcZ q1KznJRtQSaF5hWGoVRfNOslJVjPUlov4HFryiyNTSRoOFUamV/S8tk8pCV+ItMU41Id KT/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i5-20020a170902cf0500b001c72b13a1cbsi12516654plg.352.2023.11.15.20.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 20:08:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id AD6BF80CA0BE; Wed, 15 Nov 2023 20:08:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbjKPEIP convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Nov 2023 23:08:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjKPEIN (ORCPT ); Wed, 15 Nov 2023 23:08:13 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F9E5196 for ; Wed, 15 Nov 2023 20:08:07 -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 A0FED24E21A; Thu, 16 Nov 2023 12:08:05 +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; Thu, 16 Nov 2023 12:08:05 +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; Thu, 16 Nov 2023 12:08:00 +0800 From: Joshua Yeong To: , , , , CC: , , , Joshua Yeong Subject: [PATCH v2 1/1] clocksource/timer-risc: Add riscv_clock_shutdown callback Date: Thu, 16 Nov 2023 12:07:49 +0800 Message-ID: <20231116040749.8430-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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 20:08:25 -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 57857c0dfba9..e66dcbd66566 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -61,12 +61,19 @@ static int riscv_clock_next_event(unsigned long delta, return 0; } +static int riscv_clock_shutdown(struct clock_event_device *evt) +{ + riscv_clock_event_stop(); + 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