Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2432364rdb; Tue, 14 Nov 2023 23:53:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IETK5vLtf79rztldzaCEnWpmmVnEEAWeAEeaXb2pJdkHSGEThwU9MDqDz+cJFNA8vFSVtrm X-Received: by 2002:a17:902:cec9:b0:1cc:5029:e3d4 with SMTP id d9-20020a170902cec900b001cc5029e3d4mr7019508plg.23.1700034805565; Tue, 14 Nov 2023 23:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700034805; cv=none; d=google.com; s=arc-20160816; b=syWggmszU6kvKXoDYiJf82LaWWtlQOG/yrCoQLksFqDXDSTM6jiwj1LAr3lPvxu+wH oqNIjiT2ODE1bKS2Utr3ELGfiLC7IrWY2fPOqX8PtrUnYc+wkRZKj9m02zN99mBu4xX3 nWGHMf3wBh8zLsIZDwf8PYslDF3UTVuOVJcz0lCuRQhAZv7Cza/xjOTzdpfRwQ2AEm7U 8IK9AjxbMBd0bbftQQnX8akx+EkkxXq6x9BV2Tlt8wu5Z+j6iqgHuQL8og/czf1yNkQv MTl/bxdtw/wt9OeTdk6tvStqJcpNEW69yTbLSdXubU8b7GkkZnTthkt/nork8cyjug0i IMxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=eD12GBF0idZ1DnKA1WimeghuuDXVXzuMXHgL/tNcFpA=; fh=2+KS9tu4DkRnjqonowlOBzikyTtyiE5Z8dAg+mx80Lc=; b=kTmxArvub4k01nrGukP5FygBA+Fh3/cS9QoYXBvTCGKy8YUn90LhG6gmuHzIPDbSUl FLxSHDJ0oKCI6oouCp11hKvr0NUE41RWYs/Zr3IemYDPOcjW8Gkl2bqx4s5d6tFYX/kD UYXtExDWJ0H1HgMdEkOLSm4d9O9iZ4ihwEobtvSLrp+gKkMvgIYbFzLXZ6t8s0fsr7FV 70RCeoEBwOQFar9BbZC1ixevcHcmWc5qOpiaQUtrzjHsKJgZCH3DNt1jysxeA32s0Mh1 ek3WrikmMBB60EGHiw5UtXrVca2Y4jkFmrWPw2/y7a5MBPRJ2lw5ommdqNY7wPH+iliV xnTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id e11-20020a170902744b00b001cc2ebd2c3dsi9206936plt.161.2023.11.14.23.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 23:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 E03FE8029113; Tue, 14 Nov 2023 23:53:22 -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 S234654AbjKOHxJ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Nov 2023 02:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjKOHxH (ORCPT ); Wed, 15 Nov 2023 02:53:07 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70378F7 for ; Tue, 14 Nov 2023 23:53:01 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 442CE7FEF; Wed, 15 Nov 2023 15:52:49 +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 15:52:49 +0800 Received: from [192.168.100.10] (172.16.6.8) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 15 Nov 2023 15:52:47 +0800 Message-ID: Date: Wed, 15 Nov 2023 15:52:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 1/1] clocksource/timer-risc: Add riscv_clock_shutdown callback To: Anup Patel CC: , , , , , , , References: <20231115061811.10041-1-joshua.yeong@starfivetech.com> Content-Language: en-US From: Joshua Yeong In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed X-Originating-IP: [172.16.6.8] X-ClientProxiedBy: EXCAS081.cuchost.com (172.16.6.41) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-4.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 23:53:23 -0800 (PST) Hi Anup, On 15-Nov-23 3:00 PM, Anup Patel wrote: > On Wed, Nov 15, 2023 at 11:49 AM Joshua Yeong > wrote: >> 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); > Use riscv_clock_event_stop() here. You mean replacing riscv_clock_shutdown as 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 >> > Regards, > Anup