Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbdHaJPs (ORCPT ); Thu, 31 Aug 2017 05:15:48 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34159 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbdHaJPr (ORCPT ); Thu, 31 Aug 2017 05:15:47 -0400 Date: Thu, 31 Aug 2017 11:15:45 +0200 From: Pavel Machek To: Nikita Yushchenko Cc: Andrey Smirnov , linux-kernel , Chris Healy , Lucas Stach , Lee Jones , Greg Kroah-Hartman , Jeff White Subject: Re: [PATCH v6 1/2] platform: Add driver for RAVE Supervisory Processor Message-ID: <20170831091545.GC12920@amd> References: <20170828163131.24815-1-andrew.smirnov@gmail.com> <20170828163131.24815-2-andrew.smirnov@gmail.com> <20170830105515.GA4926@amd> <20170830203817.GA15462@amd> <35163bfd-d34f-40af-2494-340b6fe92b03@cogentembedded.com> <20170831081820.GB9597@amd> <4eca3066-8194-6fae-fec5-498b94347a65@cogentembedded.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IpbVkmxF4tDyP/Kb" Content-Disposition: inline In-Reply-To: <4eca3066-8194-6fae-fec5-498b94347a65@cogentembedded.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1893 Lines: 59 --IpbVkmxF4tDyP/Kb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2017-08-31 12:01:01, Nikita Yushchenko wrote: > >> I think that trying to make this generic is purely synthetic. This > >> information is board-specific per it's nature, it comes from what board > >> is designed for, different boards have quite different sets of possible > >> reset reasons. What is needed is - pass this board-specific information > >> to board-specific user space. > >> > >> What's proper API for that, if not a sysfs attribute? > >=20 > > Please go through the thread. > >=20 > > Sysfs attribute is okay, but: > >=20 > > 1) it should probably be a string > >=20 > > 2) it should certainly be superset of all the reasons > >=20 > > 3) it should be in generic place, say /sys/power/reset_reason > >=20 > > 4) it should be documented what each state means >=20 > What I'm concerned here is that a requirement appears for kernel driver > to keep and maintain knowledge of what all that codes mean. For me, There's no way around that. Kernel interfaces need to be documented. If you are passing codes between kernel and application, _those codes need to be documented_. =20 > So question is - is there any proper API to communicate > application-private information from hardware through kernel to > userspace without any in-kernel interpretation? No. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --IpbVkmxF4tDyP/Kb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlmn08EACgkQMOfwapXb+vL3MACeN1p8d6LSI+JVFuJCNZTiILQ2 mWYAn0P6lfmr7tVqQTKLtCYUR6pW1LrZ =qI74 -----END PGP SIGNATURE----- --IpbVkmxF4tDyP/Kb--