From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 771F4C74A5B for ; Tue, 21 Mar 2023 09:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BMq/ysHgseAI0I1884uod39Cl6qX8pdIQ5LRKYLtq6U=; b=TRqiaW2DOjwAyl 43fHbrOo/YJV/DzhdAHKM7NpAy9WGFXItnSeCZaaKxc5WjgGIWRbXwtGOg6J2ypjUZyjnjQsnfR6o rYN/97u11wkyzplkwPCyCGawxnqkGohRbpTsrs9ik3yDUnTRZV+WdJFJcP03THPpduupRxgVHVQjQ POQ4aeEbTvVUhYoVm0I+Owg8Db8PQQj3LlOWqVq0dOaZsDZ2PNrjTGx+woRmZZZhxw+ETWMD9VVtr mXVHTG4YBX4tZcY4bqM9g6mc3EeuksNsxCD14yYWnNqiVXizV8LpLkkTAY2R/8zAbNmW/bqCrN5z6 lUIsemuZNGwWh87l7DEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peYfY-00BwKM-1P; Tue, 21 Mar 2023 09:52:40 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peYfU-00BwJ4-04 for linux-arm-kernel@lists.infradead.org; Tue, 21 Mar 2023 09:52:38 +0000 Received: by mail-pg1-x532.google.com with SMTP id h31so8198246pgl.6 for ; Tue, 21 Mar 2023 02:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1679392353; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Z3kX+a3qX70gDW/sRmJECpI+SbkCmpJ7AHS+lpfkXrc=; b=qN1HdQEXAKwyg8f8tmCYeLPkol3DzseNWV6yuSD8gPiJ/vNJXPpDYfZ9zM83OQbmwR Ip+s6G7EQlkvuRJwFovHg+sjGjbTBcRnfktsPCMOf4SFO3b4PpqdS5CSOTJhdv3PMlUn FM8MqPseAIzQvi50R96jXBTSU6RJs45+47hpx3X9EIwjjiKJMUAVM7Onn7XyDrK1coL2 mKagWc7LJxeDmIETvO8gLMlwmLCjblfgDTj84zw/tB9I627jBDIWdaC6DIRxJpKxBc22 vPL7rRjMC7M/8bx2XKUsni/LjxqGlvc6FWoA9M2q2Z4SyLqzHLqg5qTpfHI0CSPyzZsO m/PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679392353; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z3kX+a3qX70gDW/sRmJECpI+SbkCmpJ7AHS+lpfkXrc=; b=v9u/Ukd92u29dz5vajtnXOFSMKoFPdB/E0gUqdDiwGqFjKNcYT/ofU1XwEJ8TM4B4K Iy7nGFh0Sx9AKBzL+c/a0N17obIZv8kFvt9w0pcdtQHTnqomn42vEfZqB2pM71yWRqxJ +p8RZEeMMtjo6cTu8sobr9kCqje9JypUmohtxIDPDOFqEnyaX35RvtMO1Q29mp4EyHY2 Wost0T5lm5MmTsQnpEfFqxoPw+1LwPTfqYQ4yYeexy6vpEcpfcxRZxW28DEVVpZ8cIgm rv84g3SpDDPpAl1vdYf9534v6uoTgboIFQwGBNZ2hzhyYSUYnc6ThbSmtIV/baL31vXW gKUg== X-Gm-Message-State: AO0yUKUJpnaeQTzol4k4AX0epU1yfgZPcEbCp5u6CT9p+VjzP2OsT9HU VsLjnz1Y31czpvuT2WnIADe9bg== X-Google-Smtp-Source: AK7set8l8FeYzQFjltUm3v4e/D0eeBLpFn2IDwYmXFiw33WAeQ3He5HzXT9vccYmxhfHduptUCglAg== X-Received: by 2002:aa7:98db:0:b0:624:9205:977d with SMTP id e27-20020aa798db000000b006249205977dmr1464992pfm.27.1679392352621; Tue, 21 Mar 2023 02:52:32 -0700 (PDT) Received: from localhost (63-228-113-140.tukw.qwest.net. [63.228.113.140]) by smtp.gmail.com with ESMTPSA id b5-20020aa78705000000b005a852450b14sm7801451pfo.183.2023.03.21.02.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 02:52:32 -0700 (PDT) From: Kevin Hilman To: Martin Blumenstingl , linux-rtc@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: Alessandro Zummo , Alexandre Belloni , Neil Armstrong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: Re: [PATCH v1 RFC] rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time In-Reply-To: <20230320212142.2355062-1-martin.blumenstingl@googlemail.com> References: <20230320212142.2355062-1-martin.blumenstingl@googlemail.com> Date: Tue, 21 Mar 2023 02:52:31 -0700 Message-ID: <7hbkkmwhwg.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230321_025236_060484_A93DDBAC X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Martin Blumenstingl writes: > The VRTC alarm register can be programmed with an amount of seconds > after which the SoC will be woken up by the VRTC timer again. We are > already converting the alarm time from meson_vrtc_set_alarm() to > "seconds since 1970". This means we also need to use "seconds since > 1970" for the current time. > > This fixes a problem where setting the alarm to one minute in the future > results in the firmware (which handles wakeup) to output (on the serial > console) that the system will be woken up in billions of seconds. > ktime_get_raw_ts64() returns the time since boot, not since 1970. Switch > to ktime_get_real_ts64() to fix the calculation of the alarm time and to > make the SoC wake up at the specified date/time. Also the firmware > (which manages suspend) now prints either 59 or 60 seconds until wakeup > (depending on how long it takes for the system to enter suspend). > > Fixes: 6ef35398e827 ("rtc: Add Amlogic Virtual Wake RTC") > Signed-off-by: Martin Blumenstingl Reviewed-by: Kevin Hilman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel