Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp446426rwb; Thu, 1 Dec 2022 04:22:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf538b0ftXlkrzoJaMiv+7U41KaVK+kFnh8yWJDe4hfpp0vqwTs5C/c7nvZgm+Wk+JZZprKM X-Received: by 2002:a17:902:e887:b0:189:1fcf:6ceb with SMTP id w7-20020a170902e88700b001891fcf6cebmr46238707plg.45.1669897366214; Thu, 01 Dec 2022 04:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897366; cv=none; d=google.com; s=arc-20160816; b=uLzsUVj7tN0vLD0k1rsYv+/NPJ615tme1r2EDWr7Vnq1zXhw+zrOyk+LJSFqio2u2E kAwNNHervD4sxP1RvaKK8s1jcyZXSEVachQwqgzc++ntKRPJK7od4PJ+hRGFEpTXhHfD LNIASlT564Fjv2rZVROZfNzJBt5yQF6bpaWnPUDqKOdWiyaWujtg4NYTFe5mOGhupZpa aMunakpWXtosEQEglCXW6K80lA8LJ0CS2egFdD3YenS4cMbSAYHc3N7u+S2Ns7Cm95tn DnD/X2swMrNmMGMfJOuxQzghO0jQj53qblB64tXzyT5QUqyRb8VFiSKUpjezmhnKefIK sy3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=oSyk3GVKETda3mJL2mVRTHou/k8k/Fy1bHpnYznVjrI=; b=Ll30GbEjOE+K4HEGkuZrjWYbyRJrpxdQQf+sgJGpQGcTfNvJlGqtjaYXMLVtzy/6Oi Wy01R9UhpGa9tDpPXiQjpWfRoAmiuxA6O26B3H7mcjA7cf1D4nB+4lgd7P4mACAF8ehD FIcgWH1aPUhjxexsxY+ywIgggNoMBCnXWoIpSWLE+E9Dofz/DDgLC2sXbQ5R+ia508zl 5WpL8dgLnL3+adbB7Wk9/w9bkge03zduFLxbKaCii2NLxfv2qhyfB6JtXe9I4B5MpPgK 4WRaxW7JUqSwAy03vH1LUzKThJN15n5EeuFGS/lBWELmBlzXqEmw5NglZS/j4wBCUuwU 3KNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JMiSkro8; dkim=neutral (no key) header.i=@linutronix.de header.b=nHbOklTP; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63040a000000b0047688fc8acdsi4450081pge.474.2022.12.01.04.22.34; Thu, 01 Dec 2022 04:22:46 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=JMiSkro8; dkim=neutral (no key) header.i=@linutronix.de header.b=nHbOklTP; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbiLALRa (ORCPT + 82 others); Thu, 1 Dec 2022 06:17:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbiLALQz (ORCPT ); Thu, 1 Dec 2022 06:16:55 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA57C5C; Thu, 1 Dec 2022 03:13:13 -0800 (PST) Date: Thu, 01 Dec 2022 11:13:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669893192; 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=oSyk3GVKETda3mJL2mVRTHou/k8k/Fy1bHpnYznVjrI=; b=JMiSkro8WVCbA9SXyXQVyg1BayfBEBBaIIwXOmgi7ELYhZ9nN+4ExEzLUrcsLKsXkVtvae 8Bhzh0m+h7xnm7wXafjWTz0O+5IVTHi3Es2fpwPtogZ+KQOxkaAgmtTNPdpPFw0vJ//XVI 13hMc9t7Dzz2tn9TuiJdZKCBezKOrGQI8k3S61i2BMjhUtv24oPGlWAQJ9kvPawDfQ4dxR gekGPFkmVcMk+ole7PEkOchyKUJdEMZB2jX15RQp0hb/n8P/HLOrBF9Jf3fhUgJdNE5ETP jY81oIBwDPEe7JizPYyzcZN+3kJn8O997mS16pFMNJ5wEjb9pxfrQA3cd2/lqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669893192; 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=oSyk3GVKETda3mJL2mVRTHou/k8k/Fy1bHpnYznVjrI=; b=nHbOklTPpDDIVsG1gcVNkXOQDBsX/+NKeYU90KhKWELrRdlXGjwoa5Coe9xRJZr9BUUJiI KzrP8SvIvtbDCuAg== From: "tip-bot2 for Conor Dooley" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/urgent] Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend" Cc: Conor Dooley , Thomas Gleixner , Palmer Dabbelt , Samuel Holland , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221122121620.3522431-1-conor.dooley@microchip.com> References: <20221122121620.3522431-1-conor.dooley@microchip.com> MIME-Version: 1.0 Message-ID: <166989319052.4906.3934360150862233210.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 The following commit has been merged into the timers/urgent branch of tip: Commit-ID: d9f15a9de44affe733e34f93bc184945ba277e6d Gitweb: https://git.kernel.org/tip/d9f15a9de44affe733e34f93bc184945ba277e6d Author: Conor Dooley AuthorDate: Tue, 22 Nov 2022 12:16:21 Committer: Thomas Gleixner CommitterDate: Thu, 01 Dec 2022 12:05:29 +01:00 Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend" This reverts commit 232ccac1bd9b5bfe73895f527c08623e7fa0752d. On the subject of suspend, the RISC-V SBI spec states: This does not cover whether any given events actually reach the hart or not, just what the hart will do if it receives an event. On PolarFire SoC, and potentially other SiFive based implementations, events from the RISC-V timer do reach a hart during suspend. This is not the case for the implementation on the Allwinner D1 - there timer events are not received during suspend. To fix this, the CLOCK_EVT_FEAT_C3STOP (mis)feature was enabled for the timer driver - but this has broken both RCU stall detection and timers generally on PolarFire SoC and potentially other SiFive based implementations. If an AXI read to the PCIe controller on PolarFire SoC times out, the system will stall, however, with CLOCK_EVT_FEAT_C3STOP active, the system just locks up without RCU stalling: io scheduler mq-deadline registered io scheduler kyber registered microchip-pcie 2000000000.pcie: host bridge /soc/pcie@2000000000 ranges: microchip-pcie 2000000000.pcie: MEM 0x2008000000..0x2087ffffff -> 0x0008000000 microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: axi read request error microchip-pcie 2000000000.pcie: axi read timeout microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer microchip-pcie 2000000000.pcie: sec error in pcie2axi buffer microchip-pcie 2000000000.pcie: ded error in pcie2axi buffer Freeing initrd memory: 7332K Similarly issues were reported with clock_nanosleep() - with a test app that sleeps each cpu for 6, 5, 4, 3 ms respectively, HZ=250 & the blamed commit in place, the sleep times are rounded up to the next jiffy: == CPU: 1 == == CPU: 2 == == CPU: 3 == == CPU: 4 == Mean: 7.974992 Mean: 7.976534 Mean: 7.962591 Mean: 3.952179 Std Dev: 0.154374 Std Dev: 0.156082 Std Dev: 0.171018 Std Dev: 0.076193 Hi: 9.472000 Hi: 10.495000 Hi: 8.864000 Hi: 4.736000 Lo: 6.087000 Lo: 6.380000 Lo: 4.872000 Lo: 3.403000 Samples: 521 Samples: 521 Samples: 521 Samples: 521 Fortunately, the D1 has a second timer, which is "currently used in preference to the RISC-V/SBI timer driver" so a revert here does not hurt operation of D1 in its current form. Ultimately, a DeviceTree property (or node) will be added to encode the behaviour of the timers, but until then revert the addition of CLOCK_EVT_FEAT_C3STOP. Fixes: 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped during CPU suspend") Signed-off-by: Conor Dooley Signed-off-by: Thomas Gleixner Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Acked-by: Samuel Holland Link: https://lore.kernel.org/linux-riscv/YzYTNQRxLr7Q9JR0@spud/ Link: https://github.com/riscv-non-isa/riscv-sbi-doc/issues/98/ Link: https://lore.kernel.org/linux-riscv/bf6d3b1f-f703-4a25-833e-972a44a04114@sholland.org/ Link: https://lore.kernel.org/r/20221122121620.3522431-1-conor.dooley@microchip.com --- 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 969a552..a0d66fa 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -51,7 +51,7 @@ static int riscv_clock_next_event(unsigned long delta, 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 | CLOCK_EVT_FEAT_C3STOP, + .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 100, .set_next_event = riscv_clock_next_event, };