Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1441020rwr; Wed, 3 May 2023 15:32:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JMUTf9TSOTuSsyUi5XIzPePGRiAoNuDPCf8MPIdFwK/j3+B+5rg20G6WWZ0h3CoSvN/J5 X-Received: by 2002:a05:6a21:3292:b0:f3:6f93:1710 with SMTP id yt18-20020a056a21329200b000f36f931710mr333020pzb.0.1683153172952; Wed, 03 May 2023 15:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683153172; cv=none; d=google.com; s=arc-20160816; b=tCwrW0LubCGPhJYX3euyjM31ILcETDAAuezVQ9yLwdvapXPATdPWBJJQqeTYVWSeJO 548RFLUWkaUU+U1EiHt+zbAHY1XvVv5FmvDLhrKllrWFWvHGPZwROT74pq5UJoLPvZfy 8a6r85nC4igZJMQ6nPRiYf7/PfL2pk4Dh68EXQrz9FFBnU7kTRUETPAZiAUXz5B4i+Vo pfps9K7/Xt6qnSTyF9soQlN2tFw/2rYjtPXOyA5BYeUAXgLtoBXTmadl8joesN1cHas4 C9QcyFADek5nrV1u3VEqiPGcwmCD3TOLzjI7KJIXGl7fAQO0r+dZx4WlC1AKApfIsmXj rhmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W/FVgclAfIbt4nHSwZVbOR2V60fsWrI1zOWgyjTaMKs=; b=H6xe1REJDa1fIRTj+PH2GiUbfsbtcgS5J94+cwk6R67h3F/eO7INsHni+nk9D1RpnE +7yKN1dlMbfvYiEOAmLP+tWT9Ls65cHrppUIQQTgbonYRiOHCTfJb8j+F62QH8kVqHsN 7y7Fvq/bVJp4jpWkfD2A86nhq6Xduf7/QcmQjjBPKSit5C0kM9MqDp9HQAI9h43aHJy6 Iw+IRR5sDV2WoKYhi4O+wYgZ8N82Rkq1At17P22XqVe9bRbs2IFwRnPRJ5F6nMnzFDR3 9dCywNZbPwqr4SSGm0oBL4eO33m9TsZb3plFDC/aoAW5OSELMa4pyXYKsAr19+gctQ6X UecA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s2caT3xq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020aa79e08000000b0063d24857c5bsi34090464pfq.43.2023.05.03.15.32.11; Wed, 03 May 2023 15:32: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=@kernel.org header.s=k20201202 header.b=s2caT3xq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbjECW1H (ORCPT + 99 others); Wed, 3 May 2023 18:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjECW1G (ORCPT ); Wed, 3 May 2023 18:27:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DD27DAC for ; Wed, 3 May 2023 15:27:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF65B62F18 for ; Wed, 3 May 2023 22:27:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCC53C433D2; Wed, 3 May 2023 22:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683152824; bh=AVfR9qQTVgZMvpZKp09wG2HIaHnOun4pCekn7lAU86w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s2caT3xqBd3NFp/pjaQsGMYH1qVp2zMvaHK7bjjYKtR8DVy6jO721estVaE1kR1cU 7UuDl0en/+cm+ADGlDreSBhGzOpguPLXXPNe/D53BJIJHH8YFjS+42JEaGiUy4+qQZ 318BJ8d22nD5Do0GErf3egdPSgiQF6QdHR/9P9LkVpCMwCEC90GUnuw44Qvixb5pCa +A17rcPmofzex65nugMeb+h3Bf1YjjbCzgfqaOXT18gbOnMilAAM/EPqwp1Ke/D4BK Jgk020pDX1E1sSUnaPnUSamtCuIQTNUR5AjEmhOc1sr3ZjtvkCk6H7IVpI814IMSCb WlX0ZXxg2PrAA== Date: Thu, 4 May 2023 00:27:01 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Victor Hassan , fweisbec@gmail.com, mingo@kernel.org, jindong.yue@nxp.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tick/broadcast: Do not set oneshot_mask except was_periodic was true Message-ID: References: <20230412003425.11323-1-victor@allwinnertech.com> <87sfd0yi4g.ffs@tglx> <87jzy42a74.ffs@tglx> <87y1m652n2.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y1m652n2.ffs@tglx> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Tue, May 02, 2023 at 02:38:57PM +0200, Thomas Gleixner wrote: > Updated patch below. > > Thanks, Looks good from my layperson's eyes, just a doubt about a comment below: > + > + /* > + * When switching from periodic to oneshot mode arm the broadcast > + * device for the next tick. > + * > + * If the broadcast device has been replaced in oneshot mode and > + * the oneshot broadcast mask is not empty, then arm it to expire > + * immediately in order to reevaluate the next expiring timer. > + * nexttick is 0 and therefore in the past which will cause the Is nexttick really in the past? It's set to tick_next_period... Thanks. > + * clockevent code to force an event. > + * > + * For both cases the programming can be avoided when the oneshot > + * broadcast mask is empty. > + * > + * tick_broadcast_set_event() implicitly switches the broadcast > + * device to oneshot state. > + */ > + if (!cpumask_empty(tick_broadcast_oneshot_mask)) > + tick_broadcast_set_event(bc, cpu, nexttick); > }