Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6607006imu; Wed, 14 Nov 2018 04:20:52 -0800 (PST) X-Google-Smtp-Source: AJdET5fLXhHvC9eZI25Oac1SiSJAFrKCl1GdLbZuYb0ZrV9Rihx6MHoW2XIqDcUV2MOXieWFdz7v X-Received: by 2002:a65:514c:: with SMTP id g12mr1519704pgq.169.1542198052573; Wed, 14 Nov 2018 04:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542198052; cv=none; d=google.com; s=arc-20160816; b=X6n1fTdfRiLXkc2htGOIyCCFqHyN/TUR8SqtPCc08ydUBWDllQOL3LUptSMQgW0yb6 eHFLNuahuevr+PpKqn4jF/tKrYNuUviT9MqxBPMITAUToQy8reXuSPUuQGmtNOnpUSQk npYguihWe9ZBYFPgt6VDwImEFei3QOJsyspgUmuFwJ+b0AeoQtlSncnoFt1S/kMHdaD3 PTUhsw9XBH4eI/o8aAUFPczHQNnwSz4YEQhATytf6y6Svo23JUQm1S8r1J2S5fGMCC1w Nu9YunQRt8iw2eupG8DQ3u19z9MWNvo2TAVivqxs33p6M5W6J9Y/jqtbZ+whKxte4j6F qCwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=spWWXTZNyDHCkJY5APcUiBLe7AS3VELpjRoYGENlxik=; b=P9Q48FQnHxwYPFkLDtOeJ3J5G+DrX1LT40UQTOoDheHyY2VM+HW5DWDzkX1abR3wWw Yootq14KDtfaVbkgeTEIwqJgeMi4URh5wyLtjeBQNNsd3TFJsqxUsug/KU8tBuY/0/qd l+pAg4xwLEoePld6k6ry9Evl20ye6iiRdHfkSZMP1F9+IehNnSilfmIIhWSQ6Qca+4cX Vpm9OKq8UBBU41AI8+ur10ImTno1Pk3pyW/yzcTpRPmIEL0vKWmsvyMOUEge1GbjgVL6 IBLeQBnw6aKc2w+5UrTqxeyhf//IYzidJwtnmHF1itrbGn+tAfUo1Tz4BR1ctnEZbWFo sYFQ== 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 h16si23956465pgh.283.2018.11.14.04.20.36; Wed, 14 Nov 2018 04:20:52 -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 S1728143AbeKNWXJ (ORCPT + 99 others); Wed, 14 Nov 2018 17:23:09 -0500 Received: from mail.bootlin.com ([62.4.15.54]:33575 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbeKNWXJ (ORCPT ); Wed, 14 Nov 2018 17:23:09 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id A8BFB206FF; Wed, 14 Nov 2018 13:20:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 4218C20510; Wed, 14 Nov 2018 13:20:06 +0100 (CET) Date: Wed, 14 Nov 2018 13:20:05 +0100 From: Alexandre Belloni To: "Maciej W. Rozycki" Cc: Alessandro Zummo , Matt Turner , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: m41t80: Complete error propagation from SMBus calls Message-ID: <20181114122005.GY29768@piout.net> References: <20181114095737.GV29768@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/11/2018 12:05:14+0000, Maciej W. Rozycki wrote: > On Wed, 14 Nov 2018, Alexandre Belloni wrote: > > > > I'll be posting further patches over the coming weeks, based on my > > > original effort as archived here: , > > > > > > However I have just realised they'll need another iteration before I post > > > them. So for now just these two obvious fixes. > > > > > > > Regarding the persistent part, do you really need more than what is > > provided? As far as I know, the timekeeping core is already taking care > > of using the best source to get the suspended time. > > For that we have platform code duplicating what the RTC framework > already does. Some of that cannot be made to work reasonably. See e.g. > arch/mips/dec/time.c or arch/mips/sibyte/swarm/rtc_*.c. > > The DEC code is technically sound, but spreads the same function (RTC > r/w access) across another place, in addition to drivers/rtc/rtc-cmos.c. > The SiByte code bypasses the I2C driver and therefore cannot be > converted to use I2C interrupts, which means system latency problems. > The write part used for NTP can be removed right away by making it > return -ENODEV, and I have separate patches to do that for these > platforms. The read part cannot AFAICT. > > I think we can discuss that when I post the patches. The m41t80 driver > currently does not work for me anyway and has to be fixed because of: > > i2c /dev entries driver > i2c-sibyte: i2c SMBus adapter module for SiByte board > i2c i2c-1: doesn't support I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_I2C_BLOCK > > and the persistent part is only one patch in the upcoming number of > changes. > Well, one of the solution for that (and tis is on my todo list) is to convert the driver to use regmap which would take care of using the proper i2c transfers. However, one of the concern when not having bock accesses is that the registers are not latched (as you seem to know). One thing I would like is then to avoid the multiple SEC register read when not necessary. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com