Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1883473ybl; Wed, 28 Aug 2019 23:48:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPAjddzj2Q2jAwXDrrVUrp+eMzMm1twEiaiyQvf22Gj/R/LUjsbxAZvs9aalU30Y/hSFg2 X-Received: by 2002:a62:e516:: with SMTP id n22mr9499205pff.105.1567061305811; Wed, 28 Aug 2019 23:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567061305; cv=none; d=google.com; s=arc-20160816; b=E84ScPSLv/5AM0dffU0ZsA2g8BdvOjqcLlgPDfEvhc7SjG1rDKtTQkZp5N8LWGHOGS t+KtrqprdS2hzOJyELNMnx0alwuULbjHVXAONhbL2Oie4bmEnoChNQAFXh0Dfav7L7Ta v4GF9BDzLF90Ph+DnxgD8fs35pKIbKbSPMuQwxZniBCVcuWl7P8x0GfbZdxdyzUMut2w mp/bMVoQUAr8WrdOhEKQLPO2sUU5Xf40/t8bm4iom0GReu+Zwm+8H5v9lqdP0LdGAICG /23NAl+y/tY2ATNC8oEp2wejBd0QxJWQLt72WKUQjsuixrfRQ7nGAQmyI+eBT6wI37Bk nOEg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr; bh=0wT1HP7gy4WVOt9n7tq9lThJaqnbikHuT74XhaVo06Y=; b=ixzJ4+eWVa5gXYQEz1C+RiAPGUaU1BAfy9gfSuW67px9tomcd2rKwgUlnq8nml06UL 8CUdSMXiBsWv4ZoqNSbzUk2PzzohnzIHDoiSotKqVqQuzpMRDg5hM007KNUIoQG6dhDh mVILObBQGAF80MAl/1Nj2fJfoaPYc0/Dn1r2oencA85cAfC48rewuV43jRzv18ubY2p4 Iu9D54mcVvL43CFaaKvRI8RhTKjv9cSy/O46Z3SykXEZ64ekHaVYu8T9vxd9XUpQyjQb bo60vThjpjSCLt7nv5anzc60Bsn5B/xoyB6WkAZx7+K+Q/FReTRt2NlvQ3/fPJ6QOras NG5A== 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 cp4si1087125plb.330.2019.08.28.23.48.09; Wed, 28 Aug 2019 23:48:25 -0700 (PDT) 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 S1727887AbfH2Gpz (ORCPT + 99 others); Thu, 29 Aug 2019 02:45:55 -0400 Received: from hel-mailgw-01.vaisala.com ([193.143.230.17]:47641 "EHLO hel-mailgw-01.vaisala.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726889AbfH2Gpz (ORCPT ); Thu, 29 Aug 2019 02:45:55 -0400 IronPort-SDR: FqoXct+zFHhJMNCd/gHRyGElCirhOi+C4lY5TP0Jdt5YObFMePTZWwBJIWo7z2WZ3Y5kftHqgB hDDmIYuJI7fMepslUtSpeC1aKdFYaL7eop6x/+xs3JzpuXqKYjDVnBOTBjxbmklSBBC8YWtXr1 pNpC0RBskdgH+pdZpvV82wGx0oJZ+Vf1nKA+2k+ujn/XIHVAo/STu/3KBG5pySLgQbB6zJhdj7 ICOAgt8ZeK5xBNCx3gmhmEeQza4zWhYfVvkXRmUdsBFcUvQOv8+38Ps+GBoCpS9j7qw7JFh4Tm 0L0= X-IronPort-AV: E=Sophos;i="5.64,442,1559509200"; d="scan'208";a="230033197" Subject: Re: [v5] rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w To: Biwen Li , a.zummo@towertech.it, alexandre.belloni@bootlin.com, leoyang.li@nxp.com, broonie@kernel.org Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190829021418.4607-1-biwen.li@nxp.com> From: Nandor Han Message-ID: <65a85fb2-0482-2007-4a84-b622e5308c3d@vaisala.com> Date: Thu, 29 Aug 2019 09:45:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190829021418.4607-1-biwen.li@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Aug 2019 06:45:49.0936 (UTC) FILETIME=[65139F00:01D55E35] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/29/19 5:14 AM, Biwen Li wrote: > Issue: > - # hwclock -w > hwclock: RTC_SET_TIME: Invalid argument > > Why: > - Relative commit: 8b9f9d4dc511309918c4f6793bae7387c0c638af, this patch > will always check for unwritable registers, it will compare reg > with max_register in regmap_writeable. > > - The pcf85363/pcf85263 has the capability of address wrapping > which means if you access an address outside the allowed range > (0x00-0x2f) hardware actually wraps the access to a lower address. > The rtc-pcf85363 driver will use this feature to configure the time > and execute 2 actions in the same i2c write operation (stopping the > clock and configure the time). However the driver has also > configured the `regmap maxregister` protection mechanism that will > block accessing addresses outside valid range (0x00-0x2f). > > How: > - Split of writing regs to two parts, first part writes control > registers about stop_enable and resets, second part writes > RTC time and date registers. > > Signed-off-by: Biwen Li > --- > Change in v5: > - drop robust explanation > LGTM +1 Nandor