Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1525330pxb; Wed, 30 Mar 2022 05:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPYgFopGugya0uwtPOcsUvNfcwa27cNtMEJbMEAwizfr8PHBYER+XQOYMTPNSwScLz3T9J X-Received: by 2002:a63:4526:0:b0:380:7c34:fc84 with SMTP id s38-20020a634526000000b003807c34fc84mr6235631pga.2.1648643917942; Wed, 30 Mar 2022 05:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648643917; cv=none; d=google.com; s=arc-20160816; b=DBCEJQ2gC0MZtO7XVNSdesq+VN1G9aKtcAhpf1pbRgrZX7+RZWLoyTl0ZEv9Sk+a0y YX9I6TmBOAET3cwRjjUN5R+f+FVtQWUY05WVzBnSBB1lbOS5AQGZ8liOkEj6ggRBCXs+ Xu/BK6utfRMBSeGWDWzy9uycyq6YP8p6tRTZ4e8A1/gNYlQf0gb2mq6xe3I3QZN4h05C qgujBzdXtvevTif9JFTg9pvovh3NnEDUpQEjzUUCUrrw3Z0VTF5fhvm8ZwOokEWy1B8p REtl1uOPsk1IU9HgiV70KTRWPZnBk60UNJezbTDhyOukMiyWK0BkYPrLshg7WowWuNHP 2Tkg== 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=UoOlXeY1Ag56IXibqNoy7BuG9L00q/bNgrzWY6xdhac=; b=bHsuQ3O979zcHHkGyQSQpbMxmRlzWrsGn8s+wPKPS+StNIzr2q6tFtSiWZO41L1/TF CHMSac3oiTBQ8jRKEJTjT09Di4a8HmW0wDTPQm8nnEL1VF9jno+QRhs6UsFR09iduR6d 0xuJ8u33OgCy3WAZybDLohY2/O3h9akYyaRP6TcLvNT/5Ywc1hHypB+z+WruqgVVF7S5 3h0Nn/XsUlhK3/tylGWkgR5hSziry/4SaQaHuQYbGUsA/wvQDFvJbD8gXF5RqbL0jrl2 yG6y/Vbt0ae8gD5vQaIm2YpbT6fntSTe4QAugJigL5rgXvNRXLrl/ACmuhY8inRK5UT7 3CMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=p2SQXBmq; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 123-20020a630381000000b00381640eeca2si20340177pgd.4.2022.03.30.05.38.24; Wed, 30 Mar 2022 05:38:37 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=p2SQXBmq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245661AbiC3LA1 (ORCPT + 99 others); Wed, 30 Mar 2022 07:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245648AbiC3LAR (ORCPT ); Wed, 30 Mar 2022 07:00:17 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2640213EA2 for ; Wed, 30 Mar 2022 03:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=k1; bh=3qeT2jnWJKE3c4ByGF5uQGcKoZ3I WXAG6HjQjmwsXH8=; b=p2SQXBmqqnEqYZwYoIAMTg5VXha6vhrbD+/4Bfrurus3 KqGTGW3BR00m/rdLPZ+KAbDv+ajUP4N4tB0azLUiTQMJC23MbuDcTaDlYYGDJ6iw Q9NJHlaIRMkujWfRveS4o3KoTSSsk6gMwSshC9LrGhJj7r6XEvn4RRjIVTZu+Kg= Received: (qmail 2161148 invoked from network); 30 Mar 2022 12:58:29 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Mar 2022 12:58:29 +0200 X-UD-Smtp-Session: l3s3148p1@Ay70bG3b0qkgAQnoAFSoAOQGPeMhapNB Date: Wed, 30 Mar 2022 12:58:29 +0200 From: Wolfram Sang To: Eugeniu Rosca Cc: Andrew Gabbasov , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Bhuvanesh Surachari , Eugeniu Rosca Subject: Re: [PATCH v2] i2c: rcar: add SMBus block read support Message-ID: Mail-Followup-To: Wolfram Sang , Eugeniu Rosca , Andrew Gabbasov , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Bhuvanesh Surachari , Eugeniu Rosca References: <20210922160649.28449-1-andrew_gabbasov@mentor.com> <000001d7badd$a8512d30$f8f38790$@mentor.com> <20211006182314.10585-1-andrew_gabbasov@mentor.com> <20220323215229.GA9403@lxhi-065> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SU7q6hDtTecwI3kF" Content-Disposition: inline In-Reply-To: <20220323215229.GA9403@lxhi-065> X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 --SU7q6hDtTecwI3kF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Eugeniu, coming back to this topic, thanks for your patience everyone. > >=20 > > You could wire up two R-Car I2C instances, set up one as an I2C slave > > handled by the I2C testunit and then use the other instance with > > SMBUS_BLOCK_PROC_CALL which also needs RECV_LEN. Check > > Documentation/i2c/slave-testunit-backend.rst for details. >=20 > I am obviously not an SMBus expert, but I wonder if simply testing the > PCA9654 I/O Expander with SMBus support on the H3-Salvator-X target > could be acceptable as a test procedure? See some test results below. As long as the first read value is 8 (or lower than 32), it will work. But it is testing only this one value while my method above is more flexible and allows for arbitrary test patterns. However, your tests already showed that Andrew's patch seems to be not correct. > ############################################################ > #################### ANDREW'S V2 PATCH ##################### > ############################################################ > root@rcar-gen3:# i2cget -y 4 0x68 0 i 8 > 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08 >=20 > root@rcar-gen3:# i2cget -y 4 0x68 0 s > 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08 This is wrong. The first byte is the length byte and should not be seen here. Check the i2c_smbus_read_block_data() implementation in i2c-tools. > ############################################################ > ##################### WOLFRAM'S PATCH ###################### > ############################################################ > root@rcar-gen3:# i2cget -y 4 0x68 0 i 8 > 0x08 0xff 0x06 0xff 0x5f 0xff 0x11 0x08 >=20 > root@rcar-gen3:# i2cget -y 4 0x68 0 s > 0xff 0x06 0xff 0x5f 0xff 0x11 0x08 0x08 This is how it should look like IMO. Happy hacking, Wolfram --SU7q6hDtTecwI3kF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmJEN9EACgkQFA3kzBSg KbaAXBAAlZZLS94v+HMkqaOzIRjX5ubPE5+ENYFHENboY9VHJ+hVy/AmAZX/pwpR P0cq7P2qshtcZf4zfeVxNFc+Lzt3kpwg9UU6tUshtlTGESY1UpWEv6Vf+MZqETSn 4eHdcoRBbfIlbPI551ad71PFB0YMBCe6r2u/rqdOZWrbw8oPbm3xVd+tIEt7c6Fx WZWFXwc4mGAuaMUnkZOB4l+cXTCgGqaARxzykJEtFuVvhHMmkF7Uss64EF33SF2o +u4LNxO/OkTqEIsFxDtacWggJpjm9plcH2GhL6wSC6iDw9hv8X3yCjO5wr8kneol YaeOIteY+QfXTbELEKfdvyrFk6Ig5G4NejYsj7QErRqeCnqE1RgC1EoPZGXGM+gI VDj7RO/65negbrBiKh75agH870jpYRue92qdoX1o39v+R9JrVeUKUmdUvWzEzA14 R1zuCNAm6+qiypFGqX6WE9QC+6wJmFMCD9/Lb9iKXzsjiZcKVQnzJxy79uQArfVg rQQKa44/cXI7lOE8kboVEeH/O3kvFVtiTa2eJ1Q3YerVYbdsZycAKgUHu5792iGg n+4Ke2dl4634zU2HRymLEB2v9UH5Qe1fYVcYCzJ06dap2s5jkoTuzwOZKuNIhmkS eckLadbmZX5sf0clXiXwmbfO+k6X1bdMZBLMn1Fn6UxbrHnOy5E= =PuJK -----END PGP SIGNATURE----- --SU7q6hDtTecwI3kF--