Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3012844rdb; Wed, 15 Nov 2023 18:50:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5st5JmcR++gEbGeuf0X4XOBNrqqBHCE+IQzdm5m2676LeR6dQi39lwiUm7B29pNh6IH1K X-Received: by 2002:a05:6a20:729a:b0:15d:4cf1:212e with SMTP id o26-20020a056a20729a00b0015d4cf1212emr692753pzk.4.1700103047652; Wed, 15 Nov 2023 18:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700103047; cv=none; d=google.com; s=arc-20160816; b=JsYfpi8Jg8ot9Hi/l66TDJ0R8FsgEbJtVXB/P2fKOjpSL1vSCHYgfOlhWrHA77he5b 3Z9h1HCLo86yA5vukrDmdDQSx3DojXE06U+WTlqVTp1PcTh6xVYo3Q6rZkOVOuTNCHT/ RuNH/Iv97Q9O2vRgDyfEYS1KJj0gNPt23nFVEeqVvswxfmo72Gsp6gU4Dd2Xt1XI+ZY5 G6lktqYTIwrvNgi+0mSGhNvlJztkIIYDztw+AL8iLU4T/Q3H4NGp/QMuhz81Sp+g22jq MmScLTZ63AH6tkhK4xjg6N2BUUVe6wyphFxMCPH3yY4SUAsUn8LSe70sXFmG84IqvTNv LGOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BPw0YiRSVF/mcY61a5qdLMHQU9A/+5nvU5kL7Fa9ZCE=; fh=z2cKN12KRmE4MpUQwEAF0iAdxjgZrx4gdVIVbsLg2uI=; b=qXhx61OvwcnTUK4NjZKJtRtLO/VJ+fyXDo+tx157Deh0IaV0l2KPMbww3F/psr4avX BoovOnD2x4isMi6VZN8Yy4ceC1ROicErLmvWg085zQ5pwTX6XkPSQwovIkgNoCQqK59j go4szfyOy+I34suA9+urOWDgoQdAXAwIRFHlDmhrw6+La9Sd+mOpcZQeAa4e2BMfCsp6 DT7xYkNqtm417jTf1x9jxkGuGALIZKqbMkCqD1AGou7R4nLBDLTg/9CaNY5EB1jxH6MO PLsGaxMQlwkikw/acPTAPlEKzSaV1YnWUu6UfdhxakCaPOmt7Jt2f1wjQD1vdkA87hnB hiqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ThCBkhLK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y66-20020a636445000000b00578b63123desi11421924pgb.789.2023.11.15.18.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 18:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ThCBkhLK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 20D208069209; Wed, 15 Nov 2023 18:50:29 -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 S1344463AbjKPCuU (ORCPT + 99 others); Wed, 15 Nov 2023 21:50:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344286AbjKPCuT (ORCPT ); Wed, 15 Nov 2023 21:50:19 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AB2A197 for ; Wed, 15 Nov 2023 18:50:16 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09C17C433C7 for ; Thu, 16 Nov 2023 02:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700103016; bh=el9qUyLvNgMrjxL1FD9aYdkmO4QTjO2ht03NK0ZAD+I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ThCBkhLKtmT1QDaTzAnEy9gUrGCituZ3SeotGg6TxeTK1OYY9RIBzWfSwZmBBdQ6T tq6t0inYR84wbgz67lX9eGx7Vu3ogl+/T/bGI+5C5grDBExqvYmR7Dc7IcHHFaeMGi dZtO/KGqYY66dEN9jKe5NZKnsCgKPhRTJ9hUo0sOKhixZHftwG8eLBOC20e1skpFOe z4q+JFsSxAGDr+mXBB6GvqbMMGuUKErJd+oDQ8EVNNlPZn0bjvIW+t2I0VuLv+cD9i rGmFdiu1MEiKwsDxnTmfettC9R+ONVj13Guiy4APjT4VPAKTq90bkSa++nHI4UOQf/ tnc1qb0flnv+w== Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5441305cbd1so464597a12.2 for ; Wed, 15 Nov 2023 18:50:15 -0800 (PST) X-Gm-Message-State: AOJu0YznArY2MQrKA27OCs+CfxhekoKH7lep5J9didVkcSIDKnWW5r67 Gnq4G6foniQXjUDxGtq7KpkDeaBwZeHcpb/ISO4= X-Received: by 2002:aa7:d413:0:b0:53d:b1ca:293c with SMTP id z19-20020aa7d413000000b0053db1ca293cmr9136824edq.22.1700103014506; Wed, 15 Nov 2023 18:50:14 -0800 (PST) MIME-Version: 1.0 References: <20231114114656.1003841-1-maobibo@loongson.cn> In-Reply-To: <20231114114656.1003841-1-maobibo@loongson.cn> From: Huacai Chen Date: Thu, 16 Nov 2023 10:50:04 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Implement stable timer shutdown interface To: Bibo Mao Cc: WANG Xuerui , Peter Zijlstra , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 18:50:29 -0800 (PST) Hi, Bibo, "stable timer" is Chinglish, use "constant timer" here. On Tue, Nov 14, 2023 at 7:49=E2=80=AFPM Bibo Mao wrot= e: > > When cpu is hotplug out, cpu is in idle state and function > arch_cpu_idle_dead is called. Timer interrupt for this processor should > be disabled, else there will be timer interrupt for the dead cpu. Also > this prevents vcpu to schedule out during halt-polling flow when system > is running in vm mode, since there is pending timer interrupt. > > This patch adds detailed implementation for timer shutdown interface, so > that timer will be disabled when cpu is plug-out. > > Signed-off-by: Bibo Mao > --- > arch/loongarch/kernel/time.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c > index 3064af94db9c..2920770e30a9 100644 > --- a/arch/loongarch/kernel/time.c > +++ b/arch/loongarch/kernel/time.c > @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct clock_even= t_device *evt) > return 0; > } > > -static int constant_set_state_oneshot_stopped(struct clock_event_device = *evt) > +static int constant_set_state_shutdown(struct clock_event_device *evt) > { > unsigned long timer_config; > Please remove the whole constant_set_state_oneshot_stopped() and move its logic to the below constant_set_state_shutdown(). And it is very strange that this "bug" hasn't caused any problems until now= . Huacai > @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct clock_ev= ent_device *evt) > return 0; > } > > -static int constant_set_state_shutdown(struct clock_event_device *evt) > -{ > - return 0; > -} > - > static int constant_timer_next_event(unsigned long delta, struct clock_e= vent_device *evt) > { > unsigned long timer_config; > @@ -161,7 +156,7 @@ int constant_clockevent_init(void) > cd->rating =3D 320; > cd->cpumask =3D cpumask_of(cpu); > cd->set_state_oneshot =3D constant_set_state_oneshot; > - cd->set_state_oneshot_stopped =3D constant_set_state_oneshot_stop= ped; > + cd->set_state_oneshot_stopped =3D constant_set_state_shutdown; > cd->set_state_periodic =3D constant_set_state_periodic; > cd->set_state_shutdown =3D constant_set_state_shutdown; > cd->set_next_event =3D constant_timer_next_event; > > base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 > -- > 2.39.3 >