Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5228893ybl; Tue, 27 Aug 2019 01:10:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfrhzQ4x+RjOVvP67jWfjW3rdeafsUOAh1cn08fnd5JX0K7O6jct7VmcaEnT0lAVMt4YMx X-Received: by 2002:a17:90a:8c0f:: with SMTP id a15mr23025399pjo.112.1566893405288; Tue, 27 Aug 2019 01:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893405; cv=none; d=google.com; s=arc-20160816; b=fjm4I6yUGWrXs+BDsxG5QiNdTAGuEnCOBriTafdLclAM/mmzhYGN1eCgKHscveefGG +ilBRrOwtevgzIIIngIG2rNMAbzEFXHA8y4FRK7t2ZNRrP5hgereEyeR6qiv/ES1aGLb x/Nec0cUtXyyuQB1wWijw7ROyS/I+MU10zDmYY5Bh/W1/thvX5pxYNVGgseYtPUciyVg OlzakfBd97zodd7JPqbVDngdbCGats98w3J2uTT3Kn8w/fQ3nUh1WQozVbw1leYafBBr 8ZyYf6BiAeFaXwgr0NEg0zftVSOLducKBGjnjjvmQsqWA9Fi3npseelSmnJTTd/F0/dH L1Gg== 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=8oFQBGg42TB/5YlCmhGjLDYO+VnurpDfLwwunkjhVRA=; b=iMib7k6rgrjWrhnqd7Mde9osZyDdPUMxRNf9DL4QIe9QSItwgYYwlLSmEVkJ8LcIzh fxQkMj6WshQCjCeFuewVYNyXmJ/tNg8c39c/0zmSh250jp88SfJQ0f6QR24Eft3PBS5v 7iRAAJ1qnjZuhSom5crTux6hLmBEcEQ2ct7Rk1O2LmsyamRx1MkQKiVGAUXOh+CLZRvO hcDmuwWATdHJtK4MPtbCDXgBJTsU0FFzjF2Q/MPDDGkQWR/Y0bycl6gYoYH4GUIk7M8L WuaT6N846efN4EXjLB/FkOCXUpNZBwDrAlFb3j3XmQvRjWtDW7zC1fqL7nGho8E+/p2j BTQA== 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 y4si11750189plr.25.2019.08.27.01.09.49; Tue, 27 Aug 2019 01:10:05 -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 S1733188AbfH0IHd (ORCPT + 99 others); Tue, 27 Aug 2019 04:07:33 -0400 Received: from hel-mailgw-01.vaisala.com ([193.143.230.17]:1433 "EHLO hel-mailgw-01.vaisala.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730471AbfH0IH3 (ORCPT ); Tue, 27 Aug 2019 04:07:29 -0400 IronPort-SDR: okybydZ720+8OTwnjqV7ZPqywGZbnhKb8NRjL2NRQMPXdMcSBwJyoLUqB8v5ZMm4sxpVvvlpFx hOfUACiyFH6O8EAks9bxBSd72rCqjZODFF3YyLrDtzw8xpU6sK0/ddpK0tVouK1qzwK+wUFswv WREYy70Tr7Zje/3PAirQo+ORfuq9/3sdwKmPQnDL827V2U2PKdGccPFHljqaNYJQ3/KJLfHNne VecGmHAFdce0jaVJgYrohFH6mGfaFeQ/MvvJmpf4N+hNp9bzPO+u/pLYrUfouBhpWUGb5kn1E7 acs= X-IronPort-AV: E=Sophos;i="5.64,436,1559509200"; d="scan'208";a="229735730" Subject: Re: [v4] 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: <20190827043735.31231-1-biwen.li@nxp.com> From: Nandor Han Message-ID: <2b49e282-fc03-ee59-2719-5a3c1ce573ce@vaisala.com> Date: Tue, 27 Aug 2019 11:07:24 +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: <20190827043735.31231-1-biwen.li@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Aug 2019 08:07:24.0220 (UTC) FILETIME=[757897C0:01D55CAE] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/27/19 7:37 AM, Biwen Li wrote: > - In drivers/rtc/rtc-pcf85363.c, CTRL_STOP_EN is 0x2e, but DT_100THS > is 0, max_regiter is 0x2f, then reg will be equal to 0x30, > '0x30 < 0x2f' is false,so regmap_writeable will return false. > > - The pcf85363/pcf85263 has the capability of address wrapping > which means if you access a continuous address range across a > certain boundary(max_register of struct regmap_config) the > hardware actually wraps the access to a lower address. But the > address violation check of regmap rejects such access. nitpick: This 2 paragraphs could be combined to clear up the issue: ` The pcf85363/pcf85263 has the capability of address wrapping which means if you access an address outside the allowed range (0x00-0x2f) the hardware actually wraps the access to a lower address. The rtc-pf85363 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). ` nitpick: I would also use separate buffers for this actions. Up to you :) Otherwise LGTM +1 Nandor