Received: by 10.223.176.5 with SMTP id f5csp1218160wra; Wed, 31 Jan 2018 03:09:02 -0800 (PST) X-Google-Smtp-Source: AH8x225nX++H5DZ9u3GVmjghW+nB23CO124O9nLEuIhXdUxISFBynwFVWrpeBwVly3MXfwuKSgaG X-Received: by 10.98.68.129 with SMTP id m1mr24997819pfi.171.1517396942328; Wed, 31 Jan 2018 03:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517396942; cv=none; d=google.com; s=arc-20160816; b=BTzus/R2fcr+GhQjYEp2KVjBFzkejVMXc61YAWNT3YsdkT/MY2jxYx7paZHAwfrBcJ t9/ZCCYLXYjdiwbBOsK1X8gXaLXrXdYC8/zDAU6BekDu4dA+ZglFPrHkLKaXELC93aTk noSjD4QNom23jfuBGZ8yvimgUpElgiet4GmoPJpwsSp8NRxJfhj7XRGUb6W2frIfyryR ui3ve70jvPcgs/JOFiLJyZk/xS5TBTbZJXZVPAOiKRI4yACnThp/f/Odfr+XPOQsOdZ3 aNxTMvkY9C7QE6zbZPLjiXdgVqniBwbSR40oGF7D2LQHmJFccx/6PirEsy/2iTc2iEhb RYeQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=4CYYDMlZxG7xDLg86xoO3gVKCI3cqs0J+UoEeIzmUmI=; b=T/EjfCgqMS7eBhoQ6iw6Cpgb+uQ88Z8kdEBXnQYxCfdRh+Ce4NTLq7RlbwyetOgzmp EaUlU7XR9mmPsAPXf4ROQEZSDSJoo4fHu3PVYRfbCjGAlPsfCGxAM4VpdUz8qzPQhBRF 5PMPVGLfirFGsAt2KtlbZxNnBMy7O+rvSZ4sl3zGWkl5yeZVsAmap20dA77DGBp7Ddcc Tmph3tchpRP21LOlZ6gIdbnKj3031HQBx78fSBBVDYUJ4lMIS3/D+srl8gHcPlXW8kTh AFa3JNtsL9eZnhWe7L7mSTJK8Zs2a7uJQ65eYGWSA5W1BQUDWc3xpj7SS4q2T1/guMn8 vTbg== 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 w85si3544953pfi.137.2018.01.31.03.08.47; Wed, 31 Jan 2018 03:09:02 -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 S1752946AbeAaKyX (ORCPT + 99 others); Wed, 31 Jan 2018 05:54:23 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:42117 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbeAaKyU (ORCPT ); Wed, 31 Jan 2018 05:54:20 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id BC51321A2F; Wed, 31 Jan 2018 11:54:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.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.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8D54A21A29; Wed, 31 Jan 2018 11:54:18 +0100 (CET) Date: Wed, 31 Jan 2018 11:54:18 +0100 From: Alexandre Belloni To: Guenter Roeck Cc: Denis OSTERLAND , "linux-rtc@vger.kernel.org" , "a.zummo@towertech.it" , "kernel@pengutronix.de" , "mgr@pengutronix.de" , "jdelvare@suse.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 4/4] rtc: isl1208: add support for isl1219 with hwmon for tamper detection Message-ID: <20180131105418.GP2809@piout.net> References: <20180123121801.4214-1-m.grzeschik@pengutronix.de> <20180123121801.4214-5-m.grzeschik@pengutronix.de> <20180123182254.GA27379@roeck-us.net> <20180124090333.r5o2mzpm4q536w4r@pengutronix.de> <20180129215919.GA17988@roeck-us.net> <20180130102740.GD2809@piout.net> <1517312409.5307.22.camel@diehl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/01/2018 at 06:15:18 -0800, Guenter Roeck wrote: > On 01/30/2018 03:40 AM, Denis OSTERLAND wrote: > > Am Dienstag, den 30.01.2018, 11:27 +0100 schrieb Alexandre Belloni: > > > On 29/01/2018 at 13:59:19 -0800, Guenter Roeck wrote: > > > > > > > > On Wed, Jan 24, 2018 at 10:03:33AM +0100, Michael Grzeschik wrote: > > > > [ ... ] > > > > > > > > > > > > > > > > > > > > > > > > > + > > > > > > > diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface > > > > > > > index fc337c317c673..a12b3c2b2a18c 100644 > > > > > > > --- a/Documentation/hwmon/sysfs-interface > > > > > > > +++ b/Documentation/hwmon/sysfs-interface > > > > > > > @@ -702,6 +702,13 @@ intrusion[0-*]_alarm > > > > > > > ? the user. This is done by writing 0 to the file. Writing > > > > > > > ? other values is unsupported. > > > > > > > +intrusion[0-*]_timestamp > > > > > > > + Chassis intrusion detection > > > > > > > + YYYY-MM-DD HH:MM:SS UTC (ts.sec): intrusion detected > > > > > > > + RO > > > > > > > + The corresponding timestamp on which the intrustion > > > > > > > + was detected. > > > > > > > + > > > > > > Sneaky. Nack. You don't just add attributes to the ABI because you want it, > > > > > > without serious discussion, and much less so hidden in an RTC driver > > > > > > (and even less as unparseable attribute). > > > > > Right; but it was not meant to be sneaky. I should have stick to my first > > > > > thought and label this patch RFC. Sorry for that. > > > > > > > > > > > > > > > > > In addition to that, I consider the attribute unnecessary. The intrusion > > > > > > already generates an event which should be sufficient for all practical > > > > > > purposes. > > > > > Would it make sense in between the other sysfs attributes of this driver? > > > > > > > > > I don't understand what you mean with that, sorry. > > > > > > > > From an ABI perspective, the attibute doesn't add value since it is > > > > highly device specific (or at least it is the only chip I am aware of > > > > which reports such a time stamp). Feel free to add the attribute to the > > > > driver and document it, but not as part of the hwmon ABI. In that > > > > case I would be inclined to accept it. However, keep in mind that > > > > your version, reporting a human readable date/time, would effectively > > > > preclude it from ever making it into the ABI. > > > > > > > Actually, there are many RTCs that are able to register one or more > > > timestamps. My plan was to add support for that soon but I was not > > > planning to do so in the hwmon ABI as this may be used for something > > > that is not intrusion detection (interval timers for example). > > What would you suggest? > > I think about something like this: > > event[0-*]_timestamp: timestamp in seconds since epoch or empty if not triggered > > event[0-*]_alarm: 1 if event was triggered, else 0; write 0 to clear event > > Sure, that makes sense if the events are not specifically related > to intrusion detection. Question is if there would ever be more than one > or if event_timestamp and event_alarm would be sufficient. > My target is a PCF85363A which supports up to 3 timestamps. SO I'd go for timestamp[0-*]. This would be empty if it never triggered (or the timestamp is invalid) writing anything to that file resets the event. I don't think we need more than one file per timestamp. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com