From patchwork Thu Jan 18 19:23:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 189330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp572140dyb; Thu, 18 Jan 2024 11:25:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHb0jYXblVrFqlETTb1/DDwyeuaUi+LZug9ITYiMuL0cTlJ5Auy+thZbr4QBHnTDjj2nz1/ X-Received: by 2002:a05:6a21:150a:b0:19a:3d01:99ae with SMTP id nq10-20020a056a21150a00b0019a3d0199aemr1736835pzb.57.1705605942122; Thu, 18 Jan 2024 11:25:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705605942; cv=pass; d=google.com; s=arc-20160816; b=qoLcPsQdN3/2C+Tq6YjEf0CWimd/7hEPFtNmVAXEmKDzD7Qdhehm58jHkZ6H9957eV xw/rVMy13Y4onljvvHDWoWC76i6NsADCJE7BefPfUUwIhN49A/f1BYZZ8tjc3HUB3rRr xq+XBfcn1fcmeM2L7dJgpkM5+0Gc9YxikSRjSejYdKxQTHKW/ny5bd/1ZcOoDW27VH57 TnFJW7T7cvGJGtc2ZnLCrzAN5cNcmnh4Ac31eucO9tIBbPA1hi42TFzaKbRRIEi2jbrN GF9T5kKSfGqvU5SAVZJ7mXj+jP5ROP82vV8GEyzGaFxqYBB2lwtaXs6Ijt9pl1TVz0UY 5fbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=xnIpWqev2LgwO8Ow1GD+t6pP0ociRd6H33tAplbXrUk=; fh=s9pLbVodJXefBBbeS8R3C1MyZ1Q1bEMVefbhlECeRbM=; b=fkJJoGg8+ON88ATOMnieVZR65Y//Gd5fDo0acsIyEXWmPGAv4oKiPGI3JE6i31DzP6 btVEgyUmW5aWMCjsiBV6ltrQuC3tzJVQtw6oTAWtimtE9xagkkl1EakYkBCteQroA6ZP Kb2a3cqfeXkkRbyGxye2EDKXFZ26UVuvVClcIlXzX+4KrUQx+mkHNgwmAmd+4KzEHqT1 23rvYkzPvVURt5QuIdnDoBMqZE/dunZlsjNQlr0cBAEsA3L3t+HKyaQwTYcHCODfAzVE nT8x6oPiTTONu0NSWV6DCFp8aeIJrEPif51QuZ6DqV9uWk5cPnuBIMdoWxIZABudhklo G9mA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v1RVh8N+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-30510-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30510-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u16-20020a170903125000b001d6fd932a81si1952419plh.275.2024.01.18.11.25.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 11:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30510-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v1RVh8N+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-30510-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30510-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 24D8BB24AF4 for ; Thu, 18 Jan 2024 19:25:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0B68321AE; Thu, 18 Jan 2024 19:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="v1RVh8N+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="l5HNtTYm" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EBCB2E641; Thu, 18 Jan 2024 19:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705605842; cv=none; b=GxMF9VuJ9laSe/SNcHHDeAyfSH7YZZCWGz3RY9y20qhrfOg6frVW0dvOgbXPV+lS56f+2M19x0SDz49Vg9khLkyp32wAPquR3sgc2VJw80fWesWjNAKkztLivEbN4RiQRd05McOAdfTkxkHPZiOY0Yt63V0A6XcBkBKhcGLwF/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705605842; c=relaxed/simple; bh=IQQtFURNvODIyaNvAuKT7JPni73b4s8l2TDrTyHUN08=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=dVR7Wk/ltRwXy4xgbaP9QOm5wITx7nhkHEVjWafY3lEH0mi61u8JysmrtU3eVJ/gsqq+aKb4FoO6LWRbmEv9Q7QT18DAt73Npk+6BJXOkGTe5CwUtj2alhv7lpzJ1gNNwTO7i0pHti2USYEp7I2Lk+Gobo9gKZaXc6AzEKMuF3I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=v1RVh8N+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=l5HNtTYm; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 18 Jan 2024 19:23:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705605839; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xnIpWqev2LgwO8Ow1GD+t6pP0ociRd6H33tAplbXrUk=; b=v1RVh8N+ZiGCtAGsO4yxoeGJyWHEJrIywhLLcvlCxA2lOLNifcCrTdGi9nb786xgvQeR7E RDJ71FNz36JevSDJjmAh/U0oQTE1HbVwa09E3qZ3uxb37Q39v01v34gMjMYCNh1u64iSHe TIkBV4nEvCdg6QgKaOVvm9Zvg5rXjY3g2cmuQnWr265E/qhUF9A5e5YVV0fajuHhtocYvM VjyITKQ1BtN4X4Zwmxk+DpaR9qM/b5mC15fg6+4OFCygZieVWVIPfWY+fpNBKChLSeBUKu 6Y5x/YZjuDiEpIR+CIg7II2m9nKUghQYQmwqgU0O8NTLzS6Z5Fre3+4ySDP+BA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705605839; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xnIpWqev2LgwO8Ow1GD+t6pP0ociRd6H33tAplbXrUk=; b=l5HNtTYmSueFVepDrpX9uvpC77E617HsQX/jfGvHznnv6H85SkJ/84hFAvS6UGV1Ms6GiW jHwX1+dBF7iFQ9Aw== From: "tip-bot2 for Joshua Yeong" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/timer-riscv: Add riscv_clock_shutdown callback Cc: Joshua Yeong , Anup Patel , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231116105312.4800-1-joshua.yeong@starfivetech.com> References: <20231116105312.4800-1-joshua.yeong@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170560583897.398.3924693885126380500.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782717687045568530 X-GMAIL-MSGID: 1788457456038506856 The following commit has been merged into the timers/core branch of tip: Commit-ID: 6a902b118e7f30dbf0e6248f7b0f97e12c0939c3 Gitweb: https://git.kernel.org/tip/6a902b118e7f30dbf0e6248f7b0f97e12c0939c3 Author: Joshua Yeong AuthorDate: Thu, 16 Nov 2023 18:53:12 +08:00 Committer: Daniel Lezcano CommitterDate: Wed, 27 Dec 2023 15:37:11 +01:00 clocksource/timer-riscv: Add riscv_clock_shutdown callback Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when switching out riscv timer as clock source Signed-off-by: Joshua Yeong Reviewed-by: Anup Patel Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231116105312.4800-1-joshua.yeong@starfivetech.com --- 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 57857c0..e66dcbd 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, }; /*