From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6EC8C433E0 for ; Tue, 9 Feb 2021 10:45:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B32B64E6F for ; Tue, 9 Feb 2021 10:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231790AbhBIKow (ORCPT ); Tue, 9 Feb 2021 05:44:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:40212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbhBIKlr (ORCPT ); Tue, 9 Feb 2021 05:41:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F331A64E6F; Tue, 9 Feb 2021 10:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612867253; bh=YvkKyU23vYwdJtjO8ln/oqp7oMDgbK2SlLLuxFQCymE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=njJDoRQiZml8JfHAPzXbApAcsPfihX4HU6G6e8MDFp1Be826wWrmhTIB41ANDQeIv 6hMilnT9aZ9Z0rGOmdledoTzJoKNko+G4tXirhl1AFDGttXnkll0kcm28y7vX0/Zze lbZrLMmjSMnHtxB5JdD9aEKkX/mIDNXsOS6gng0r7p1coCHOjeM6G2AN5awyPdXibg kAJ2Dt2qxHoa29Rz54yZxWVwnbMjsQTiIcrt4R5wu28W9K4X3LcIGIPmqvvAgE69fm GBnfWk03seW6vGPS8xnYuwxvrFBVo4RRYZmpkdC9BmamS15o8zoYyCr5sC11nLLQfP xK7m4nhay+BPA== Date: Tue, 9 Feb 2021 11:40:50 +0100 From: Wolfram Sang To: Mark Jonas Cc: Support Opensource , Lee Jones , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Adam.Thomson.Opensource@diasemi.com, stwiss.opensource@diasemi.com, marek.vasut@gmail.com, tingquan.ruan@cn.bosch.com, hubert.streidl@de.bosch.com Subject: Re: [PATCH v4] mfd: da9063: Support SMBus and I2C mode Message-ID: <20210209104050.GB9698@ninjato> References: <20210208152758.13093-1-mark.jonas@de.bosch.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: <20210208152758.13093-1-mark.jonas@de.bosch.com> Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 08, 2021 at 04:27:58PM +0100, Mark Jonas wrote: > From: Hubert Streidl >=20 > By default the PMIC DA9063 2-wire interface is SMBus compliant. This > means the PMIC will automatically reset the interface when the clock > signal ceases for more than the SMBus timeout of 35 ms. >=20 > If the I2C driver / device is not capable of creating atomic I2C > transactions, a context change can cause a ceasing of the clock signal. > This can happen if for example a real-time thread is scheduled. Then > the DA9063 in SMBus mode will reset the 2-wire interface. Subsequently > a write message could end up in the wrong register. This could cause > unpredictable system behavior. >=20 > The DA9063 PMIC also supports an I2C compliant mode for the 2-wire > interface. This mode does not reset the interface when the clock > signal ceases. Thus the problem depicted above does not occur. >=20 > This patch tests for the bus functionality "I2C_FUNC_I2C". It can > reasonably be assumed that the bus cannot obey SMBus timings if > this functionality is set. SMBus commands most probably are emulated > in this case which is prone to the latency issue described above. >=20 > This patch enables the I2C bus mode if I2C_FUNC_I2C is set or > otherwise enables the SMBus mode for a native SMBus controller > which doesn't have I2C_FUNC_I2C set. >=20 > Signed-off-by: Hubert Streidl > Signed-off-by: Mark Jonas =46rom I2C highlevel view, this looks good: Reviewed-by: Wolfram Sang --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmAiZrIACgkQFA3kzBSg KbatLQ//UULY14lvrfB6i/awuvHEqTSMXT/6zrn1xqndERDVy3I6szmAU9VUDPKJ udtnv3Cam1sDZfjTYn1NpeOQ7DoQga9hkoT9j9LsyPLgE0CyA+c1p02unNUlawwQ Wvi7B6+7tTFFk6Pw3EOTqt7qP40sLfmhu1wMsST/geeRKZxJ9QQp5PzC52F4byLj VJLfZF/ZcV3nzKQK/cSMuwtSOu2c5TAEAi95kMO0GpfAzW9crvEuJNQ6tgWGKiey vmW3k1LUyWAuHLzKrWPfXY1hRjCJVaGjSv7rgfbICoMLjWu9LT258zWTna1zZXIR TRz7JrOjfXuiNS7tBuSsAkxGpSECGDq3dzZENxKSQZH24v79V3FnJTl6iiRUPPFj P/7udPaIB0iu8alxy7o9r6U6uqCL9lg98lR0/IsiaGuCEmc0iD593Czzze/FyLHy MjMONDo7VLJEyyuFv5eyW1NFTLz0W2fLmdx5HybrXrEjXD+0OUfbIhw9vWIVNiXE m9yklaPV+AKKDOvZxnoC2XpnCPbWSnsbB45WLeYwFFHX41hz7iQJWkheUWA7wfay pXd1RS0T8HIOh650Jds+oEMTMy3/XGV12Tw6NBxS6257YPzbznHnkVG8M/aAryXi hy5XWIB+rC5/bhfVJ8zA0PCl1epH+7goQVWpGtonD0Cy62DJ5mw= =FlX0 -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR--