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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0EC8C433EF for ; Thu, 16 Jun 2022 12:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PoztT2u03qGjqL8J32Xf52E682RGoeFeRDxjOzVVRv4=; b=Z4kVYfiweDvwPQSpHFNXD/s6PN Ac2247uwTBHIQNtehD0wdE38AwT3wlQdVW9zFoJKZjGn5mJHrp2/JGSFuCERdd4DcY/3tkNKcvitS 4WiY92oP0BmMdMen1MVhtPwwZWmV1MEi7StXsnV1fUxCLfGwSnyrZ5SG/OqAhXHznDukYe0w2iZp6 AB1hDLAj/HWj97jQAyK5AgjuDGc5/GucJNPNgzkOAztl31Na/936v9fa1Y1QpoDGGUiJH7muOLJHk hwJtdQWbYYUwvBrUX09DdKsVGWAKP8ojz56NE8XkytvbGD/FU+DceypdF1O6jV+ldszOkcCrxeqO/ XATYZBaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1odU-002IYW-VV; Thu, 16 Jun 2022 12:30:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1odS-002IY7-3h for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 12:30:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3153B6167F; Thu, 16 Jun 2022 12:30:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC804C34114; Thu, 16 Jun 2022 12:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655382604; bh=7Znl3b92aroi5ubP2QPuFHtUeB1lmREHe3yTZnLMKio=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KMYhbB4MGHuQC7Z7rXOsc2FXhm6jOgJDQRBz44Z8dcYeoscvlfWLHXSfXfOu68EQu BoSKD2hDsNQOQK6jicDyREOSlXJrg6n8CXz79Vc7dXdOtFAU2eRbyR5GbKzsyHxzNi t/Zlz3LGMch7uZaMNxdmHjingGmKLyS9M2YxTemFZBuK4E1zwzbxxiYUWHjcf4liR6 3A2ifUFhYkleDyAuQaW685HxWajaIcJ1Vaie+QK/2f68+TECqshItMI7aXiwRlgZTd gl8Sm2UnRnBdg2Q3S5rUd0xAEC37GnKbcZdZRiFXXiRPepFplJ/duGh0Argx9ybpb5 L3VcbWVU3R6rQ== Date: Thu, 16 Jun 2022 14:29:57 +0200 From: Wolfram Sang To: Quan Nguyen Cc: Corey Minyard , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission , Phong Vo , "Thang Q . Nguyen" Subject: Re: [PATCH v7 3/3] i2c: aspeed: Assert NAK when slave is busy Message-ID: Mail-Followup-To: Wolfram Sang , Quan Nguyen , Corey Minyard , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Brendan Higgins , Benjamin Herrenschmidt , openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission , Phong Vo , "Thang Q . Nguyen" References: <20220422040803.2524940-1-quan@os.amperecomputing.com> <20220422040803.2524940-4-quan@os.amperecomputing.com> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_053006_271204_57DC686B X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6188248567887310630==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6188248567887310630== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XXmZpPF7iOB6E+2/" Content-Disposition: inline --XXmZpPF7iOB6E+2/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Quan, > On the first occurrence of I2C_SLAVE_WRITE_REQUESTED, the address is alre= ady > received with ACK. So if slave return -EBUSY, the NAK will occur on the n= ext > Rx byte (on I2C_SLAVE_WRITE_RECEIVED event). This is exactly why I2C_SLAVE_WRITE_RECEIVED allows for an error code. =46rom the docs: =3D=3D=3D * I2C_SLAVE_WRITE_RECEIVED (mandatory) 'val': bus driver delivers received byte 'ret': 0 if the byte should be acked, some errno if the byte should be na= cked Another I2C master has sent a byte to us which needs to be set in 'val'. If= 'ret' is zero, the bus driver should ack this byte. If 'ret' is an errno, then th= e byte should be nacked. =3D=3D=3D 'ret' is used to ACK/NACK the current byte in 'val'. That's exactly what you need, or? Does the aspeed driver not support acking the current byte? --XXmZpPF7iOB6E+2/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmKrIkEACgkQFA3kzBSg KbasSRAAnlwPKEfQRtRslfq95yxrYXbK6A2BATY1x3Thu50cFfbarxu+e7KMBRtt GXFMJrp6wZaXio1xyqtc34OmNOFnZXpPUN6jClpYG04GMaJ4kZCC9F2gNmiTEE0y RrL7ujffpI6IP4TGFP8SRuxHCJiNRN8KdGdGepah5J6r+y3AnMoaOFwmD9ha/ItQ nhVcPtEPTF/JKbP0st9jr4EIvjLGEi3f+HWuzUwio/MaC/OFRjmzgw9Zwbu0qY1X YoqHBh9SmbNwPcI/Enp54kjyWScxnWhtY3SEOY7bsdguBLGL4MWlsYGQOIeDxlen Io/4k5V4Iw5S7oBAcN7YLin2knRiTgyY/IHGlA4G+UbDhH7VbCRVgJ+EE9HsaEHy iBN/o3YtN6QmmM1DLYrZY3S4JlLFARhNNdCb6Im4+HGMWAP+3t0vBOJEYBH+/0or v1Xv3/bzlHkniG0EtOKfVWLCmSLpFA97p2T98KPBFx5K3NTV42+G9hao529crYtD JtLUDJYXKYxs5CdmX4tvpQzBET+GB/NbyzMiFOUJzkydVuOBOpMMRN80GTdbJTOc 9legjiqnXk797FKiB5zhApNH6UQ8HSmsja5Mr+Jhyi5lr52zZCj0bUJD+rP5Nz2c SlNDdUkpNr6Pxkklt/bLg8R0L/Y75gQ2PWPWjOJSaK6JM3tdArg= =B2+q -----END PGP SIGNATURE----- --XXmZpPF7iOB6E+2/-- --===============6188248567887310630== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6188248567887310630==--