Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3191244rdb; Thu, 16 Nov 2023 02:54:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJt88i/OMBXtZwseGyrLw3AfhESRWkhraaV6KYTLpeFd3vh6vfDyw773xaV6tcqzEdkLQl X-Received: by 2002:a05:6830:2b10:b0:6d6:47c7:1abb with SMTP id l16-20020a0568302b1000b006d647c71abbmr9560849otv.22.1700132090715; Thu, 16 Nov 2023 02:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700132090; cv=none; d=google.com; s=arc-20160816; b=0g49lDzatUvBLLy6HnXB+ybrZWnq0WmcoSDtmwzC5q9Op2ebvOpZmxOV4PCbGONB+3 LfOiCHR/fW8yrkObR8Oz/TWAZU58FtzNmZWi8srXlkVscdSHDTxSq602AfJM+TikR+jd KsDEsh2KH8+yvQrSUAEFdy3sVmrz0NigxrIsChakTNxAQT9NmlfMQibFZsZNwqt8x5PT cvWmpAXNaGpN0NjgYBTnXrf5O7gG0EZXVmolLyKoEW1q5L0KHa6jaqK4zlv67OnMBoHf RWYT7fCecUTjf5fZ0qWTeYJ4G6QhqnkmzGi8c+eXtDtk3J2U+px7Tvv8FnurZ1BrKJV/ MN+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8Ijt5qzEoOhsErqZBpzAVUY/ua97B8nzSlZy1SVOa1k=; fh=dDWVdWxoxdu1HIuuzfPrwpYb/Ru/vsdmeSAG6aE0X68=; b=unEkC9+d2r/TqKQUPRITfrYhhGSCMz5SmiUiPb+9SPazV2AZWMynquiRHAdFaKgNJD sFBGPklGKoPVBpZCl28lcyAxDlRGiY+8n9ANk0UCC1/TPh7OUOvtTWxEQC0LODR2XYDe qtu6Xa2KOjoNkNcdhbi6JKxhNbncSEquoPeWHDM1s1oPQBFJtqHX8FLPqT85/p13UZj0 caaUEcaLTqROE3lDskW4N7zgmboiHLYbDw5Tlhc47cS4kIhFXarvUYJg4j0IjIdvyeSR aY8Z+F8z0kNakWpa026BKJD0/ffGTVtxjLQvg0s1ffWKLtj9Gphmo0LEH+QiHt2akiY7 bqSw== 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 a65-20020a639044000000b005bdf597ed49si8759662pge.56.2023.11.16.02.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:54:50 -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 09840817ABDA; Thu, 16 Nov 2023 02:54:43 -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 S1345061AbjKPKyT convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 Nov 2023 05:54:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345060AbjKPKyQ (ORCPT ); Thu, 16 Nov 2023 05:54:16 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67B918B for ; Thu, 16 Nov 2023 02:54:00 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id F0CDE80C7; Thu, 16 Nov 2023 18:53:47 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Nov 2023 18:53:48 +0800 Received: from localhost.localdomain (161.142.156.149) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Nov 2023 18:53:39 +0800 From: Joshua Yeong To: , , , , CC: , , , Joshua Yeong Subject: [PATCH v3 1/1] clocksource/timer-riscv: Add riscv_clock_shutdown callback Date: Thu, 16 Nov 2023 18:53:12 +0800 Message-ID: <20231116105312.4800-1-joshua.yeong@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [161.142.156.149] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 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]); Thu, 16 Nov 2023 02:54:43 -0800 (PST) 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 57857c0dfba9..e66dcbd66566 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, }; /* -- 2.25.1