Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2581862rdg; Mon, 14 Aug 2023 07:10:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1FDTsalKcbQNGkXrmkgfOqnmkvgUbvKEpX86mnDtpHKQCVBtGC4mLODYMPDwY2Ic2eleV X-Received: by 2002:a05:6512:b8e:b0:4fe:7dcb:4150 with SMTP id b14-20020a0565120b8e00b004fe7dcb4150mr8274178lfv.67.1692022200001; Mon, 14 Aug 2023 07:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692022199; cv=none; d=google.com; s=arc-20160816; b=S4OUVrecuemscmt4bMrbAlNjmkJ81aia7+K1Feromdl1ChrhmioOzoLf4n1TmsnoVy jhZxUuk/qwTFoXSsYrrChz/DFj5G7dT3Xo7eLQjJxj0Uid9AwPDIXIrmgkJiTjijjMK+ ao1X8npr9Z4m81Z/Rmuzw+k44GWQndcEHJodvslvoQtfCJ2HR6h4EniFclX7sYYA851C /c74BfG9rdRssPdqfyu4dKNDcFusp1019rjjde/UNi1w4RAayPCiA+sA7EaZvJ1g+1Mz /wDofHWzeba3I5105TwraXcExvj4juo3ecpB5xAARjhwsbGCTd5J8pyCFJko+TXOBoJ6 L9yg== 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=KG5qnp6TRmWxZyERaKzUZB+FydnTzOAnNP0HIao7J7E=; fh=mcyqujZei/ZZUmR1y8q0D3Osi5AW+zHC+7z5b7BqYSs=; b=d+rlUOoafRP5g95bfSCV26eyVCpLK6r+AFuKBvgwcg+EocO9X0GzNEZrRUl2oPgv6Q Ra4Gp2RwR4Wd1ZLlF7Mgpe9n+79SMr8zqt8FY38FPGyYSbF6nqlIS47tPLEmiEq1J6wJ QjToNIjGY5ZsHg6HxNib9snlEBv9zaU7EITATqiTcu7TIDMlvzusMCnu6USMvd7mOzNV M4SzP7zAuDrq9XZZAZQHLJrO14mHa09WjiwD9SPgGtsadHvCAIaxDvqfdc+uB9QlpaeJ QIKI3TjKoVPC9zxjjYN2Be9U3RnkIr4o2EoX8Mu0zP44W8v+kqeMDQyZddIqFFzWcXnu D1qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rvpK1SfQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020aa7d7d8000000b00522d8edd982si8154904eds.667.2023.08.14.07.09.35; Mon, 14 Aug 2023 07:09:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rvpK1SfQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbjHNNaa (ORCPT + 99 others); Mon, 14 Aug 2023 09:30:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231371AbjHNN3q (ORCPT ); Mon, 14 Aug 2023 09:29:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9B412D; Mon, 14 Aug 2023 06:29:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7837765299; Mon, 14 Aug 2023 13:29:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 265B8C433C8; Mon, 14 Aug 2023 13:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692019784; bh=KG5qnp6TRmWxZyERaKzUZB+FydnTzOAnNP0HIao7J7E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rvpK1SfQEN6HsOtJK+IXNagXo9jlOgktkOFiGluVUVVDfltnoil9txSusmKtQO/xG pJOCLxQo8ISRhJsaK+DYCxXm1wbmYV1WriIjU7VRv1Bwjtrmtjn2X++OOEBhTy5DQ/ Ko4nM/fw48laL8NyS7sRauxZ+sx1JLqcmXyKNmKqs6y9kNiTsJVduHeT7w+8cPdBt5 Ctyi5vfY8U+TX2ssaC/YBonZ8YWzVtwquW+/5gFUhiBoKE4evm6opFzwAh0WxnHZpP HZxsoraBDi8VYq/fUg5efRsWnAnvIcO0h3EverB7IBEc/oEjpPs837cE9u4ERYopxZ P6Rm5TO6WpnXA== Date: Mon, 14 Aug 2023 15:29:40 +0200 From: Wolfram Sang To: Tam Nguyen Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, patches@amperecomputing.com, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, chuong@os.amperecomputing.com, darren@os.amperecomputing.com, stable@vger.kernel.org Subject: Re: [PATCH v2 2/2] i2c: designware: Handle invalid SMBus block data response length value Message-ID: Mail-Followup-To: Wolfram Sang , Tam Nguyen , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, patches@amperecomputing.com, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, chuong@os.amperecomputing.com, darren@os.amperecomputing.com, stable@vger.kernel.org References: <20230726080001.337353-1-tamnguyenchi@os.amperecomputing.com> <20230726080001.337353-3-tamnguyenchi@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Xx9nXRKiwsLwjCR+" Content-Disposition: inline In-Reply-To: <20230726080001.337353-3-tamnguyenchi@os.amperecomputing.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Xx9nXRKiwsLwjCR+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 26, 2023 at 03:00:01PM +0700, Tam Nguyen wrote: > In the I2C_FUNC_SMBUS_BLOCK_DATA case, the invalid length byte value > (outside of 1-32) of the SMBus block data response from the Slave device > is not correctly handled by the I2C Designware driver. >=20 > In case IC_EMPTYFIFO_HOLD_MASTER_EN=3D=3D1, which cannot be detected > from the registers, the Master can be disabled only if the STOP bit > is set. Without STOP bit set, the Master remains active, holding the bus > until receiving a block data response length. This hangs the bus and > is unrecoverable. >=20 > Avoid this by issuing another dump read to reach the stop condition when > an invalid length byte is received. >=20 > Cc: stable@vger.kernel.org > Signed-off-by: Tam Nguyen Applied to for-current, thanks! --Xx9nXRKiwsLwjCR+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmTaLEQACgkQFA3kzBSg KbaNjQ//cL9hyUlb/YsOw6TZXERSlcClZONDZ/xXroiSw8X7+Eg5ffPzotwQfRs6 woAwI5pT01wQWY2HYHi/Ui8Wywa3HqXAH1ihgkQOMa6mnUg6eURSKM5oz/UEflfP fmO6d/hinXRfCssJWB02Qu+F6rHyogqexmI4igqFFCavQ4NrUkCXYUB5GXeFS3fC WZ9nGJnnUQbYl9p58NHta0hibokRl4NGqVu6sVxt+11E4Ndb85yf4ZxhNAAFl8+6 YzsFexGTfg9yQ0lc3KMTIgD5Uf7Bd6kFPHJ1KctBNbmrbsMUn/acZ8W0h9+ujos9 hLnGxlWDng2wBVV6fTDqw0gORacmzT690FBLlpHjcGqCEf7ArV8FUlm2zotEHVNU 78jkvWcs8wmU/tA12JN4s2hBLbzGMlmppujtt7XwAuxSEZ9zHT/1NCAmBl9h8McY nXB5bvRh2eI3xyxzCqyQL9Ping/5aG+eT/WXZhAcT0orryBS2alBMg9AxkLQgk78 JKivYUIYWXvEhBbBLGEGggA7TljPlOvLbE4ihaFpyo6VPUWD7c4AnYUC1kPpDms2 5PQcRrBjNLJtH4YomMgLisElXn3RrS2vS/QwTRtx1S+UYyYMIXkcsY0mbpx0a6o7 a2emHxym5tAUClTnBNtimKxXsgRYPfcaf8w9+te1vS3tKacB5rE= =5joj -----END PGP SIGNATURE----- --Xx9nXRKiwsLwjCR+--