Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp162788lqo; Wed, 27 Mar 2024 09:30:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdgfndKC3D8seg3mf5lCiED7dw9xtIVoS/Z+x8wc+1lv09UEAighar14XE/A/45S9rjhEXAdh4BxGpgCwhLJHuz8zM5O3XLXY0/C60KA== X-Google-Smtp-Source: AGHT+IH/eBagSinFjRrKTxTc/OabaBIQvt0sjtHLgC7WWuwErZI7yrtRaoTMi+UpJzG0QS8EK+Aw X-Received: by 2002:a17:907:9812:b0:a4e:ca2:f597 with SMTP id ji18-20020a170907981200b00a4e0ca2f597mr83577ejc.30.1711557032225; Wed, 27 Mar 2024 09:30:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711557032; cv=pass; d=google.com; s=arc-20160816; b=ecuEibopW4OTBVX2gsQbhXOboepQK0vFxO7N7A6oQRvXvwApwx0penY4etwm2cmSzr +M627suIt8HxoDtUBIEmOEhOmKsaOW+mXmg6yT5TIZ9CH947fRS/k5yKCgmQzk5o3QdT FdK4XSycRFda/fDkBmShpJPHZpSss93BU9Sqb8xi4vJIMHJ/V5j1TZp+cZL4e66QQWE9 5MXN+ej3OiD0VHRo5y1MGf+fbzvwWZ1kUUXvrD0f49IOae1mNrEggu3RZ0g7tQgpUCrD ljQjt+4tijgSt/A9KvoD3RvDYYVy2w4gD5xqxzZ4nXSQWM6w5/8QuKQdZns/3PtWcw0X KGjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Y3/CPQu0kt0AK01jL1gmP6nDgmIk8fvdY19xmLzWhxc=; fh=z5ZO+qPsYqpzOZhhvtsVMumpFDqv7tEOHdzGBqZezps=; b=I4Uo5VxfNZXIMAYPoaAJOPWJlRO9tEbw5OMmzY3S8MekmNdA4yg6Sq/nXBnTOBR6Z5 iYyjOWNUsnFHy546jz1zbIEFH6szFwfIUqix1MTX35qgZmvHRVTPXj9E62r7L8zy1/3Y K1M83OIeTcDWT2gtssMisaqIQN0lRc1uc+v5i8+sS4PaBqtrheypQ67u3Ikgo4dUDR4v K+lTCEsON19wRfGYU4KnYO5mjizv/B6ZAitE3BO3Uf9CkHKxDxnQZgLpgpNd4cSDq6th hUFUL/445P16C5XOmc3DigMxsz6Nimm7MFRrwQfEagHAooJs6oFWUm/vVhbLEloB+N9B tlOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=X1YrToIE; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-121632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121632-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x7-20020a170906298700b00a4e0ee2b12bsi167796eje.190.2024.03.27.09.30.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=X1YrToIE; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-121632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121632-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F12ED1F3158B for ; Wed, 27 Mar 2024 16:30:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 528B4131BC4; Wed, 27 Mar 2024 16:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="X1YrToIE" Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95D0A12F394 for ; Wed, 27 Mar 2024 16:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711557020; cv=none; b=XqmBmUuaEQ3I5HCn8a/S+eonxElR35swlAsuKPUGYtmhT8WRDg+quPxbiqWM7lMA57oVVdWQpJONtYGIkCsg0OmStLNOhMBL6dY04AM3fSFECyDqxNCwW2vae+O1/X65HzlXw+JCQgH7M8mi8Tz4SrEvyZwQnOp/Cp8QE3LI8Po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711557020; c=relaxed/simple; bh=7lYhr5rYnI3FxdZmdKOYuJuz5A6ebiYutbR0u/5ejF0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AEUD+7JKJPV9+4b94b4EL2iOuuHXIe+eETq1YdlChcBvtQAlsCdB+fsyA6JZ5h7t+ZjVtXwX9oSWJJFrYFGacMMuvWogNlr5rBTKxUmLjE/b/kUUFtxEzGyQLk6SJriPDX2mR1CVPbH2B1pkotfc8vmStPwWfRhOWYTNg7nuAHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=X1YrToIE; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7cc864215caso243628639f.3 for ; Wed, 27 Mar 2024 09:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1711557017; x=1712161817; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Y3/CPQu0kt0AK01jL1gmP6nDgmIk8fvdY19xmLzWhxc=; b=X1YrToIEWbucSZinabH7a/qI2G/G/z8chDkmVa01DXHqvnjsDb4uBs/U+GiC3IiaLg kgQTiDNqd/bUDOKnIs0gJ5xcQZk9QeHetNYQ1p7YgMdjGu3Jvg/VFXuTzCmVbcgiqgmz BRyHsJZD/D2XxeYG+xBXJbW8isx7kuLAHlGCl36bizmOudYHCQEKB130C0Ym3wP4EbXq QjMBbqI60TcDWsVUeoUllxzK5Lu9magd0I5io5ZvV1FDc7IHgU+zva/17RfE51Z1EJAU Okxc2IWmZ6Wu4nofn+GebEaGM96msvo9ZkaDHjUcwfpG/oxk6tBxbKt8k73NXFPn1I51 T5bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557017; x=1712161817; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y3/CPQu0kt0AK01jL1gmP6nDgmIk8fvdY19xmLzWhxc=; b=bfIRem8Wl2toVcz7wQeYgsUgYFE7hRz+gmb7TlUtR1LQfX01NFd68X/5gxmc+6Np0c 8e49f1QFasach7YhxvsS7Jw8urbiyM54B/fN3XL98PRodi+ipMOYmleXurseBYk4C9EB PKnbNgdHRO12QouUMJNeaJAU+Gh2XYrxyKqL7sEvK5p/ZW9HpWSPcsTGPeGx3+4diBZz MWhYujaM45jVlDGVYsrMxlihcfsaoS7jmz71AhvIaZK1p9ABlzlBB5AmD6SI+CW7NPfI 1CHj7N1rRYHRmoCAnpbxSAD8OeqNKokynkk9VIhTVTd9rEkAQ/t/ss/xzW1p6kDmiMUX 3MRA== X-Forwarded-Encrypted: i=1; AJvYcCWz8PMzz2iHPSxlG5//JeUL2pBIik1GuwsaTG1LG1Wv+FaSmiCzaGwV1bIAKjKgHyQrUUnTPxgkJn6QqeEttVvx05AKm+YVC4mxTQ57 X-Gm-Message-State: AOJu0YyAL4NSCq4IaZDkHiheXDpCjUNPML26I2hhK975zgCyhD6lAJfn FyJzuYpzlU3MpNcY9BCY3ugtbmia6VMHyoD7e6J0ob9V6QitogK2gkYXS3R1TOo= X-Received: by 2002:a6b:da06:0:b0:7d0:2b22:7221 with SMTP id x6-20020a6bda06000000b007d02b227221mr502270iob.20.1711557017625; Wed, 27 Mar 2024 09:30:17 -0700 (PDT) Received: from [100.64.0.1] ([170.85.6.190]) by smtp.gmail.com with ESMTPSA id h8-20020a056602130800b007cc840d1d0bsm3647584iov.25.2024.03.27.09.30.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 09:30:17 -0700 (PDT) Message-ID: <4f89f7e4-cd89-42a7-a13e-5eb25f7b2f4e@sifive.com> Date: Wed, 27 Mar 2024 11:30:15 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] clocksource/drivers/timer-clint: Add set_state_shutdown To: Jisheng Zhang Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner References: <20240327153502.2133-1-jszhang@kernel.org> <20240327153502.2133-3-jszhang@kernel.org> Content-Language: en-US From: Samuel Holland In-Reply-To: <20240327153502.2133-3-jszhang@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Jisheng, On 2024-03-27 10:35 AM, Jisheng Zhang wrote: > Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when > switching out clockevent from clint timer to another timer. > > Signed-off-by: Jisheng Zhang > --- > drivers/clocksource/timer-clint.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c > index 09fd292eb83d..56cf6c672e6d 100644 > --- a/drivers/clocksource/timer-clint.c > +++ b/drivers/clocksource/timer-clint.c > @@ -119,11 +119,21 @@ static int clint_clock_next_event(unsigned long delta, > return 0; > } > > +static int clint_clock_shutdown(struct clock_event_device *evt) > +{ > + void __iomem *r = clint_timer_cmp + > + cpuid_to_hartid_map(smp_processor_id()); > + > + writeq_relaxed(ULONG_MAX, r); This needs to be ULLONG_MAX to produce a 64-bit value on riscv32. Regards, Samuel > + return 0; > +} > + > static DEFINE_PER_CPU(struct clock_event_device, clint_clock_event) = { > - .name = "clint_clockevent", > - .features = CLOCK_EVT_FEAT_ONESHOT, > - .rating = 100, > - .set_next_event = clint_clock_next_event, > + .name = "clint_clockevent", > + .features = CLOCK_EVT_FEAT_ONESHOT, > + .rating = 100, > + .set_next_event = clint_clock_next_event, > + .set_state_shutdown = clint_clock_shutdown, > }; > > static int clint_timer_starting_cpu(unsigned int cpu)