Received: by 10.223.185.116 with SMTP id b49csp4465518wrg; Mon, 26 Feb 2018 19:05:13 -0800 (PST) X-Google-Smtp-Source: AH8x224/cT8PafY6CxO4cEd4DOsIK3PjaOVV3SG2B+Ait8duIng8YRqo64God2NS9gxB+wsYVdqv X-Received: by 2002:a17:902:6909:: with SMTP id j9-v6mr12446247plk.447.1519700713132; Mon, 26 Feb 2018 19:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519700713; cv=none; d=google.com; s=arc-20160816; b=PwxH3PmjORtHXAaSEOFCOEtR5rpYakngPNEWOdmKpbV51UKspewRsGCLL5VcTNyG6o XYteHPc4uO4aPcxt1VtGCSXlLO0gI+u41XYAoG9+o87uG2s+GfFr9/LndBbHiAebO3Jf kDamgTFV3Zxhiku8vhrj2VvdOMUcf8AHwlbpknhoE3mULVLCXaDp+FzOvlO0cocHqiMc cw5X4Pm+AO0+zDiIPjTXM/TtvdNZm1VHbZuAbmHDrjT9Cpsyn8Y/9IjRIig6sME7sQ5Z ImHLP9HOYsxr5sOkA7OffePzhc4OjKHHI01WfDhoO8e3fk1Aut9jupSMnrFusdcHISm9 U0/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=1Dc+873cEjR7zqWSt2otByA1wspt2k5egxxruUhi7HI=; b=Ql/SnM+SI09vUn4AWPNCx++FnLlDX00FIC/a6zE+GUrkwc4xocal9cWLfkPbfaV7Kj bmVGr7DPoWiZDoavo3jX/FnXdfZ11kcuKbBITNe+eOSXLbn3yIvJe6dgUuZLsJZ1VDJ5 8JPuXCnUSbWYTUEuUqrI740JaBfm6mLOEq2CBqnwWFAjOlY5KwCTjLpqGjSttVYXqmki WVy3mYpTP/TtftDBQ+oxG6mRrsqVwg2x4174uP1+nAkbU9df1wVJ2WJLVfJDmUuD7IeZ G9/CW79nDuo7YNgWc9yIAaRd38pHEnJj+MJlpbwofkyhEgOulYI44C5Q7YXabMzbt9Yg 4o8w== 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 70-v6si7759948ple.147.2018.02.26.19.04.58; Mon, 26 Feb 2018 19:05:13 -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 S1751634AbeB0CxR (ORCPT + 99 others); Mon, 26 Feb 2018 21:53:17 -0500 Received: from regular1.263xmail.com ([211.150.99.131]:39007 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeB0CxP (ORCPT ); Mon, 26 Feb 2018 21:53:15 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.190]) by regular1.263xmail.com (Postfix) with ESMTP id 173516251; Tue, 27 Feb 2018 10:53:09 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.22.58] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 6A9AD3CF; Tue, 27 Feb 2018 10:53:03 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: jeffy.chen@rock-chips.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <2707ec944044f6c1f7a46e577ff78947> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.22.58] (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 209328UGHZI; Tue, 27 Feb 2018 10:53:08 +0800 (CST) Message-ID: <5A94C80E.8020203@rock-chips.com> Date: Tue, 27 Feb 2018 10:53:02 +0800 From: JeffyChen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Jeffy Chen , linux-kernel@vger.kernel.org CC: zyw@rock-chips.com, briannorris@google.com, dianders@google.com, jwerner@chromium.org, linux-rtc@vger.kernel.org, Alexandre Belloni , Alessandro Zummo Subject: Re: [PATCH v3] rtc: cros-ec: return -ETIME when refused to set alarms in the past References: <20180227024734.7591-1-jeffy.chen@rock-chips.com> In-Reply-To: <20180227024734.7591-1-jeffy.chen@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, On 02/27/2018 10:47 AM, Jeffy Chen wrote: > /* Don't set an alarm in the past. */ > if ((u32)alarm_time < current_time) Oops, i'm a idiot, forgot to use '<='... will resend it. > - alarm_offset = EC_RTC_ALARM_CLEAR; > - else > - alarm_offset = (u32)alarm_time - current_time; > + return -ETIME; > + > + alarm_offset = (u32)alarm_time - current_time; > }