Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2622699pxb; Sun, 17 Oct 2021 20:47:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBmy9CbKQa4jZpxfNPL9wgwZdh7uUd+VR0YMeSkIsTt8tyxlt636KnQRjXu3+rCbWsRGYb X-Received: by 2002:a05:6a00:2449:b0:44c:2221:8c38 with SMTP id d9-20020a056a00244900b0044c22218c38mr26062455pfj.74.1634528850476; Sun, 17 Oct 2021 20:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634528850; cv=none; d=google.com; s=arc-20160816; b=Wn2TqDcZ2l6k8kTNScVSJujuIIF2DmQa7bDkoHOtDXVSU3nE4wYF92tOGiDAWbTYa6 Dl7bI/7dv5xH0bM8Fpz2sOdphbdPSZ2TN7jEmaB9WjUUm78NVPBTmrG6F6hwwwrja0C3 JT4emjOCHKYVfwwz15AmT6/YdMnk+VBcgjaNFSgrw6HgF/Ex5BqHje/ZCciKl8LVC9de hXHW1d9o7UVdaAig1nyx2wH6p8CwWuC46gxJtIDVIbRRsByrW85uqrujZGpF+QRjb+gQ JQsfZ9PDnGYQ2/2GbX/Hrswrlp7ol995mzJGZeowEwz1kcM1ncEuEUGjx+FpjllFxZ+h rzUw== 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:dkim-signature; bh=z9PklF1RvUY48l55YjivLfsHyzdKfcVQbelAs+9qcnI=; b=oqYeGmOW83P3Ozwpb8LRVqRsTfv46UtWrXuEl/jKXuqODF+hiuWE53NlTyYsKwevVw ARCnfkbIIEwtLU/Q4uhyR52l/3UX8UU1dN7T2w5iQGMsLQi28ibV1Y4XojFOSIGnWObu iXqL1ltqvf9BSXx2KoYkN+GTxEUyifAN5PeCm9DPKBpyXvzwGw0UKORWbp8+RmgyxJFB +H0cXrTeZgOh34ww9d1eBQ2YEtaZmavYcLcCPVkKSVHMnce6vBGj//96SC5OT66lOmyM 9g3xY+dMJM0xfI7xdhn521YrWNTf92OuGv46w/0p8S8zNTPBTACsZW68tr3wfD1eG5Iv FzPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=lKiGfMr9; 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=NONE dis=NONE) header.from=o2.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si735015pgd.517.2021.10.17.20.47.18; Sun, 17 Oct 2021 20:47:30 -0700 (PDT) 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 (test mode) header.i=@o2.pl header.s=1024a header.b=lKiGfMr9; 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=NONE dis=NONE) header.from=o2.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344531AbhJQTlr (ORCPT + 98 others); Sun, 17 Oct 2021 15:41:47 -0400 Received: from mx-out.tlen.pl ([193.222.135.142]:5906 "EHLO mx-out.tlen.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242772AbhJQTlr (ORCPT ); Sun, 17 Oct 2021 15:41:47 -0400 Received: (wp-smtpd smtp.tlen.pl 29485 invoked from network); 17 Oct 2021 21:39:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1634499575; bh=z9PklF1RvUY48l55YjivLfsHyzdKfcVQbelAs+9qcnI=; h=From:To:Cc:Subject; b=lKiGfMr9h9v2eYeF6b+d7c2cWTq9OLuE+FKqjXfZPJxoVVBAEXf02QjXPRkjtkVX3 qnJl4F3/7ptWuBT4FAMwmgf//TFXSKsDKiQlil/n//pfe4BatMqaPm5dS7k6KifMxI ySpoq9vGObQuvDBqns/21ksmPXv1JJt6yHXKZb5w= Received: from aaet142.neoplus.adsl.tpnet.pl (HELO localhost.localdomain) (mat.jonczyk@o2.pl@[83.4.123.142]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with SMTP for ; 17 Oct 2021 21:39:35 +0200 From: =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= To: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org Cc: =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Alessandro Zummo , Alexandre Belloni Subject: [PATCH RESEND v2 0/6] rtc,x86: CMOS RTC fixes Date: Sun, 17 Oct 2021 21:39:21 +0200 Message-Id: <20211017193927.277409-1-mat.jonczyk@o2.pl> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-WP-MailID: f0e1749d68850869e05a329d3c967e4c X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000003 [kUAk] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This patch series fixes some issues in the RTC CMOS handling code. First three patches fix bugs in drivers/rtc: 1. Fix rtc_lock usage in cmos_set_alarm() in rtc-cmos.c. 2. Do not touch RTC alarm registers when the RTC update is in progress. (On some Intel chipsets, this causes bogus values being read or writes to fail silently.) 3. Fix presence check of the RTC CMOS: the clock was misdetected as broken on one of my systems. Patches 1 and 2 are Cced stable. I'm going to submit patch 3 manually to stable after some regression testing in master. Last three patches contain fixes for arch/x86/rtc.c: duplicate code removal and a renaming of a function. I'd prefer that they be merged together with patch nr 3. I'm also considering whether function x86_wallclock_init() in arch/x86/kernel/x86_init.c should call mc146818_does_rtc_work() to make sure that the CMOS RTC is present and behaves itself. This might be useful. Patch nr 7: Revert "rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ" was made obsolete by mainlining of commit 13be2efc390a ("rtc: cmos: Disable irq around direct invocation of cmos_interrupt()") so I've dropped it from this series. This is my first patch series, so please review carefully. Greetings, Mateusz Signed-off-by: Mateusz Jończyk Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Alessandro Zummo Cc: Alexandre Belloni