Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4333455imm; Mon, 18 Jun 2018 13:06:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKl39QFUwFImBy+nE2/N8v9t67H9uuZDjXiJwyg4YOFwBwQKOMWFCSARxaTM1+JdDUFPJl4 X-Received: by 2002:a65:578c:: with SMTP id b12-v6mr12412442pgr.315.1529352416155; Mon, 18 Jun 2018 13:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529352416; cv=none; d=google.com; s=arc-20160816; b=N2yOGgy+kdPy5OW4he6UEaeVCIUQmIYnyhs6PKVP1mR53YzPV/C+wZ87oR5g2hRKCx +5YuSoPS7/CVINLS11CZ0+rfFZGMXaOYTCBnYH89GgH9/8hHbVMvWZuZ9LnjcKLOIbax HKbb5405jBYzTJ8Opr4cUEibyRIn1HxYeUBSSv+OWECgo/hPT/QdHR5X+FdWYj+EEkaq wTR8R2nJVZ3TQdfLS5cn0IE03g3V8GxjkhN163Ihi7Ko5Sx0p4QPdGnn34zNPtqRbyWU 6ZfIgXwHn4fFOEarswlGRlbiyr0xbBVLgi4nSctWwmircSauG179OxBksnJaPrbFsyaL X8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=OR+QqdS5b3nUAYmdzfxazH4qYM0kL6lJ2dAIFv/siPw=; b=mm8SUIJkiPHWiAItUy+aYmWKRygDwhAHS5jmvGE4sM6aSq7LKeDs8bNAlVLPlaoSrn LC1VPDegJFWLP7+vDqZbr8dZRf3GAQGz/nubaWBAwPtyzfQYGSf1gc59q3nBIJMO1Z9p oiYGBiSkgAm3Iqi1AYYuwMiRCe75UodDQgfqOHaB3ZFNLma/lWDz2beKBRvfi/w+ZaIU iTNZITjjWBcnYQ4O84MKuUQPL3tbjV2AIVl85IgJPaeZ+Ts8IfqO7v3GI5GDbyhLgZh+ 68rjxcnCUX1RQNWfKLISmMChX5ngEulk+NGTSDk291CEv2WCXUAZAj9lU7aUZoKX3OQm 4ksw== 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 o11-v6si12865367pgq.506.2018.06.18.13.06.42; Mon, 18 Jun 2018 13:06:56 -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 S1755399AbeFRUE6 (ORCPT + 99 others); Mon, 18 Jun 2018 16:04:58 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:59777 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755364AbeFRUEz (ORCPT ); Mon, 18 Jun 2018 16:04:55 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 418hrz1qV7z1qtxB; Mon, 18 Jun 2018 22:04:51 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 418hrz0V29z1qsdt; Mon, 18 Jun 2018 22:04:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id MqSrGwqGLprY; Mon, 18 Jun 2018 22:04:49 +0200 (CEST) X-Auth-Info: 95bSsH+oqrLodh7THf8/hzR74wmKCfIo9a9wHYC5WO3dD0Hg4C3d8w/78WhwxYK0 Received: from igel.home (ppp-188-174-155-192.dynamic.mnet-online.de [188.174.155.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 18 Jun 2018 22:04:49 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 4B1112C10B2; Mon, 18 Jun 2018 22:04:49 +0200 (CEST) From: Andreas Schwab To: Mathieu Malaterre Cc: Arnd Bergmann , Paul Mackerras , Michael Ellerman , Geert Uytterhoeven , funaho@jurai.org, Benjamin Herrenschmidt , gerg@linux-m68k.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev , LKML , y2038@lists.linaro.org, Meelis Roos , Alexandre Belloni Subject: Re: [PATCH 1/3] powerpc: mac: fix rtc read functions References: <20180618140518.2920804-1-arnd@arndb.de> X-Yow: I represent a sardine!! Date: Mon, 18 Jun 2018 22:04:49 +0200 In-Reply-To: (Mathieu Malaterre's message of "Mon, 18 Jun 2018 21:10:06 +0200") Message-ID: <87efh3hndq.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Jun 18 2018, Mathieu Malaterre wrote: > Sadly, trying again today does not work anymore. Adding some printk > just before WARN_ON: > > +printk(KERN_ERR " rtc DBG pmu_get_time1: %lld %d %lld \n", now, > RTC_OFFSET, now - RTC_OFFSET ); > +printk(KERN_ERR " rtc DBG pmu_get_time2: %x %x %x %x %d \n", > req.reply[0], req.reply[1], req.reply[2], req.reply[3] , > req.reply_len); > > leads to: > > [ 0.000000] rtc DBG pmu_get_time1: 14096662 2082844800 -2068748138 > [ 0.000000] rtc DBG pmu_get_time2: 0 d7 19 16 4 A good value would have 0xd7 in the first byte. The problem is that pmu_set_rtc_time is also broken, and leads to an invalid time value stored in the RTC. Since pmu_request is a varargs function passing values of type time64_t without casting won't work. You need to reset your RTC before you can continue. I think the right fix is to change nowtime in pmu_set_rtc_time and cuda_set_rtc_time back to unsigned int (or to u32). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."