Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1139047imm; Mon, 9 Jul 2018 18:18:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf66B8I+2phvKzasXCsAVRAToQbj7iZl91h+xyhWg7zGrbFcFCiAYsCuMEzDzj+nPGkKvbJ X-Received: by 2002:a65:5545:: with SMTP id t5-v6mr20733933pgr.157.1531185502123; Mon, 09 Jul 2018 18:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531185502; cv=none; d=google.com; s=arc-20160816; b=P5+9cOfWHBvccWd/mtYQ7pJAQyrnMbr4ROt56pq6xyCUA9Z3kFLTjnDHceAgthcJd1 0m2jlgCw1kFZ3vHnY0+Jrfin9ype++WXjvGkJrz6ULzo4RM5jpU8FcP3R0vz3/bG6RsX Q46yX2Dp34NmOJfdUZoXdrGb3pqTdGf5nzCuPRipVdHYCJRDchwGr6z/xS6i2n7dz0e0 Cs22ofuZ1gLd7uLsrAu5y1sNScKigHcxjQcyNppj3eMIAZOBWIV02cb0WG3/Y+AbBCVv sKyLcvov+2tlxeK3Y1qtUBtoQc4DsK86+dNwTGNIKYYU45MtZybqmxTdlCT362sdf2xM thnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:arc-authentication-results; bh=93gXdVA5W6BZ98ihR+haILorhVgqWoh47ieN4BBNi60=; b=UBh8TFLiQGXovaj5/gpazEgZH3CLa8IgRfJP2q/X4sZM8zuFn1/BYrF/Whwb8bQ9IB BzxIBJU+/2yF2m7P2ZLzj4EFnoNhp4A/19PWqxjSlZummWZOu8uNIkznqu7TKQx4QKKv f06x5ZrBDeixjjfwdgyTPVNpSZjnbhah9aUo02vLorFzndYwzSdkATyljZ15Ekx078Ku 49sdPBx6MMXnN5Hws0FyPoNF+ZrLM/E0pdeuCP+hDnoZI6q0D6RRiEhOyTHiAF/XI3Ky nLjzgOtQ2sdNSXw8eS/iuOZwykL0yxrPC1qEzS5wzLLOKwj4aZZZdHERpn/609pf5SJz ReqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si16092875pfz.241.2018.07.09.18.18.07; Mon, 09 Jul 2018 18:18:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754625AbeGJBRY (ORCPT + 99 others); Mon, 9 Jul 2018 21:17:24 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:39306 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754581AbeGJBRT (ORCPT ); Mon, 9 Jul 2018 21:17:19 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 8708D22D6B; Mon, 9 Jul 2018 21:17:11 -0400 (EDT) Date: Tue, 10 Jul 2018 11:18:34 +1000 (AEST) From: Finn Thain To: Arnd Bergmann cc: Meelis Roos , Mathieu Malaterre , Paul Mackerras , Michael Ellerman , Geert Uytterhoeven , Joshua Thompson , Benjamin Herrenschmidt , Greg Ungerer , linux-m68k@vger.kernel.org, linuxppc-dev , LKML , y2038 Mailman List , Andreas Schwab Subject: Re: [PATCH 1/3] [v2] powerpc: mac: fix rtc read/write functions In-Reply-To: Message-ID: References: <20180619140229.3615110-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jul 2018, Arnd Bergmann wrote: > > The most likely explanation I have here is that the RTC was indeed set > to an incorrect date, either because of a depleted battery (not unlikely > for a ~15 year old box) or because it was previously stored incorrectly. The PowerMac stores the GMT offset in NVRAM, and this gets used to initialize timezone_offset. If timezone_offset was negative and now.tv_sec was zero, I think this could store a 1969 date in the RTC: int update_persistent_clock64(struct timespec64 now) { struct rtc_time tm; if (!ppc_md.set_rtc_time) return -ENODEV; rtc_time64_to_tm(now.tv_sec + 1 + timezone_offset, &tm); return ppc_md.set_rtc_time(&tm); } But maybe now.tv_sec can be shown to be greater than timezone_offset. Then, what would happen when the timezone in /etc/localtime disagrees with the timezone_offset stored in NVRAM (PRAM)? Besides that, if the battery went flat, what use is a backtrace? Why not scrap the WARN_ON()? --