Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp879128rdb; Tue, 19 Sep 2023 12:58:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJa1930+mMeswQFp8hj1/+uWsyB5Q44puI8Cn3MBK1hdYNVfP9ue6o0GMb5KpVDgHVRKgv X-Received: by 2002:a05:6a20:1444:b0:140:2ec5:2bd3 with SMTP id a4-20020a056a20144400b001402ec52bd3mr4090102pzi.27.1695153537556; Tue, 19 Sep 2023 12:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695153537; cv=none; d=google.com; s=arc-20160816; b=ceq2mxmhfxhuSRfl/imvQP7DhbjCzSsMlijX1ZHpO4HKAZiHTOT5w3ajXoCNiyBFyC taHveuNRrZQNuNc4sEeDR1KdyIuhRNoRM8Yxfc55Pz8DU8rR2m41PbPLqMkekiDnf+/t avujwxCKGKWv0z8Yyjw8ggj94hrfgaQm1ieY8SChpVuK+sKygtFbxKUnN5VetkwW1VD7 Xl4osNVQYSFUfZLqvhkTEJlHnEEwBlYWM62qa6A4Wji7OqIMmz7XeVDO4VRcj0T+9yNK RUXXlQtqBl6glxqyIbt8eA9RebWzxrzMuT6Qo9Tau0Ajo1WZLlpxrcVUam7UrAuvNuqH J61A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=u5J60Ej28pkPmBREqk2gvlRHjHeyOQZbOqVKESDiB38=; fh=aTA4UgLAFSD+rqOBovc+H2pkPYeEezp0pPI9fAxtcjM=; b=Dm+5DHpu9Ry2qds7Pa2VvLY2QDzYjSNiDay539Xq09mHNFzIhj8311LV6JnF5qyNdR V48PlTkUTUIhxDhCTJpkRdH80H5DBhwZR05OmGDUqJsKhWz4Fbvborix7VrHIt97/8yO nwyD2gmljwsQdPMqdqi1cZ3Euiu1p684tS4IBfirqbBFXrkL4+YGHtKohyKqzKQApJzP FxSut8NgnqJ6ANdIILixGmtVQOMI1QuhT0FowO1ITimd5KVsqW9Pp3+xtNneCRzKrpeV QdnIWyY20WZSdquzYOeGdlh/6hbMefhO/xHWpmkgSRGluIE/I8Lxy1bIjgNjPs2+mMOk bHaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nPK4IEa+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b7-20020a656687000000b00578bb009dd1si1317457pgw.809.2023.09.19.12.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 12:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nPK4IEa+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 52CA58273D31; Tue, 19 Sep 2023 12:58:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232959AbjIST6g (ORCPT + 99 others); Tue, 19 Sep 2023 15:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbjIST6f (ORCPT ); Tue, 19 Sep 2023 15:58:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9263AF0; Tue, 19 Sep 2023 12:58:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36ADC433C7; Tue, 19 Sep 2023 19:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695153509; bh=u5J60Ej28pkPmBREqk2gvlRHjHeyOQZbOqVKESDiB38=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nPK4IEa+cHBjYn+8qMhyyX9boPLxquwqbGt5MMT6vE1lF23feceMSYAlIaxgjheBW dkmzu/tDku+jgNs8XUX6Bl+wKUaCy14qoMUPpxbqJ8Vd8Lgbep+zNdo+XUT71MzVJm 9wjM0yAkcrOX5mTV+7XViirdryXol77c0xfYRAYqWS9M0YrnU4DkYmBG0sLtRceNoX ++ymTbFgMv10j434XPxYi1vdTOXl6Og+9MhiIjoHkF+vVHpaaODISwYI02GHkI0Zjp jM4URh/vSoflyeeCSPhuCPPFuQxfKReG5NbFbc7/0WNrq3XULa0kcfhUiKvtm89mYT tqE55FP1h/WEg== Date: Tue, 19 Sep 2023 21:58:26 +0200 From: Wolfram Sang To: Yann Sionneau Cc: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Julian Vetter , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Borne Subject: Re: [PATCH v4] i2c: designware: fix __i2c_dw_disable() in case master is holding SCL low Message-ID: Mail-Followup-To: Wolfram Sang , Yann Sionneau , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Julian Vetter , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Borne References: <20230911140749.32386-1-ysionneau@kalray.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="szkZFZrLxc3RDUOO" Content-Disposition: inline In-Reply-To: <20230911140749.32386-1-ysionneau@kalray.eu> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 12:58:39 -0700 (PDT) --szkZFZrLxc3RDUOO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 11, 2023 at 04:07:49PM +0200, Yann Sionneau wrote: > The DesignWare IP can be synthesized with the IC_EMPTYFIFO_HOLD_MASTER_EN > parameter. > In this case, when the TX FIFO gets empty and the last command didn't have > the STOP bit (IC_DATA_CMD[9]), the controller will hold SCL low until > a new command is pushed into the TX FIFO or the transfer is aborted. >=20 > When the controller is holding SCL low, it cannot be disabled. > The transfer must first be aborted. > Also, the bus recovery won't work because SCL is held low by the master. >=20 > Check if the master is holding SCL low in __i2c_dw_disable() before trying > to disable the controller. If SCL is held low, an abort is initiated. > When the abort is done, then proceed with disabling the controller. >=20 > This whole situation can happen for instance during SMBus read data block > if the slave just responds with "byte count =3D=3D 0". > This puts the driver in an unrecoverable state, because the controller is > holding SCL low and the current __i2c_dw_disable() procedure is not > working. In this situation only a SoC reset can fix the i2c bus. >=20 > Co-developed-by: Jonathan Borne > Signed-off-by: Jonathan Borne > Signed-off-by: Yann Sionneau Applied to for-current, thanks! --szkZFZrLxc3RDUOO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmUJ/WEACgkQFA3kzBSg KbY3DQ/8CVPVpHGcdgEAUE9igmoNvHYnDkPsuowZoT3tvE/iGYd80gU63jiUzL7v nG1XWLhDQPUho+HJHVPNAAbxM/CDZLtEnhTrsyqeZWmI1zsIffb2hDN+wpyHGOCZ am5S8M78n3IilV+83zvX5TVxHvkIYqS8xDebPXQgBfO1bZ/0MkKI3XF3FsObj/Wc RC7UjZsHNrlsnFDK7+xImFzXHXjLnK6BZYzt4urGgE2gffkyUKMfVaydztyZGeeC SCox2f+jBMso3XnYprMamK5QlszvsyUgZ6OZJ0SI6BPJJbfFdlSXkOdgxOQWacBn aYpa/gtUIv0vOFwdV/bIIxUfzEXsUua5OTu1L3jdJjlnhyzQX6a4U/IKWuKrTUqC v8blCTXa7HcCvDrAe8ZNKPIaph+LZii9zPj4c20DWVaXDMQOvBEPr+mK/OLkst0s tS2qdZ0kAljCBkNaYwrAqQXYnf5pF+DlpW7WB+zxLUew11K+mUsKR4Ewe0HcpnQa 0LRG68Hlm0h2YwbLiOMC2wJeweexOKwIMIt7Gxu01u9ZfvRV4gI2LdENZ0q0mNhR yQdu4hboFZRDL5k3TEoy95031+O/3BGB1UWubAKJV82jdJ9aC6SfdeExYiyxqZlo juHJ95PkHUX2zOcMrZzBg7p7l6WOwJ+4xKtlXKRp87uTUycSHSY= =trD0 -----END PGP SIGNATURE----- --szkZFZrLxc3RDUOO--