Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2116462pxb; Fri, 5 Feb 2021 09:18:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJys34bxhUAtjj7/D+sC8ZZ5IyV+ywSYaCWN2ZiMJfsWHlWzrQ833I9iD+hKeJtNdMjz7kGg X-Received: by 2002:a50:acc1:: with SMTP id x59mr4484315edc.43.1612545514907; Fri, 05 Feb 2021 09:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612545514; cv=none; d=google.com; s=arc-20160816; b=TrRtvJXAoqKDQ97wWMkapQYRi8/rBrugK4X1AvswjlcHclRxCK9GwyZwOGdX7gidWA zIurv2bR1EJhGuZzKxwBiv9/I3DPSpd0fxRRDSi5ceS2m3AV2xpl9DH19KBYGFqGkGnn 3ZqeoqyRTiMNyQX6DCHqLHoKZKPVw0ABOfRawYmslSlnaMyIssYeF5od1bbMy8UvPD1X xuaUgnE4I4/wtLj2u4zgwsa/eQGAHOg8mKhgjBhItH39mYCDj13mZzyo9eqISqSAWMb3 ncdYxaclKUKr9TEHlUirnpMUGhdduJ+GalaH1uE3THBmjEqf8sJb8c0ORVriOE2/uy5n 2PQA== 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=2Rh5Yxk4TOiEVVCLvfzyyZU8viIhD1Vne2otryahZ2g=; b=mTRidBOr/OaRVz1E8WBhUw3F6HpQo/ONxRF38aC5sCqdAoZF7pyhSECj/qkVstI8Sv bdDIjls/BBbkcaLAiWZtnNp7lt/xUtuLc0Mikbw/cLT1tJi0/BN3L7xeEdRw/tJUb4+H q1jiHmpR/cmoO1QV+C944nU0GTgIxzLsmsaKpmr+GoiIoRdoGMWoKtK5KXsegcfp6P6s KZo+Tg3UkoidkJI7W83qQaH00uI/7hz3qo3Q/7WypVqHHSdmIQ5BefK2tfE3YwIdgzfv CwsaWzHhbHh3njY4S9SrFwdbaQ2aFsAYdU7cZ8rxf6lQXaphNH3sWkOCdF5NUaHJHvCv ECKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="XB0eF/iO"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si4168343edi.132.2021.02.05.09.18.05; Fri, 05 Feb 2021 09:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="XB0eF/iO"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233240AbhBEPdG (ORCPT + 99 others); Fri, 5 Feb 2021 10:33:06 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:48902 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbhBEP14 (ORCPT ); Fri, 5 Feb 2021 10:27:56 -0500 Date: Fri, 05 Feb 2021 17:09:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1612544974; 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=2Rh5Yxk4TOiEVVCLvfzyyZU8viIhD1Vne2otryahZ2g=; b=XB0eF/iOq8PXzeGIQvq0dYFlbT8w5OHLGwn1nqp6oHGwMPJY1K8Ut4MnIzSgjz2Rr0mmcY YIZHWZ0Zr9ComoHNG3S13X7AYZuJY2NHaE/mk95FvCPO8CZfv/HKioPRzEFM/kTzwUPYHU i1z155fwyxOMkpcQvUKvBniPcPKiRrvd5REsqoeF5RBpZ7IgouZ1WxtKAnHt9QjKxuesgR kwZxqaaTEtb6ZvvRA7xiSUgKtKzlUXRyT2wr5i05vP2warMHgtI+eKO8taCUp9xQtCmD+c QVDZfwi4A39jv6wpt8T1WROp6+M6oQXBslHOllqPH3wpN3iu0NTuzh1xT2bDzA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1612544974; 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=2Rh5Yxk4TOiEVVCLvfzyyZU8viIhD1Vne2otryahZ2g=; b=iZdoGgk9Dr9QXt7/2NdlPuLoB/139oPt7cYAUrdaKxV0lS3Bc+9jPxcEZw8kNpps7VCMXQ MNOSecxWsnxzmmAA== From: "tip-bot2 for Geert Uytterhoeven" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/urgent] ntp: Use freezable workqueue for RTC synchronization Cc: Geert Uytterhoeven , Thomas Gleixner , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210125143039.1051912-1-geert+renesas@glider.be> References: <20210125143039.1051912-1-geert+renesas@glider.be> MIME-Version: 1.0 Message-ID: <161254497336.23325.2614230583600966925.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 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: 24c242ec7abb3d21fa0b1da6bb251521dc1717b5 Gitweb: https://git.kernel.org/tip/24c242ec7abb3d21fa0b1da6bb251521dc1717b5 Author: Geert Uytterhoeven AuthorDate: Mon, 25 Jan 2021 15:30:39 +01:00 Committer: Thomas Gleixner CommitterDate: Fri, 05 Feb 2021 18:03:13 +01:00 ntp: Use freezable workqueue for RTC synchronization The bug fixed by commit e3fab2f3de081e98 ("ntp: Fix RTC synchronization on 32-bit platforms") revealed an underlying issue: RTC synchronization may happen anytime, even while the system is partially suspended. On systems where the RTC is connected to an I2C bus, the I2C bus controller may already or still be suspended, triggering a WARNING during suspend or resume from s2ram: WARNING: CPU: 0 PID: 124 at drivers/i2c/i2c-core.h:54 __i2c_transfer+0x634/0x680 i2c i2c-6: Transfer while suspended [...] Workqueue: events_power_efficient sync_hw_clock [...] (__i2c_transfer) (i2c_transfer) (regmap_i2c_read) ... (da9063_rtc_set_time) (rtc_set_time) (sync_hw_clock) (process_one_work) Fix this race condition by using the freezable instead of the normal power-efficient workqueue. Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Gleixner Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20210125143039.1051912-1-geert+renesas@glider.be --- kernel/time/ntp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 87389b9..5247afd 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -502,7 +502,7 @@ static struct hrtimer sync_hrtimer; static enum hrtimer_restart sync_timer_callback(struct hrtimer *timer) { - queue_work(system_power_efficient_wq, &sync_work); + queue_work(system_freezable_power_efficient_wq, &sync_work); return HRTIMER_NORESTART; } @@ -668,7 +668,7 @@ void ntp_notify_cmos_timer(void) * just a pointless work scheduled. */ if (ntp_synced() && !hrtimer_is_queued(&sync_hrtimer)) - queue_work(system_power_efficient_wq, &sync_work); + queue_work(system_freezable_power_efficient_wq, &sync_work); } static void __init ntp_init_cmos_sync(void)