Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2582983rdg; Mon, 14 Aug 2023 07:11:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxdEIsi0w3Zjl+JIsnlerJy4U0i+D2CUH0gkqU5vcCH861lzXrQ/kz8bb+gzaD8awQKbny X-Received: by 2002:a05:6402:1514:b0:521:7ab6:b95d with SMTP id f20-20020a056402151400b005217ab6b95dmr7965718edw.29.1692022294543; Mon, 14 Aug 2023 07:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692022294; cv=none; d=google.com; s=arc-20160816; b=yEM/gZZOEmA/t7Tg83+6SOB+qx1o+e4RngVm9T80ewTsfv9W10AyN6Fb8FkGaGe+0O bDuqKY5RMZD8XjCZyw5LwMZepyy2izYc9NUKfYtPBwdtaoIePGy6Z33xCSM+7gTaxM/0 GNgNv77Zd9q+yRCPt1zph4DvJSCU+GabWeWMylvTWQTHQ2hO1PAfiVJiOrMZaUGxnmf+ Vlf89GgHN9CIiONWsF6JUj5ozbFEKXJJU9iDbQAMo+ZMNnB11HRFoihsZ8CSmcA/Y23L mttHz1GJ/PzZizn+xZggSZ3iLU4MB02xowq3nvVMiVW6TR1iik5uHpuQJRXuvFXVAdR5 p3Ww== 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=vL0Rp5Rao9UZ/BTg2YYC/mT9fxEqJ1wE21HPrTYhQ4A=; fh=fhirS8vq9xNZ11DxAo5Dy6OPV+B/Hnus8Ge3Kxe3K3M=; b=kJo9W0QDl1jPxPWzEGL+2gt8THppJPVWIjUpXAYy5cl+ktHNj4iaIlZPO3tefbuOdc djZrrSiW6Dsh+XgwOpDERy+ff+xg2JcUoGfhD5xkK0LLE2y2/A1sn80OIO8D5Vxf16ra M4KELlupCfYhBP92sGb4+VrLOZ+6L1CVNwyOX6oQXwML9NySWRpnKDqiE5wFDT+1sw+P CnIJoGp2IRS8ySwPBWfQqQd54cBA85gNuOH0IlhPi68hOY6Armo/XY8raRc5P2Ko2yjS qZzHtvleONXbY6HrvPyt/+hs35zbPOzK+/d5vBxijQOwQD2paRai9ZG3fJDkv9nfqKS8 +ORQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qWtIvnuA; 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 w19-20020a50fa93000000b00521d2f745adsi7885581edr.425.2023.08.14.07.11.07; Mon, 14 Aug 2023 07:11:34 -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=qWtIvnuA; 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 S231356AbjHNN3q (ORCPT + 99 others); Mon, 14 Aug 2023 09:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231446AbjHNN3h (ORCPT ); Mon, 14 Aug 2023 09:29:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ABEF10D5; Mon, 14 Aug 2023 06:29:36 -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 DD86A63D44; Mon, 14 Aug 2023 13:29:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E34B2C433C8; Mon, 14 Aug 2023 13:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692019775; bh=vL0Rp5Rao9UZ/BTg2YYC/mT9fxEqJ1wE21HPrTYhQ4A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qWtIvnuATKTld70yR47P3L8R/BFnk3ykveU+GR0wQeD/5/Lg9qkooJ3jxArnG0jRh N10Il8qvl2xVztlh+xNYr4QP6M9fzR9mhdsT8FlTsarhFyJeRIG2kBsMm4rDG+bn/X wmvLfnU2KNURxYeRHf0odxBNtEWESisxhv7n+tt8Wwa5N/ow0eidfg+fO2Vp8VTliM R70LVmBumP9gg+ifFLSG1XzpFCFmcQhGV5HVqnGOErm5dFPaYTsB6Q8MQM6ZACPISx HxfiTxP7RjREY9keqoBDVGbNBnKi9TtM+h9gqvJOJWCViUIVi2hnp6FaJnqO7rlkfh PYxUwcdx/pouw== Date: Mon, 14 Aug 2023 15:29:32 +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, Quan Nguyen , stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] i2c: designware: Correct length byte validation logic 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, Quan Nguyen , stable@vger.kernel.org References: <20230726080001.337353-1-tamnguyenchi@os.amperecomputing.com> <20230726080001.337353-2-tamnguyenchi@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Va0SrhCIqzaABToJ" Content-Disposition: inline In-Reply-To: <20230726080001.337353-2-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 --Va0SrhCIqzaABToJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 26, 2023 at 03:00:00PM +0700, Tam Nguyen wrote: > From: Quan Nguyen >=20 > Commit 0daede80f870 ("i2c: designware: Convert driver to using regmap API= ") > changes the logic to validate the whole 32-bit return value of > DW_IC_DATA_CMD register instead of 8-bit LSB without reason. >=20 > Later, commit f53f15ba5a85 ("i2c: designware: Get right data length"), > introduced partial fix but not enough because the "tmp > 0" still test > tmp as 32-bit value and is wrong in case the IC_DATA_CMD[11] is set. >=20 > Revert the logic to just before commit 0daede80f870 > ("i2c: designware: Convert driver to using regmap API"). >=20 > Fixes: f53f15ba5a85 ("i2c: designware: Get right data length") > Fixes: 0daede80f870 ("i2c: designware: Convert driver to using regmap API= ") > Cc: stable@vger.kernel.org > Signed-off-by: Tam Nguyen > Signed-off-by: Quan Nguyen Applied to for-current, thanks! --Va0SrhCIqzaABToJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmTaLDwACgkQFA3kzBSg Kbbh6g//azQ4qtqndnhpbxP1Ujc5PyG55chGeQ7kmcTlXpJaZEJq/rTc7y/HbNGG 6/kIeriOMA2BU4xJKk6ipIK8OiM5Kk8WD6ow7LhICxzi4xg2CAy+ILTiaWnflUtn XGW6GNFx02+iiHwv3Dfek5CJ9NF/Kk4CSw3EV9umFT1GPzbCtGLSfX69BW7Abbod o3vLeUu5y7P56RYotEjUJPIrM961G/pnPh0p29EkJkFmg/6rdy1bS6FSilT8KgyN uLlxqJiSBu1yRJTmPE2wPKlppfNmtCg1VojbDsZaJN9PUxqF/m4+uh6//1spj1O0 2lh5t/YkbdBAT7u7JH2OuaveQIssgaPFRkt9I9ugda1kAvCeEjBAYVL5wyvIm0mi kvHk+2x1HizQfOCRxIWAlEvz3IT1PSjQQ2Daqg1FFSD96jay/6gcFXnkQBXSbVWW oiumMrTwHm8yT1uzfN2Srd9j1/OOAnckxC4VPjoMcEv1sPBb9sohssNdMF1Bgzoi h2L0thsS4lHgP3KzCAczSpmOT4kbW71h4WMQli2wCnU1fTGyhHX/2GjblEefqyrE 8o7hTZedd00qhzeKCGZKE+2UuQL6uqKqGaqcv2HviOIu8g3MYThkam3Kr/WQsSov //P69PLYuat/fBbVrM5r7AdreNgcLcYuc73L2NlPqnJmneNWQew= =cdP5 -----END PGP SIGNATURE----- --Va0SrhCIqzaABToJ--