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=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 670C1C4363D for ; Tue, 6 Oct 2020 12:46:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CF112075A for ; Tue, 6 Oct 2020 12:46:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbgJFMqQ (ORCPT ); Tue, 6 Oct 2020 08:46:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgJFMqQ (ORCPT ); Tue, 6 Oct 2020 08:46:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F24C061755 for ; Tue, 6 Oct 2020 05:46:16 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPmLz-00015o-Oc; Tue, 06 Oct 2020 14:46:03 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kPmLy-0006tB-GM; Tue, 06 Oct 2020 14:46:02 +0200 Date: Tue, 6 Oct 2020 14:46:02 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: David Laight Cc: 'Christian Eggers' , Oleksij Rempel , Shawn Guo , Sascha Hauer , Fabio Estevam , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , NXP Linux Team , Pengutronix Kernel Team , "linux-arm-kernel@lists.infradead.org" , "linux-i2c@vger.kernel.org" Subject: Re: [PATCH v3 1/3] i2c: imx: Fix reset of I2SR_IAL flag Message-ID: <20201006124602.oxfyzb3atoju7sva@pengutronix.de> References: <20201006060528.drh2yoo2dklyntez@pengutronix.de> <20201006105135.28985-1-ceggers@arri.de> <20201006105135.28985-2-ceggers@arri.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4ptqo3najheuyrhr" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --4ptqo3najheuyrhr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 06, 2020 at 12:06:36PM +0000, David Laight wrote: > From: Christian Eggers > > Sent: 06 October 2020 11:52 > >=20 > > According to the "VFxxx Controller Reference Manual" (and the comment > > block starting at line 97), Vybrid requires writing a one for clearing > > an interrupt flag. Syncing the method for clearing I2SR_IIF in > > i2c_imx_isr(). > >=20 > > Signed-off-by: Christian Eggers > > Cc: stable@vger.kernel.org > > --- > > drivers/i2c/busses/i2c-imx.c | 20 +++++++++++++++----- > > 1 file changed, 15 insertions(+), 5 deletions(-) > >=20 > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > > index 0ab5381aa012..745f4071155a 100644 > > --- a/drivers/i2c/busses/i2c-imx.c > > +++ b/drivers/i2c/busses/i2c-imx.c > > @@ -412,6 +412,19 @@ static void i2c_imx_dma_free(struct imx_i2c_struct= *i2c_imx) > > dma->chan_using =3D NULL; > > } > >=20 > > +static void i2c_imx_clear_irq(struct imx_i2c_struct *i2c_imx, unsigned= int bits) > > +{ > > + unsigned int temp; > > + > > + /* > > + * i2sr_clr_opcode is the value to clear all interrupts. > > + * Here we want to clear only , so we write > > + * ~i2sr_clr_opcode with just toggled. > > + */ > > + temp =3D ~i2c_imx->hwdata->i2sr_clr_opcode ^ bits; > > + imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR); > > +} >=20 > That looks either wrong or maybe just overcomplicated. > Why isn't: > imx_i2c_write_reg(bits, i2c_imx, IMX_I2C_I2SR); > enough? Your question suggests you either didn't read the comment or the comment is not good enough. Maybe once you understood the complication (see Christian's mail) you could suggest a better wording? Maybe we have to mention that this handles both W1C and W0C. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --4ptqo3najheuyrhr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl98ZwcACgkQwfwUeK3K 7AmylQf/RskD0N9+yhyywvgjG322YOktL1246GkcwmvR/dJ+O+lswlwLkHVaIj1K gSStkM2SIsCr4gQazLjqZH3Yw59Tglnm40pABuq2hGeShFc1Q60C3GwAj0LYruOo HLeD0ava0h3rJWrqdms2jxX7g4N3G5Teix1kJj9TuUu+XAtVib43WhO+wuoIq2JM gicKSpRXodc8ZkwejYEoZ2U/gmpG0OjWgB2w3ZTsWuA2GZxVX4WAKeLV8ow5Isup iAhIhLYHXkz2kjGey5lDLL/t6GRw+3TxcUieg1tbU4PPJ1Fndpat54OnmASXh2FQ sXBCkrYImLusaVZt0BRVCMonIgKi2Q== =LC/7 -----END PGP SIGNATURE----- --4ptqo3najheuyrhr-- 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=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 1BC72C4363D for ; Tue, 6 Oct 2020 12:47:38 +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 B41F72075A for ; Tue, 6 Oct 2020 12:47:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Jv+a9LrB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B41F72075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de 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=sC/QX+hFXPRtVwKk7QocNd9K9cElTUVGejNHIZAKENw=; b=Jv+a9LrBwXJUXhQ+RSwZrcOVn i4nq0UCl2w8W2hAwIskLjiYJKGpi2N8h4dpOdm2IlMlHRhodTaWspNtRRg/6ZKqzHLiMaf7bYcp5Y ir4IEwBCnyHoCCXbZkKWVsUlPNwZBjG2RpH+bRUlQBoaYL61H0HE7yAcB9dQYytjkYt8tkawQXvFD /7FUNtgooO7LJW8lN06Rqv1dJikDDxWFylyPxhIP9rA6EEbIfyL5GmZh47U2CuJ15SZABiQQmER3B hrnJdZUZZkkP0Q3mAjQaXdkxxH/Vj9DtYgpjgNd9b3jvX44sQi/OGcl7+lRQMOG+m18zeg/pz+anx nOvQnRJ/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPmMF-0003se-3Z; Tue, 06 Oct 2020 12:46:19 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPmMB-0003rw-Qu for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2020 12:46:16 +0000 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPmLz-00015o-Oc; Tue, 06 Oct 2020 14:46:03 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kPmLy-0006tB-GM; Tue, 06 Oct 2020 14:46:02 +0200 Date: Tue, 6 Oct 2020 14:46:02 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: David Laight Subject: Re: [PATCH v3 1/3] i2c: imx: Fix reset of I2SR_IAL flag Message-ID: <20201006124602.oxfyzb3atoju7sva@pengutronix.de> References: <20201006060528.drh2yoo2dklyntez@pengutronix.de> <20201006105135.28985-1-ceggers@arri.de> <20201006105135.28985-2-ceggers@arri.de> MIME-Version: 1.0 In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_084615_899366_FD0F794B X-CRM114-Status: GOOD ( 25.20 ) 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: Pengutronix Kernel Team , 'Christian Eggers' , Sascha Hauer , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oleksij Rempel , NXP Linux Team , Fabio Estevam , Shawn Guo , "linux-arm-kernel@lists.infradead.org" , "linux-i2c@vger.kernel.org" Content-Type: multipart/mixed; boundary="===============8391459895755262986==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8391459895755262986== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4ptqo3najheuyrhr" Content-Disposition: inline --4ptqo3najheuyrhr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 06, 2020 at 12:06:36PM +0000, David Laight wrote: > From: Christian Eggers > > Sent: 06 October 2020 11:52 > >=20 > > According to the "VFxxx Controller Reference Manual" (and the comment > > block starting at line 97), Vybrid requires writing a one for clearing > > an interrupt flag. Syncing the method for clearing I2SR_IIF in > > i2c_imx_isr(). > >=20 > > Signed-off-by: Christian Eggers > > Cc: stable@vger.kernel.org > > --- > > drivers/i2c/busses/i2c-imx.c | 20 +++++++++++++++----- > > 1 file changed, 15 insertions(+), 5 deletions(-) > >=20 > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > > index 0ab5381aa012..745f4071155a 100644 > > --- a/drivers/i2c/busses/i2c-imx.c > > +++ b/drivers/i2c/busses/i2c-imx.c > > @@ -412,6 +412,19 @@ static void i2c_imx_dma_free(struct imx_i2c_struct= *i2c_imx) > > dma->chan_using =3D NULL; > > } > >=20 > > +static void i2c_imx_clear_irq(struct imx_i2c_struct *i2c_imx, unsigned= int bits) > > +{ > > + unsigned int temp; > > + > > + /* > > + * i2sr_clr_opcode is the value to clear all interrupts. > > + * Here we want to clear only , so we write > > + * ~i2sr_clr_opcode with just toggled. > > + */ > > + temp =3D ~i2c_imx->hwdata->i2sr_clr_opcode ^ bits; > > + imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR); > > +} >=20 > That looks either wrong or maybe just overcomplicated. > Why isn't: > imx_i2c_write_reg(bits, i2c_imx, IMX_I2C_I2SR); > enough? Your question suggests you either didn't read the comment or the comment is not good enough. Maybe once you understood the complication (see Christian's mail) you could suggest a better wording? Maybe we have to mention that this handles both W1C and W0C. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --4ptqo3najheuyrhr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl98ZwcACgkQwfwUeK3K 7AmylQf/RskD0N9+yhyywvgjG322YOktL1246GkcwmvR/dJ+O+lswlwLkHVaIj1K gSStkM2SIsCr4gQazLjqZH3Yw59Tglnm40pABuq2hGeShFc1Q60C3GwAj0LYruOo HLeD0ava0h3rJWrqdms2jxX7g4N3G5Teix1kJj9TuUu+XAtVib43WhO+wuoIq2JM gicKSpRXodc8ZkwejYEoZ2U/gmpG0OjWgB2w3ZTsWuA2GZxVX4WAKeLV8ow5Isup iAhIhLYHXkz2kjGey5lDLL/t6GRw+3TxcUieg1tbU4PPJ1Fndpat54OnmASXh2FQ sXBCkrYImLusaVZt0BRVCMonIgKi2Q== =LC/7 -----END PGP SIGNATURE----- --4ptqo3najheuyrhr-- --===============8391459895755262986== 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 --===============8391459895755262986==--