Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3908998pxb; Tue, 26 Jan 2021 07:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuzch3WfB19TfU1N0erjVLwd3F10NcTMnPk2YSNHn+Qat+iDSEZfzioowW6gb9P+rk7aLM X-Received: by 2002:a17:906:a851:: with SMTP id dx17mr3629724ejb.537.1611675744101; Tue, 26 Jan 2021 07:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611675744; cv=none; d=google.com; s=arc-20160816; b=vwPU8wc+r2eO1+h+Os6rrHmd24HARmtOVYERLLUIVgamD+YTU/vJwilcGIe6lrPuGC JFRDv4T5esFAxfIvYOUmWLzWGSgGKMbHtvOrFHPpIeqVZ7MnSrtTQxcAHEZliFwLT7Yz 74F8qq0U/Znp+XY9qhChqziTiom3HJAEdAWUkRBNywXkMv+S/vBCNt+B52y/wzrPfHCl YDZwEFbjr1/8rrYoXwfNnSSLcbJzQMUg2HhzPMleIjtkQix0Oclar0RyheRyGLtU8BDb EN92wDjasp2czO3XapK7wMe4P5UBQcdg2fJckL3oIQG5c2rhY8cgVIFm6Qa633QWQhTW wblQ== 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:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=hh9LYnfvfOc2Nbg2V1UNBmKMfmRSaeXdcAU2V70HUNI=; b=UbAxxC0y4VsgSXMbZgxilXes2qDJDhSSV2XxwSwOF7SHNdDy9prKBzGk5kfrIw+aAt avrnepjkBR5CUzbryyOOi+gsrIZMBP2S0nMW5UyJvh76CfT+533isDsvDdj3sOf2JQYv 68C9ULNDhpLk3yObkZQntdxfcBbl7WyEBXz6duy81GU3HeHShfk3a2cCiA00QaErPw6m tLdFpNczvIhJhIt1diLqQvSy+oR4qGC9s5xzCgK7Onbx19ziwkE1KeRNZX/o+lbFPco5 +6oOJmhv6SGyfrPpe1amUGe2nAUR58na3AVmvW9nV87sUL1D4lNvR18yMpNnkLSdIVAy /S8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YR9XzAkZ; dkim=neutral (no key) header.i=@linutronix.de header.b=dQQioqVw; 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 f7si6592018ejx.435.2021.01.26.07.41.59; Tue, 26 Jan 2021 07:42:24 -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=YR9XzAkZ; dkim=neutral (no key) header.i=@linutronix.de header.b=dQQioqVw; 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 S2389576AbhAZPiu (ORCPT + 99 others); Tue, 26 Jan 2021 10:38:50 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:50182 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391524AbhAZPgF (ORCPT ); Tue, 26 Jan 2021 10:36:05 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1611675318; h=from:from: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=hh9LYnfvfOc2Nbg2V1UNBmKMfmRSaeXdcAU2V70HUNI=; b=YR9XzAkZv5I5BtGuoaerm5zNmwFZWEMXzcyRPfP8FI5X+yi8+yMrmoKr0XZjCzl82fMMaP p/Bu8JqXkJBNkF0ns09ZxcljDcV6LdXGsEATp9dWfFrqcMkVdw+Mk1rvyO2xsuOiQ3F2zx CNmhOjyZQsDZJC35HovErGz59734dM66LNkFkK7H3R/fw32/yJNkp8mqgQb+QhhzReRD7N Di6nrp66hcx804a2DPt11mG35/W8gEpYKBVLMhaqAkK2ADQ2qwyks0Ict8HWmuo0lKxBJJ pwEPBHL1ZD+7eScJ8jW3XIeFNjpWHebbqDbg01h1Nr9IbalPFZDDvZecsCFCVw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1611675318; h=from:from: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=hh9LYnfvfOc2Nbg2V1UNBmKMfmRSaeXdcAU2V70HUNI=; b=dQQioqVwhhDkpZC7ZwjRyKuRi765/waHxrDDe1fMHLChPsGwjrTe9yArRH2dYUjcYq3DwC f37z5jcfgKGeOpAw== To: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , LKML Cc: Alexandre Belloni , Jason Gunthorpe , Miroslav Lichvar , John Stultz , Prarit Bhargava , Alessandro Zummo , linux-rtc@vger.kernel.org, Peter Zijlstra Subject: Re: [patch 1/8] rtc: mc146818: Prevent reading garbage - bug In-Reply-To: <98cb59e8-ecb4-e29d-0b8f-73683ef2bee7@digikod.net> References: <20201206214613.444124194@linutronix.de> <20201206220541.594826678@linutronix.de> <19a7753c-c492-42e4-241a-8a052b32bb63@digikod.net> <871re7hlsg.fsf@nanos.tec.linutronix.de> <98cb59e8-ecb4-e29d-0b8f-73683ef2bee7@digikod.net> Date: Tue, 26 Jan 2021 16:35:18 +0100 Message-ID: <87y2gfg18p.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26 2021 at 15:17, Micka=C3=ABl Sala=C3=BCn wrote: > Thanks for the fix! It boots now with a new message: > rtc_cmos rtc_cmos: not accessible >> spin_lock_irqsave(&rtc_lock, flags); >> + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */ >> + if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x7f) !=3D 0)) { >> + spin_unlock_irqrestore(&rtc_lock, flags); >> + memset(time, 0xff, sizeof(time)); > > This should be: sizeof(*time) Of course .... >> + return 0; >> + } >> + >> /* >> * Check whether there is an update in progress during which the >> * readout is unspecified. The maximum update time is ~2ms. Poll >>=20 > > Tested-by: Micka=C3=ABl Sala=C3=BCn