Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17317629ybl; Thu, 2 Jan 2020 03:09:31 -0800 (PST) X-Google-Smtp-Source: APXvYqymmahFPsIEl/7FwZFdUbZRUefsQw1FjlowmmGD1OKfKBkBibMFyIwwfprjI6drLL9/uBTC X-Received: by 2002:a9d:4796:: with SMTP id b22mr18072360otf.353.1577963371143; Thu, 02 Jan 2020 03:09:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577963371; cv=none; d=google.com; s=arc-20160816; b=fIJI2ua/p7qNSfdnDgkVzdSBh7xFcCml/j1q9HILHuSXaAaru4fR/DxD1GdfmcN30W Znv0DriUxqSQcmyhCuutJkYWAnGwf80N13olhW2wCthdb6jSHuzxKPAuhzfxj3CaasjO 6EyO8s29z3/yaw4wR0rdXoSuHURpD3sRtZuUZ5N0DGj9Q4+xeppwBm0L52RbP8LG8C7E P81J62IdvDN9IDZegv0PRYH+KuhVlG4+HUvlLONAqLUZA5NFSCMh0+lTK1jxaXBMngKu 2IwwZw3FBdTHG4rMCl36KONAVVeCL33AOckCQ6m5U2lW0uitZ8PWL5/p0foFr+oCy3nO UXug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GNvakkxQuOqMQUj1eGVGpZIiH2Cj2LW8lOBGntXxElo=; b=vv7yg+uvVygdz7RIqIf1H/0Q0nvWE0SDYHPKl142ySgVRieUWYWgkdwfoC/OkKlFIm xrhF9ZT/82mkBbqZCOwp1caKEwQmWwbpL/QJ6GX/VtnJS027bfZplOS27QtASBcnGXzP z3o3lXGYAwpNI8+cVJdHWDhgwp/7hl2qvigitonZqoDHpwvpuw1PtQFFxFC0RLP+ba/Q FNxhR2hQa0BFd/gcTCJsLQdUuY6Mv3aH0cFdC2tT/a0yz9TbqDcNevtUmVpMNxIZtdy3 JMzAWQ1mRWtVpZWT21JZj8gybYovDm6qmhtF19FA+eFrwx3w5DBPpdjJBVTr8vmRHXnF OiaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TDISb/K0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si28150801otf.199.2020.01.02.03.09.18; Thu, 02 Jan 2020 03:09:31 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TDISb/K0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbgABLI3 (ORCPT + 99 others); Thu, 2 Jan 2020 06:08:29 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57929 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728111AbgABLI3 (ORCPT ); Thu, 2 Jan 2020 06:08:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577963307; 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: in-reply-to:in-reply-to:references:references; bh=GNvakkxQuOqMQUj1eGVGpZIiH2Cj2LW8lOBGntXxElo=; b=TDISb/K0LNNTOL6rW4x2c6NiivfqGK7H5Ift+yOXzFaUaka96vWJzHyyBub89yxWXz7NxK BW3amTQxOTadXyyqBBaBroeeTJF0PqjzF4i3h+5qUpOqFWfWEhReh7/6oZ7QND0N5Mp4Du SRohnQXU4m7aunPOxdVGW7obakQ2CUQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-kZSTbWABO1GvDq5y6MrkwQ-1; Thu, 02 Jan 2020 06:08:22 -0500 X-MC-Unique: kZSTbWABO1GvDq5y6MrkwQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25F0B800D4C; Thu, 2 Jan 2020 11:08:21 +0000 (UTC) Received: from 10.255.255.10 (ovpn-204-196.brq.redhat.com [10.40.204.196]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 123CB1A7E4; Thu, 2 Jan 2020 11:08:19 +0000 (UTC) Date: Thu, 2 Jan 2020 12:08:17 +0100 From: Karel Zak To: Mikhail Gavrilov Cc: util-linux@vger.kernel.org, Linux List Kernel Mailing , linux-ext4@vger.kernel.org Subject: Re: [bugreport] "hwclock -w" reset time instead of setting the right time Message-ID: <20200102110817.ahqaqidw3ztw3kax@10.255.255.10> References: <20200101141748.GA191637@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 01:08:41PM +0500, Mikhail Gavrilov wrote: > "hwclock -w" reset time instead of setting the right time on M/B "ROG > Strix X570-I Gaming" > Demonstration: https://youtu.be/QRB7ZLiEfrc > Some DE like GNOME has automatic time synchronization option and there > is a feeling that hardware time reset after each Linux boot. Can you try "hwclock -w -v" to get more details? For example on my workstation: # ./hwclock -w -v hwclock from util-linux 2.35-rc1-20-63f8 System Time: 1577963091.683987 Trying to open: /dev/rtc0 Using the rtc interface to the clock. Last drift adjustment done at 1531914946 seconds after 1969 Last calibration done at 1531914946 seconds after 1969 Hardware clock is on UTC time Assuming hardware clock is kept in UTC time. RTC type: 'rtc_cmos' Using delay: 0.500000 seconds missed it - 1577963091.684767 is too far past 1577963091.500000 (0.184767 > 0.001000) 1577963092.500000 is close enough to 1577963092.500000 (0.000000 < 0.002000) Set RTC to 1577963092 (1577963091 + 1; refsystime = 1577963091.000000) Setting Hardware Clock to 11:04:52 = 1577963092 seconds since 1969 ioctl(RTC_SET_TIME) was successful. Not adjusting drift factor because the --update-drift option was not used. New /etc/adjtime data: 0.000000 1577963091 0.000000 1577963091 UTC Karel -- Karel Zak http://karelzak.blogspot.com