Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp229878pxb; Thu, 12 Nov 2020 02:12:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRmO8FcW/xcPt2fIDVr3Nc2OXmSJPS1jpW1mH0/dYojZ1Y7MIUWzgUVrs/vZSL6bXe8vs/ X-Received: by 2002:a17:906:1186:: with SMTP id n6mr18551482eja.89.1605175947259; Thu, 12 Nov 2020 02:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605175947; cv=none; d=google.com; s=arc-20160816; b=qSTBg9shEYlCBaD6/GXrAOC8lT4kdFLTWjXpLR7kq3ae64JzBLY81ZshhZI7N1PWMZ k9/LHpZXIPZRgM/30DIVkG4DmLf6ZARwAb1lCnAjDSmUpjmnhit0A58OJzaGP6si9eyS LHMDirG28s3TLAcPtlWQ3Q3cklwTV7kzIrPszOiMnJset8djVzr2q0lXzAAQ/EM32f8X 2BeYAVikXTnpG9Wk4GO9PPR6z3HNE8LNQ25dRrwL+SSOPNJkuJbqCBNlYqK09ieJXrCc AURiFWz4SR5QyGDfMJNzt9E+VdFEb+Xg/LOGsRChNPPXgT5az9d8eeVnSQJ1pwV48ZZX cdTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:references:cc:to:from :subject:dkim-signature:ai-spam-status:dkim-signature; bh=X/dOPECXgjK7RRBOu1F59o3D3Uxne5l8z67ITOEq8Tg=; b=aARBqzzjU7apwG8XFF0iI6QGxV/RKVO3P+/yysnbfve9cbbGiFFONLSa/uqgSK0twd YdrDmBW2WXx/mLyl04bb8eudGqCJ3YHImfQpRBrDxBFIheENBmPnGd879dkV5WR7VL5p q2zsesohzOuQBUtj80GVTNTDoyeBpy0+8xrTxyRO0p4gcSxonuAeZzCck6E5nl5abu9B NTGhryxYVZV1PENfzBKsBnCNNetoADQZwPZTHDDMxs461XeZq1MqKiyS4VL3P8zBtAuS Jlic4sPaGD+SNt+GYXFbD6el7dkXVEQ5pct+/AAUeiz291FbRAcDoAK+wvHCL/BLI/Qt B7TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mymailcheap.com header.s=default header.b=TvLxNDXH; dkim=fail header.i=@flygoat.com header.s=default header.b="LD4GEss/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si3077184ejx.477.2020.11.12.02.12.04; Thu, 12 Nov 2020 02:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mymailcheap.com header.s=default header.b=TvLxNDXH; dkim=fail header.i=@flygoat.com header.s=default header.b="LD4GEss/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbgKLKJg (ORCPT + 99 others); Thu, 12 Nov 2020 05:09:36 -0500 Received: from relay3.mymailcheap.com ([217.182.66.161]:49915 "EHLO relay3.mymailcheap.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbgKLKJf (ORCPT ); Thu, 12 Nov 2020 05:09:35 -0500 Received: from filter2.mymailcheap.com (filter2.mymailcheap.com [91.134.140.82]) by relay3.mymailcheap.com (Postfix) with ESMTPS id 3E63B3ECDF; Thu, 12 Nov 2020 11:09:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by filter2.mymailcheap.com (Postfix) with ESMTP id 22C532A7E9; Thu, 12 Nov 2020 11:09:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mymailcheap.com; s=default; t=1605175772; bh=NlIHu2jLAeMCc08fA5CldPEhSWuTo3YbGR98d+676LU=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=TvLxNDXH+yPXYcA8PquO6rIiQnOcsDFHi3p420QeEhQfDBNd/ZYjDBb2jzoCaGINO L2cfz/BT5vnYgCaLTqw/2yP6j1KaAEO2x7hNXgHFNrGuFJjaF7fXhsNorSWmY4Ac69 eqNktyJwXzmEtChMfASexPUnR3BaHYYEFeTbcqz0= X-Virus-Scanned: Debian amavisd-new at filter2.mymailcheap.com Received: from filter2.mymailcheap.com ([127.0.0.1]) by localhost (filter2.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fh95Qr0wFCol; Thu, 12 Nov 2020 11:09:31 +0100 (CET) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter2.mymailcheap.com (Postfix) with ESMTPS; Thu, 12 Nov 2020 11:09:31 +0100 (CET) Received: from [148.251.23.173] (ml.mymailcheap.com [148.251.23.173]) by mail20.mymailcheap.com (Postfix) with ESMTP id A4EA441DB0; Thu, 12 Nov 2020 10:09:30 +0000 (UTC) Authentication-Results: mail20.mymailcheap.com; dkim=pass (1024-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.b="LD4GEss/"; dkim-atps=neutral AI-Spam-Status: Not processed Received: from [0.0.0.0] (unknown [113.52.132.214]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id DCF9541DB0; Thu, 12 Nov 2020 10:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=default; t=1605175763; bh=NlIHu2jLAeMCc08fA5CldPEhSWuTo3YbGR98d+676LU=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=LD4GEss/iLp7HkKvA+8OdNvI5FK0c5bHB3V+LYMIGNRO5L6yDQllFAssI/Q1XY93T UEH8tF6S0qfzVxSASRGlGv6+yrWAgjAn93RdrEVZnKMXNE1Hi9D2AR2/yg+8IW9MvK JYHbLoDIWY80YheoNu+Qmgwk1yZDuY60s5xVjZVs= Subject: Re: [PATCH] MIPS: Loongson64: Add read_persistent_clock64() From: Jiaxun Yang To: Tiezhu Yang , Thomas Bogendoerfer , Huacai Chen Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Yinglu Yang References: <1605169793-10481-1-git-send-email-yangtiezhu@loongson.cn> <8d6ebfe2-e300-3f38-6316-196cba947d36@flygoat.com> Message-ID: Date: Thu, 12 Nov 2020 18:09:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <8d6ebfe2-e300-3f38-6316-196cba947d36@flygoat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4EA441DB0 X-Spamd-Result: default: False [2.90 / 10.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(0.00)[flygoat.com:s=default]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RECEIVED_SPAMHAUS_XBL(3.00)[113.52.132.214:received]; MIME_GOOD(-0.10)[text/plain]; R_SPF_SOFTFAIL(0.00)[~all:c]; ML_SERVERS(-3.10)[148.251.23.173]; DKIM_TRACE(0.00)[flygoat.com:+]; DMARC_POLICY_ALLOW(0.00)[flygoat.com,none]; RCPT_COUNT_SEVEN(0.00)[7]; DMARC_POLICY_ALLOW_WITH_FAILURES(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:148.251.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; HFILTER_HELO_BAREIP(3.00)[148.251.23.173,1] X-Rspamd-Server: mail20.mymailcheap.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/11/12 18:04, Jiaxun Yang 写道: > Hi Tiezhu, > > 在 2020/11/12 16:29, Tiezhu Yang 写道: >> Add read_persistent_clock64() to read the time from the battery backed >> persistent clock. With this patch, we can fix the wrong time issue due >> to the system clock is not consistent with hardware clock after resume >> from sleep state S3 (suspend to RAM), at the same time, the system time >> can be right instead of "Thu Jan 1 08:00:00 CST 1970" without rtc >> driver. >> >> start_kernel() >>    timekeeping_init() >>      read_persistent_wall_and_boot_offset() >>        read_persistent_clock64() >> >> timekeeping_resume() >>    read_persistent_clock64() >> >> timekeeping_suspend() >>    read_persistent_clock64() > > It is highly discoraged to do anything with bridgetype, which isn't > probed via > devicetree. > > Please check if you can deal with that inside RTC framework, or make > it as > a part of RTC driver (e.g. set up a callback). > > Also you should submit RTC driver at first if you intend to complete > LS7A support. Oops, Just dig it deeper, I guess simply select RTC_HCTOSYS would solve the issue. We're trying very hard to decouple all the drivers and conponents, DeviceTree for all! > > Thanks. > > - Jiaxun > >> >> Signed-off-by: Yinglu Yang >> Signed-off-by: Tiezhu Yang >> --- >>