Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58445 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbdITHfK (ORCPT ); Wed, 20 Sep 2017 03:35:10 -0400 Message-ID: <1505892898.30138.7.camel@aj.id.au> Subject: i2c: aspeed: Two fixes addressing clock and hold-time configurations From: Andrew Jeffery To: stable@vger.kernel.org Cc: Joel Stanley , brendanhiggins@google.com, wsa@the-dreams.de Date: Wed, 20 Sep 2017 17:04:58 +0930 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Wrrj5fBlWNFSKx5nate5" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-Wrrj5fBlWNFSKx5nate5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, At the request of Wolfram[1] I'm proposing two patches for inclusion in the= stable tree for v4.13: [1] https://lkml.org/lkml/2017/8/29/111 Subject: i2c: aspeed: add proper support fo 24xx clock params Commit ID:=C2=A0 87b59ff8d1d9d809c014a4e20bc043064b6e0047 Justification: =C2=A0=C2=A0=C2=A0=C2=A0The commit message of 87b59ff8d1d9 suggests: =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0This also fixes a potential= issue where clock dividers were rounded down =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0instead of up. =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0This turns out to be true in practice: Whilst inves= tigating problems =C2=A0=C2=A0=C2=A0=C2=A0with some I2C devices on an AST2500 system, it was = observed via a scope =C2=A0=C2=A0=C2=A0=C2=A0that the bus was marginally overclocked with respec= t to both the =C2=A0=C2=A0=C2=A0=C2=A0requested bus speed and the maximum bus speed for t= he misbehaving =C2=A0=C2=A0=C2=A0=C2=A0device. 87b59ff8d1d9 resolved the problem, bringing= the bus speed back =C2=A0=C2=A0=C2=A0=C2=A0in-spec for the device. =C2=A0=C2=A0=C2=A0=C2=A0Up front, the patch violates one of the stable rule= s by being slightly too =C2=A0=C2=A0=C2=A0=C2=A0large, however it does fix a real-world issues, bot= h for the AST2400 and =C2=A0=C2=A0=C2=A0=C2=A0the AST25xx, and as such I think it's worth conside= ration. Subject: i2c: aspeed: Retain delay/setup/hold values when configuring bus f= requency Commit ID: 95fd3ad9cd5f8a4bb01215b846a3c8e6adefe21c Justification: =C2=A0=C2=A0=C2=A0=C2=A0The commit message explains: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0aspeed_i2c_init_clk() was p= erforming a direct write of the generated =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0clock values rather than a = read/mask/modify/update sequence to retain =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0tBUF, tHDSTA and tACST, and= therefore cleared the tBUF, tHDSTA and tACST =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0fields on the AST2400. This= resulted in a delay/setup/hold time of 1 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0base clock, which in some c= onfigurations is not enough for some devices =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(e.g. the MAX31785 fan cont= roller, with an APB of 48MHz and a desired =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bus speed of 100kHz). =C2=A0=C2=A0=C2=A0=C2=A0The result in this instance was, that without the p= atch, the MAX31785 =C2=A0=C2=A0=C2=A0=C2=A0device was not accessible on the bus. =C2=A0=C2=A0=C2=A0=C2=A0As a note, 95fd3ad9cd5f depends on 87b59ff8d1d9, th= ough as mentioned =C2=A0=C2=A0=C2=A0=C2=A087b59ff8d1d9 stands as a fix in its own right. Cheers, Andrew --=-Wrrj5fBlWNFSKx5nate5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIcBAABCgAGBQJZwhoiAAoJEJ0dnzgO5LT57e0P/iaR4K6jl21UFrTT4q1xnsT1 CjzhFH3q/iEghkJYzeVR8cHCpRSRH+aWZt1RIV/0BXxzZir5R6aAR4npqUvqFmd5 5tfBafPIZRwwqB0OfoI2cJspwViDOPIzf8RDt4ONttvvqE5tJqpXVWaGTxxXHHH+ XbeGfj1sleez5EVTIXrk3XGalulTk6hmfHPSmrkFJmegOhUwTJkT3Md7OmCH0nN/ ZNxaZ8VbaTXDXVBhZRnMNe5l3Xi27aZ5JNbDETa0KQkEB4DsqEt5lRt/f5Blcm9F Kaa7mXv1cmi5yWpt/R614nSveKUK48MigMTnme9QrMaH4o7X4T0eBM+F/xN6j9MH JN0ERrCwTF9NccUbVyD5UWJ6lW1biVj0Y9aJg23SHHA1mFO+vJ4x2aqPOTMNheTM Z4vb/f1k8DGPbFRo/G8+rAgs3HhDIh+bWExrtPfIyxRzNNVw5OAb9oOziwGfILsS bRS1DQC5m70Wxz64aG/6GbYifiptjRfiQiIONkqccRNAv6xMei8rg7jISLdviWtO CDYJSKHF5DsKGL1YlfMBD0YanxiSVPCMwixru7rvOCPHmxuNY7xceIgREjwzyPCd 93JxnFDqGy9i9HVIyRjraFBjIS/Sn5JS8XHdFxp/TFkbJNU8YunmsrTHrHuOdCNd uTWsLZMeWIeZeIyI8GXG =VIlY -----END PGP SIGNATURE----- --=-Wrrj5fBlWNFSKx5nate5--