From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933263AbcE3ONd (ORCPT ); Mon, 30 May 2016 10:13:33 -0400 Received: from mga11.intel.com ([192.55.52.93]:23718 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbcE3ONc (ORCPT ); Mon, 30 May 2016 10:13:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,390,1459839600"; d="scan'208";a="817745681" Date: Mon, 30 May 2016 17:13:29 +0300 From: Mika Westerberg To: Baolin Wang Cc: John Stultz , linux-kernel@vger.kernel.org Subject: "systemd[1]: Failed to apply local time delta" with v4.7-rc1 Message-ID: <20160530141329.GB1743@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I noticed that when I boot my Lenovo Yoga 900 with v4.7-rc1 I get following error from systemd: systemd[1]: Failed to apply local time delta, ignoring: Invalid argument and my system time is left being 180 minutes off. With following commits reverted it works fine: 86d3473224b0 time: Introduce do_sys_settimeofday64() 457db29bfcfd security: Introduce security_settime64() and systemd prints: systemd[1]: RTC configured in localtime, applying delta of 180 minutes to system time. >>From systemd source code it seems to use Linux specific feature to "warp" the system clock according the timezone passed in: clock_set_timezone() { const struct timeval *tv_null = NULL; ... /* * If the RTC does not run in UTC but in local time, the very first * call to settimeofday() will set the kernel's timezone and will warp the * system clock, so that it runs in UTC instead of the local time we * have read from the RTC. */ if (settimeofday(tv_null, &tz) < 0) return -errno; if (min) *min = minutesdelta; With commit 86d3473224b0 it seems that do_sys_settimeofday() started returning -EINVAL when tv is NULL which seems to break the above. Is this intentional or am I missing something?