Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2108892yba; Mon, 15 Apr 2019 05:14:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNrmH6nrFdCI/1DZfZKt6SA8DpgThAj8iGaA0w8mGGQpVW8Q8c31keJ2+IbO5ebIcBmWP8 X-Received: by 2002:aa7:82d6:: with SMTP id f22mr75126115pfn.190.1555330465296; Mon, 15 Apr 2019 05:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555330465; cv=none; d=google.com; s=arc-20160816; b=GpFKTaRn49++tnFeOf6B/ncun7uAtzK3Kh1Ut4F2QDZR28sJzw+eroGP97S5sflSNF t2Dl+QJJi3I8XSLTtZ5rCcezVxM8hM4OA3pUEuJ+nAQ4KRmVYm7CmOpJUhnKIhqWRSvK vN9YmB/TV1jySX6eZGCpwVtR28OeqsFQTFBa5N5t2sbxk6Nmlx998kSZKtj70Nl7zF15 4YBuCY9vp7lpKevDd2f9u4t8e76ex6lgLxxWdi6uqtJxmVlQUsvTPL9TsGKnaKVWb3ZN LpHSDbWxWEAl3auhxvnW8sBD/GjKcmrm9oUpgWqvkYhSi5kope2DHPv4QOLYtsBqfgDj u+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=s+Duu3VcvGVFWPAPmatzRBrnAPdsKzKA5cC3fEUWvkY=; b=e7Z1NP5f6DsGhoWhS3AEY/sscI2iEyk8N4GOzXI5JwkVS8hqURYtjupvYUUsPgnn3T pn50+h/n1F3tHv9+oaFiXXi63sS+xjljAp6rwWJWy93RM1iLV4T+Gc11zR9N/mXNkJhq /Vbs5mXjoGzhVZp0Ju2C8fVHvR/eq7sddIUGRrBCTn60EJCh837if7/Yq+iMfDI4OTxz KH72rcjxxoK09zWjqtMK5LSzX09iUrvB6O1cYTFofDpSMq0aW+D+URHr1Zv0THJoAVTd aHZLrl9LxQAIl4gu2WeNslBRWM5Acyg8oqH+2vXbtTd8p3ugaOiTdbMThAASs+SXBbSG 2MvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k131si45175619pga.267.2019.04.15.05.14.08; Mon, 15 Apr 2019 05:14:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727432AbfDOMN2 (ORCPT + 99 others); Mon, 15 Apr 2019 08:13:28 -0400 Received: from sauhun.de ([88.99.104.3]:41226 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbfDOMN0 (ORCPT ); Mon, 15 Apr 2019 08:13:26 -0400 Received: from localhost (p54B331F8.dip0.t-ipconnect.de [84.179.49.248]) by pokefinder.org (Postfix) with ESMTPSA id B023D2C0114; Mon, 15 Apr 2019 14:13:23 +0200 (CEST) Date: Mon, 15 Apr 2019 14:13:23 +0200 From: Wolfram Sang To: "Adamski, Krzysztof (Nokia - PL/Wroclaw)" Cc: "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "Sverdlin, Alexander (Nokia - DE/Ulm)" Subject: Re: [PATCH] axxia-i2c: use auto cmd for last message Message-ID: <20190415121323.grku4l66bq5xsk4u@ninjato> References: <20190328111858.GA17086@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7mxb4uywimzggudx" Content-Disposition: inline In-Reply-To: <20190328111858.GA17086@localhost.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7mxb4uywimzggudx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2019 at 11:19:45AM +0000, Adamski, Krzysztof (Nokia - PL/Wr= oclaw) wrote: > Some recent commits to this driver were trying to make sure the TSS > interrupt is not generated on busy system due to 25ms timer expiring > between commands. It can still happen, however if STOP command is not > issued on time at the end of the transmission. If wait_for_completion in > axxia_i2c_xfer_msg() would not return after 25ms of getting an > interrupt, TSS will be generated and idev->err_msg will be set to > -ETIMEDOUT which will be returned from the axxia_i2c_xfer_msg(), even > though the transfer did actually succeed (STOP is automatically issued > when TSS triggers). >=20 > Fortunately, apart from already used manual and sequence commands, the > controller also has so called auto command. It works just like manual > mode but it but an automatic STOP is issued when either transfer length > is met or NAK is received from slave device. >=20 > This patch changes the axxia_i2c_xfer_msg() function so that auto > command is used for last message in transaction letting hardware manage > issuing STOP. TSS is disabled just after command transferring last > message finishes. Auto command, just like sequence, ends with SS > interrupt instead of SNS so handling of both had to be unified. >=20 > The axxia_i2c_stop() is no longer needed as the transfer can only end > with following conditions: > - fully successful - then last message was send by AUTO command and STOP > was issued automatically > - NAK received - STOP is issued automatically by controller > - arbitration lost - STOP should not be issued as we don't control the > bus > - IP interrupt received - this is sent when transfer length is set to 0 > for auto/sequence command. The check for that is done before START is > send so no STOP is required > - TSS received between commands - STOP is issued by the controller >=20 > Signed-off-by: Krzysztof Adamski > Reviewed-by: Alexander Sverdlin Changed $subject to "i2c: axxia:" and applied to for-next, thanks! --7mxb4uywimzggudx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAly0dV8ACgkQFA3kzBSg Kbaxcw/7BbpKmWB8GVSwSy6KqHl4w1Fa4yxtsCJIAKdn2Qx/fLfAbipovVoYOk2G rh4F15GFBo7NoJ3o/p4MEvbBsNYVBbVTgGuI5ggLOKgPFtrir9BiVO2yRMi/9fSX Ms+uWze1Uxocqy+q1YIuDnJmNmkU/H5fy1FOMz6L11QLXJdAxdx+/Yr0yGjUMcQX Ga91sMN8MRU22PgJiTdSeTmTuWBlXl95v/oPfdBuCIpvY/ULUt4zhbMcjzN8DhtQ 4UBRDAz8jD9nIAkKXJENB1SqH99GQbPNk3AhYlxZbQnx6SLES7OVVaPhUXyzhsIs yu2jYtN6h8mqU2xlNFo1xZAy6k1Uq6tSUVKXfr01yMEOMMXzHEVpFuiXoJZJhf1L M1WkyXaZX4xRw9a2/THzSOSAWfQ/XkaAt0Wa04tUYDAr8ZrqOGRf2bFpsoxmzJPR Cz4DgOId2f5MhqflmQ31XOJRM4Na/TYMiPljPXrT72Qye3ngeU/KCFrErssLkmVE iOOPG7kuYhjX68knNpSIfj0LfN/Zgn3qI/3XDMkDrhmESsE9kxDT8+IBEtCKy5Fz U/WIiyodb43TYbVkkXOpH0XyJ+DZUN7gzrfJhc+30EKcUexavr7IOKs995/7hiq0 aZUz+Zo32H58IuptsnwS1W1FpuRlio4bNhrQSZD0koLsmCvMcbg= =FdeM -----END PGP SIGNATURE----- --7mxb4uywimzggudx--