Received: by 10.223.185.116 with SMTP id b49csp3567539wrg; Mon, 19 Feb 2018 02:10:18 -0800 (PST) X-Google-Smtp-Source: AH8x226hGP6becJAX1CSwbmcoTl+iPSgRE/4mt4biq+a0ttnoVrb3XFYpj/FukZ7oexLrRh0j1qc X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr13867615plc.384.1519035018728; Mon, 19 Feb 2018 02:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035018; cv=none; d=google.com; s=arc-20160816; b=oOyqZm6X2PqW1CDM+Zdxx/rzwfCfOp41kfPyjWLiGFJd96nM3FPqgY3i3jBEXqwa4q DpY9kKPBL/3+NRYp4Nttry5Tv3QUdIFBt6MWldZci+1Ik6gijkdoRYLuaG4cuzxByMdD sWKvVa9lFag21nsV414ftxLHLH7XwpXrj481URKNySL9Sc4yCdUbtITJYe7AeorDdGe7 H0BJ4U3fufjwFqRfGcvMIhscaVdCUcvqPq0oPY/q9H+LIm/hdjWmis63HhcM7V+uFLQm VjrXnje9KPF4sQE29czRCA9loAZlDJtScX9YOTaCAviJLs3s/mf0rScOabRnaAg+FpBo T83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=aj8GmzVYYnW1KLQFY4IAj8uZ9uJfyYPsC4yLhEztRGE=; b=QYvr2b9qvfdus7+ohA63B8nGVTZ51aRm4aaQvTDsr+wmcJkoVr3E1rmVZF55dZKZYC Pveak94yInECH6nZ5ecpXrrWAPq+95vz/DIN4I3h/fjisPGLKGDWIA3bVDp2SkKIIN96 7pywYnqJe9M6lYx6x9YGyamWK0Mbej2PTcJilzUrQrIoBotjtA67XUYA9dc/I7uvhrq4 X9M4ZJSHiOMN83hWiq5QeR+JdcCriLHX30nQ+MnpshMiMPPBgZ5VOPKl6ZkLdL7Vxter tKo0aJlE38YjYyzBd3O/auJ446KhMp3k6hql/33/3ah1+HkshkvYr6AsIzZH85z5ySoD iQig== 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 123si3166411pfg.361.2018.02.19.02.10.04; Mon, 19 Feb 2018 02:10:18 -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; 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 S1752449AbeBSKH5 (ORCPT + 99 others); Mon, 19 Feb 2018 05:07:57 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:57757 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752245AbeBSKHz (ORCPT ); Mon, 19 Feb 2018 05:07:55 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id DEEA120715; Mon, 19 Feb 2018 11:07:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.free-electrons.com (Postfix) with ESMTPSA id A594A203A6; Mon, 19 Feb 2018 11:07:53 +0100 (CET) Date: Mon, 19 Feb 2018 11:07:54 +0100 From: Alexandre Belloni To: Igor Plyatov Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org, Alessandro Zummo , rtc-linux@googlegroups.com, util-linux@vger.kernel.org Subject: Re: 500 ms delay in time saved into RTC Message-ID: <20180219100754.GL14177@piout.net> References: <30ae185f-28c9-54f1-2884-4ee7801b130e@gmail.com> <34f50661-85f5-eb46-3ff7-45f0c2bb5960@prevas.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/02/2018 at 12:16:04 +0300, Igor Plyatov wrote: > Dear Rasmus, > > thank you very much for explanation! > > I have set "RTC_SET_DELAY_SECS = 0.0" in hwclock.c and got acceptable > result. > > It wonder why such critical function does not implemented on kernel level in > RTC driver? > It is very strange to rely on specific HW in user space SW. > Because of the way the API is designed, handling the MC146818A oddity is not possible in the driver (i.e. 50% of the time, it will be too late to handle it). You can use busybox hwclock which has the x86 insanity commented out: https://git.busybox.net/busybox/tree/util-linux/hwclock.c -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com