Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445016iog; Mon, 13 Jun 2022 06:07:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMiBDNUrmQqRDiAJTaCOLmNgYP78kOh4nv6NUWF6Yjj4QdvjoC/MhUldrszqo+qVX+nK44 X-Received: by 2002:a05:6402:278d:b0:42e:d3d5:922e with SMTP id b13-20020a056402278d00b0042ed3d5922emr55830026ede.154.1655125674699; Mon, 13 Jun 2022 06:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125674; cv=none; d=google.com; s=arc-20160816; b=0PPyFU2FfqBGvpjXhwIg6b2EMlOv4RgaAZoQ8HLRsrQFB6S8g+pVPtRnqrFaKITXbf d/Ti+/VpFpWiykcUL/1nHur5czzcMZ54bR9QZwLzlSeS+HsXeiTxZeYf9dU1fHcWs7Vt FYjs6tYhsWD9GO+GuS8/+9P5EAg3GFLuXmkxQjaNJKHIE7r4ClJo6UguGcqtJggiS3WP /MV6nJ1JgMV3CSmh2NWfrdbeulnLr/lqnz30B1fEY4AbGhq/4CN8Q1bUxfYSFeN1n1Li ZSeuUu2bynlUnsJpJTnyR23l+pUB3pd3T66LZdNjSG0JiLUwwoJuSQeHtVNGkyeT8DBk LDYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aOVXnJXJzWeOqOp0s/ex3fu2CVxT1S4H8WlhnceoS9I=; b=npfx4oha/pfYA0DPMHXAaFjj8PHwgRFZM4WuXDn8jd+q1Jc/JdIuzUUZNQGeu/NixJ gK1sUXX6YzesMSzvo07MFW5MBkEcpgsOnFJBhs8Ud72BQ/HQ1hGjWY5zx/B1ir9ONmra 64d/Bq2yXHSNDjKFvqJX5bM8QQta2hAF1AJhrs9y0SMDA7cJHevAVvQxXZFcSlSqSnkS /Co1OLHqtk/jMrGP2SCzFIZPWIzpOOIZ3QBX5rAwt9c2sph1GB1lRm+onMjnh089g0p0 w5oPAntxcfOWvxOtnxoDtXN//ddGh3D6oK8dzN1r4QgkXnN42mOjXOmfCLjD41mqQs58 Vx5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AUojk8F9; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a170906729a00b0071573d2df78si7147577ejl.429.2022.06.13.06.07.23; Mon, 13 Jun 2022 06:07:54 -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=@linuxfoundation.org header.s=korg header.b=AUojk8F9; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354393AbiFMLhZ (ORCPT + 99 others); Mon, 13 Jun 2022 07:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354846AbiFMLaN (ORCPT ); Mon, 13 Jun 2022 07:30:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 078FF3FBE3; Mon, 13 Jun 2022 03:45:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id AF6E6B80D19; Mon, 13 Jun 2022 10:45:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0987CC34114; Mon, 13 Jun 2022 10:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117151; bh=BeBqk5VRdbWi7Ojglx8xzis/qKTh3Zs6eNwGThBryHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AUojk8F988vEujsT8SCMLQiacJDkhWUi8AVjXBYugG9v7jTUaN/zrK9cff4GxMIVa Yp/QRXLPUdrrt6fYG3ZiF+H8BJogGjMeRPz/uP+EnoYdNU4wwtBtFrcMyhIkyGdS1/ zwgFxmDJjWPeI4wmCvE4JTUB+WbAbxf0TGaXeFNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Holland , Anup Patel , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.4 304/411] clocksource/drivers/riscv: Events are stopped during CPU suspend Date: Mon, 13 Jun 2022 12:09:37 +0200 Message-Id: <20220613094937.868065045@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.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 From: Samuel Holland [ Upstream commit 232ccac1bd9b5bfe73895f527c08623e7fa0752d ] Some implementations of the SBI time extension depend on hart-local state (for example, CSRs) that are lost or hardware that is powered down when a CPU is suspended. To be safe, the clockevents driver cannot assume that timer IRQs will be received during CPU suspend. Fixes: 62b019436814 ("clocksource: new RISC-V SBI timer driver") Signed-off-by: Samuel Holland Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20220509012121.40031-1-samuel@sholland.org Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/timer-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 4b04ffbe5e7e..e3be5c2f57b8 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -26,7 +26,7 @@ static int riscv_clock_next_event(unsigned long delta, static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = { .name = "riscv_timer_clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT, + .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP, .rating = 100, .set_next_event = riscv_clock_next_event, }; -- 2.35.1