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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 859C6C433E0 for ; Sun, 2 Aug 2020 19:17:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 638E920759 for ; Sun, 2 Aug 2020 19:17:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="epcmmPpA"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hiGYbBCx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 638E920759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=A6H+vZs3DLdoPZG19CAaorXCd/WBtl/5rKhW0WJguoA=; b=epcmmPpAi6JO1FiKcM6Ljocon 0PpEbmJ6vSwmYHVYnFX5LYGsvxRl+e3ukkCEcrljuaHf5MajtJioaerdXuoZ6selM+8GEg8RsjQ02 4kgw1WA8FOM7L4Z6AFvFpWOs1eMhyT+4xKlK5t8JT7GM9HS+eoz5CIhlHvWDIRHvyXGUV4Kg869Kf /HOfNTSbpDJoZYO8XBl14ZUafcyCMmwraTij2ZmQIVKoO0JA6ghYgmTGiSXi8Vu6Dq/u8hUQhTKmQ wLqeDCmk6FMY0UzOIAEVXe9nxHr88j1oLexV0DQuNLfMfozNvORMojnw106gOP99mfU2IpgOiqjH+ +fo2xhWgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2JSD-0004BW-GZ; Sun, 02 Aug 2020 19:15:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2JSA-0004Am-R5 for linux-arm-kernel@lists.infradead.org; Sun, 02 Aug 2020 19:15:27 +0000 Received: from localhost (router.4pisysteme.de [80.79.225.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A17FD206F6; Sun, 2 Aug 2020 19:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596395726; bh=XV4TUblKrr0Hr8yACYDhNcq4dzFvBlBYUya/0bgDY3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hiGYbBCxgOHie81Y9BqP0nD+nhAU0gexTycJoQIOe9fBkQ9B1OeKPfyYIBZ6wIKZb wPH+gwvZXU6j5Ql7JtG0OgrjYqFMOJp+R1v6YaE2rvN+/KU9dqhjNNRG29naT+w0a3 /7wWik4Y1pmXqbCACeHsgkCX58I8rnIePGo5dIdY= Date: Sun, 2 Aug 2020 21:15:23 +0200 From: Wolfram Sang To: "linux-i2c@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/2] i2c: smbus: add core function handling SMBus host-notify Message-ID: <20200802191523.GA13339@kunai> Mail-Followup-To: Wolfram Sang , "linux-i2c@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Pierre Yves MORDRET , Alexandre TORGUE , "linux-stm32@st-md-mailman.stormreply.com" , Fabrice GASNIER References: <1593776168-17867-1-git-send-email-alain.volmat@st.com> <1593776168-17867-2-git-send-email-alain.volmat@st.com> <20200725202733.GA946@kunai> <20200728121050.GC8715@gnbcxd0016.gnb.st.com> MIME-Version: 1.0 In-Reply-To: <20200728121050.GC8715@gnbcxd0016.gnb.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200802_151527_028018_7639EE83 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice GASNIER , Alexandre TORGUE , Pierre Yves MORDRET , "linux-stm32@st-md-mailman.stormreply.com" Content-Type: multipart/mixed; boundary="===============0111358621545163907==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0111358621545163907== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > I've simplified the index handling as you suggested. The only impact is t= hat > finally we do not consider anymore the I2C_SLAVE_WRITE_REQUESTED event as= the > beginning of the transaction since we don't perform the "reset" of the > handling upon this event. One more comment on this one because I had to update the testunit, too. To be robust against multiple write messages in one transfer, we need to reset both, after STOP and when I2C_SLAVE_WRITE_REQUESTED. See here: 96 case I2C_SLAVE_STOP: 97 if (tu->reg_idx =3D=3D TU_NUM_REGS) 98 queue_delayed_work(system_long_wq, &tu->worker, 99 msecs_to_jiffies(100 * tu->r= egs[TU_REG_DELAY])); 100 fallthrough; 101=20 102 case I2C_SLAVE_WRITE_REQUESTED: 103 tu->reg_idx =3D 0; 104 break; As you see, I used 'fallthrough' to avoid code duplication and that only one reset part will be updated. Dunno if you really need it, too, as I haven't seen your latest code yet. --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl8nEMcACgkQFA3kzBSg KbZqlA//YcdWQrdMtZVkEa0j7XyFwCOfHaTqDGUYviawbW4c0CEa9xBj3EEr+xKa Loo+BQtokIFmEDGxJfCKbhkPRS16I5jf/FWSSRgmARA1FLVaD1PJE32XVr8UcDLv c/LH1xgRG0+xq1DbvCwIxoUiNRtTWuGfec3JiS6uotPdRfiJWbgw9IZJAZXfclm/ h0I9rWzO5jl5UTLZwtcZyqmV0p/os3MvGvlq9wkmLDwlVpvUgltu7inBtKJyREKC w95OaduiRX0ogJftW7VnR+dTryUamMM2SrhMMGyC7fn+6spJrD8N/NCQfGmQFOxm CU8ZxKN/8OtRxlDu1RlMSDhmpHvBLxztWUD6Z1VNgoqoTLUIpuowl2TKPV3uGymh HgjBU8jUddL63dtSgXnxxoLoskut8BbmRLJukLSj2Vto5Qq9W8r6U5R1neMoFhi+ R6RhaNWL+n4+eDSF8j46o2ClUTiW2EW9pe+0QrLYGjZPaHkzkDLhtv+pYyeuRnug fn6PB28S7CHekraTIpY2/7gOFS550TUEik3TPhF/dGvKrNA5tV9/tvIHRycckBiq vvrISspAP57Dpm6Sw2XLQyd/C/39LLwplnWruVmxfDL3gLynoOR54y5UCqftEz9Y zvoUfNjQa4m7EVPOiJBLe71dEakwA3ZvDGOnhzcPyWA4iPNsovY= =ABxQ -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v-- --===============0111358621545163907== 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 --===============0111358621545163907==--