[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180905145858.4ny5c7xojn7aiwlv@flea>
Date: Wed, 5 Sep 2018 16:58:58 +0200
From: Maxime Ripard <maxime.ripard@...tlin.com>
To: Icenowy Zheng <icenowy@...c.io>
Cc: Philipp Rossak <embed3d@...il.com>, mark.rutland@....com,
geert+renesas@...der.be, linux-iio@...r.kernel.org,
robh+dt@...nel.org, linux-sunxi@...glegroups.com,
clabbe.montjoie@...il.com, pmeerw@...erw.net, lee.jones@...aro.org,
lars@...afoo.de, quentin.schulz@...tlin.com, linux@...linux.org.uk,
wens@...e.org, devicetree@...r.kernel.org, arnd@...db.de,
vilhelm.gray@...il.com, broonie@...nel.org,
linux-arm-kernel@...ts.infradead.org, rdunlap@...radead.org,
arnaud.pouliquen@...com, linux-kernel@...r.kernel.org,
lukas@...ner.de, knaack.h@....de, eugen.hristev@...rochip.com,
jic23@...nel.org
Subject: Re: [linux-sunxi] Re: [PATCH v3 21/30] iio: adc: sun4i-gpadc-iio:
add support for H3 thermal sensor
On Mon, Sep 03, 2018 at 07:01:47PM +0800, Icenowy Zheng wrote:
> 于 2018年9月3日 GMT+08:00 下午6:20:22, Maxime Ripard <maxime.ripard@...tlin.com> 写到:
> >On Fri, Aug 31, 2018 at 05:51:41PM +0800, Icenowy Zheng wrote:
> >> Personally I suggest to leave out all SID or calibration related
> >> patches here.
> >>
> >> Currently we seems to be wrongly converting SID to big endian,
> >however,
> >> the orgnization of the THS calibration data on H6 shows that it's
> >> surely little endian:
> >>
> >> It consists a temperature value in 1/10 celsuis as unit, and some
> >> thermal register readout values, which are the values read out at the
> >> given temperature, and every value here (the temperature and the
> >> readout) are all half word length.
> >>
> >> Let the temperature value be AABB, the two readout values be XXYY and
> >> ZZWW, the oragnization is:
> >> BB AA YY XX WW ZZ ** ** .
> >>
> >> When converting the SID to big endian, it becomes:
> >> XX YY AA BB ** ** ZZ WW ,
> >> which is non-sense, and not able to do sub-word cell addressing.
> >>
> >> Maxime, should I drop the LE2BE conversion in SID driver? (I doubt
> >> whether it will break compatibility.)
> >
> >This is exposed to the userspace, so no.
>
> Please note the LE2BE totally breaks the SID addressing.
On which SoCs?
> Without it dropped all cells must be referenced with 4 byte word as
> unit, and half word addressing of SID is thus not possible. The
> driver will also need then to split the half words if needed.
>
> I think this is kind of hardware misbehavior, and not a simple
> UAPI change, so the UAPI stability shouldn't affect this change.
How would you feel having your files on your filesystem suddenly not
in the same endianness and having all the bytes reordered? This is
definitely about the userspace ABI.
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists