[tip:,timers/urgent] Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend"
Message ID | 166989319052.4906.3934360150862233210.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp204968wrr; Thu, 1 Dec 2022 03:24:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7HdLqGnqtPqt20hn1nBosQ7na2dAVQnek6sK+j2dZ+YZMbQTyXLn/93zOwgJaHGWSHwnLz X-Received: by 2002:a17:90a:ac08:b0:218:f733:d9c5 with SMTP id o8-20020a17090aac0800b00218f733d9c5mr39308132pjq.195.1669893853673; Thu, 01 Dec 2022 03:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669893853; cv=none; d=google.com; s=arc-20160816; b=eJsZ+eIS7bXzoTmRn8MXKd9Pwi4Y058SvA4VufhUZcP3lExRWnyvtukMzx3egMWOj1 90XE1ssRsqsdLqQCHjKduksvvVljBtALaCfQTv8Z5oNUPnmRHzak6e/NUDxJsnIS8MNI F2G1KRQSU5kG57FYUiS9oQuZrcpAaeT2Gf1fyUB/EFz+88bd0EIuTK+6FhbbiIv/NLsc 0WUYQo5kijtLki7M8gZ1AZkNKoFa2KzTCXKV3jiu4BTpGZRl1XGYwW5E26YB/XkmAxur tpre+4pA67wIGdeEWSGdc1H+U8MBUGf4iVRbyfvVZiQj4UkiIn8QwzeZdGTOnOGUOZbh rPlw== 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.s=2020e 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a63d94e000000b00477b4b68f09si4077871pgj.258.2022.12.01.03.24.00; Thu, 01 Dec 2022 03:24:13 -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.s=2020e 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 <rfc822;heyuhang3455@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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" <tip-bot2@linutronix.de> 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 <conor.dooley@microchip.com>, Thomas Gleixner <tglx@linutronix.de>, Palmer Dabbelt <palmer@rivosinc.com>, Samuel Holland <samuel@sholland.org>, 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: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750199081559725636?= X-GMAIL-MSGID: =?utf-8?q?1751010617438218871?= |
Series |
[tip:,timers/urgent] Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend"
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Dec. 1, 2022, 11:13 a.m. UTC
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 <conor.dooley@microchip.com> AuthorDate: Tue, 22 Nov 2022 12:16:21 Committer: Thomas Gleixner <tglx@linutronix.de> 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 <conor.dooley@microchip.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Samuel Holland <samuel@sholland.org> 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, };