Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp471496pxk; Thu, 17 Sep 2020 07:54:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrFKN54AbEupwrkv3fFHPnDor6iJP6GYJv9kPwJxE1AigA09vnixchnMr3ZLN2P2CkijAX X-Received: by 2002:a50:e78f:: with SMTP id b15mr33823649edn.104.1600354451293; Thu, 17 Sep 2020 07:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600354451; cv=none; d=google.com; s=arc-20160816; b=Z1Nbj4eM1ANfRwOGcFHa5dAKP4dvE825jvqn56HyE3bIKoPPg6TVzgVWZPYgWtp+Oi PUSG4mDPsJEHpPb7332Gw4tB15+e4M2CKZvaZddKO+/2ajIDb4qShOufR61cjGhMvOC0 7jCxWNi/nV+AkHcEURZ4m8TX7daj+xt34SDEunCIK5xzdX1bP+FZBy+ZBkrVnx//Fgs/ vrx6TGYN5fJLR3aCReuepQLjdkM/5SQzixWwaIfEQw3/vwDaTxNBAIP0IegeRzqicm6J yHscC6SmoqYhPz7XFzezQ2tDYyN3ki5X1l4oQNPVDV9GHTYSHWe/0MICNFsKzCLvFp/+ dh2g== 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:message-id:subject:cc:to:from:date; bh=jmJh0zoyJKFIua4iZRVfExg5WK6EUnCdEL/lbJpTxPg=; b=fVE1kPMx//7qxjJQyIDrOAWDQswz6QjEJBtLvJs5x0QubXJVU4/lBV3JGFVDlVyhl+ bXTcIdvlU7lUzlPK+EbvtplGdcVIb7HLcjw/jNbva+ZROO17TjKvvuzcnO9GkT2pfQB2 WWGQr5Z8dAQUHPmpQwnvg3lo8Jt+GZ1+6EZGHu60Z7HbepIubCSSk9Aun16ZHjjO59eJ iuLL/PX4kTqIRFWhkNTqkl/mzce/otpitApCtvzpXk5lZENOHZ9aB2ny63BNFlqx3C/c qohST0EM6JvE83y1Wd0Nt8vnP7lBumrBoPH45CwCPbEnIsGjW7iEJIs4fnAWFaMigbsF 7Ogg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si119647ejg.119.2020.09.17.07.53.46; Thu, 17 Sep 2020 07:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbgIQOu0 (ORCPT + 99 others); Thu, 17 Sep 2020 10:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727475AbgIQO2O (ORCPT ); Thu, 17 Sep 2020 10:28:14 -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 CC455C061354 for ; Thu, 17 Sep 2020 07:02:43 -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 1kIuUe-0000yr-Dp; Thu, 17 Sep 2020 16:02:36 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kIuUd-0007sB-D8; Thu, 17 Sep 2020 16:02:35 +0200 Date: Thu, 17 Sep 2020 16:02:35 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Christian Eggers Cc: 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 1/3] i2c: imx: Fix reset of I2SR_IAL flag Message-ID: <20200917140235.igfq2hq63f4qqhrr@pengutronix.de> References: <20200917122029.11121-1-ceggers@arri.de> <20200917122029.11121-2-ceggers@arri.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hsjb7ttwvxthj4ux" Content-Disposition: inline In-Reply-To: <20200917122029.11121-2-ceggers@arri.de> 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 --hsjb7ttwvxthj4ux Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Thu, Sep 17, 2020 at 02:20:27PM +0200, Christian Eggers wrote: > 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 with 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 | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index 0ab5381aa012..d8b2e632dd10 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -425,6 +425,7 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2= c_imx, int for_busy, bool a > /* check for arbitration lost */ > if (temp & I2SR_IAL) { > temp &=3D ~I2SR_IAL; > + temp |=3D (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IAL); > imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR); > return -EAGAIN; This looks strange. First the flag is cleared and then it is (in some cases) set again. If I2SR_IIF is set in temp you ack this irq without handling it. (Which might happen if atomic is set and irqs are off?!) I see this idiom is used in a few more places in the driver already, I didn't check but these might have the same problem maybe? Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --hsjb7ttwvxthj4ux Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl9jbHgACgkQwfwUeK3K 7AnqUggAgYDa1nLQExNfvQp94aJ/t79An/B/XcB5UDUqZ72sqiC6zOQnyYIFJui9 a9JZvsTefCEy2BCl88oV1HTpF6BybDDTEFOukk1z7PhDIK9tvfMxbuXZ+ZUdLzOn fC0QHdwgfAzVm+hCTYUNIP6fyNnjsZb8TAVU4IHZnttKdVN7Yz6qAcMYWEWSCFL6 Tj/fheKBHs7/uwzOgjZk7D1IwM1GtjMn7O3jwOMioQs1uum092iiFFjeZX7ma/mE G9wmBXniFtxWoxmWJmzxNE8QKA0ATuWV4GmKzpFzf0BuaypM8RfGHcSlbxvJnn8q XanIVZM4uKj/je+xNideXjFmp7BU3A== =eJd3 -----END PGP SIGNATURE----- --hsjb7ttwvxthj4ux--