Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1309669ybg; Mon, 27 Jul 2020 13:30:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrNmU7wc4aTkCvUYTEWG/NKQ7oTCFqNiJPz8V+80GdXywZE7lF1Gpc4d7Gdp8hcle4YJpO X-Received: by 2002:aa7:c496:: with SMTP id m22mr23331698edq.336.1595881809651; Mon, 27 Jul 2020 13:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595881809; cv=none; d=google.com; s=arc-20160816; b=MTUyK13G/pbBwgnbLAKy4FmYt1twEIfJ/GMa0CHpsAlUGG1Efhdg58Jm5Qq1c/wa3w dRnEosS4kKlw/vwFcNBiLSKnbrg6grWG+fFLKk+5X9CUmuhcr5gShmxr2nyjh5+wFNjY lhMw5kYkaeesbqHgN8e0hJREqzhtJHQXxzo8vzcLY2TxdhMnpky8yFvioZz7C2csj/OF T/RkkXS7IVvgEogP4pOB2Y/FIDEkITxEolXupO4fE1bsV8xixA8RmAOk0NXaPJhuYzqb +3hV2hNmBGApD6lNguVZoJIGU3XlN15F8j7zY02RFc8DH3pzL8Vv/VcNna9jDDICb85h TFbw== 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:dkim-signature; bh=2lEHPV9IQnCJtTZTTYcBQdt0cb7lBDRMjWtgHYj01yo=; b=j3qLgSGWaJHmBbl1a6N0OB7Ak2abmvF6jBl5xp8EUyglzwu+rjTHt8qWktf7AbORX1 sft+tz9aKKgOgufQBBMK9LayfVNO25mkYAOeI5rkkQ+QBZidTZIQDmthFSXnZj6oj6U2 M0BQ+eeUHhRz8QyQzHMH3XmW2kUJpHOZpfkxUNdP6e+zXfQjl06hhMrWBO/WHmTWJnRd CJKL0pQ/+/05z+C672X5y998fQ1KsJ/x9C7xFvkFqKEcvDItUezMLMJOROaQLLM3Zs8l mgeZJXyIRMzIwfYH+mwgqF9Hx0Iy7/qT570vERu98Gi+CqlqiTL+8NHb1Uj/khN9pT20 KpIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HHDXbeTg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si5886305eji.586.2020.07.27.13.29.46; Mon, 27 Jul 2020 13:30:09 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HHDXbeTg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729190AbgG0U1B (ORCPT + 99 others); Mon, 27 Jul 2020 16:27:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:55030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgG0U1A (ORCPT ); Mon, 27 Jul 2020 16:27:00 -0400 Received: from localhost (p5486cd33.dip0.t-ipconnect.de [84.134.205.51]) (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 72D56206E7; Mon, 27 Jul 2020 20:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595881620; bh=pVSPbWxessRIZurIuOzZlz0KujjZbQXyIwrU4wU3nho=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HHDXbeTgUuQKU/1fh2JKFe1u+W+apYXRf3ojvY/mqvZ3x00kNVHI+NkJzWiEld/IU jiyfKVZijeQVkEZ5WJMIv7m34ay9cfqAIcsM9zZlBOlFUTCVzasWbUS0YLgGF7jfnh z8UuGYEkXwxot+xcckTK0VzO/gsGFyfWWiH2x2mM= Date: Mon, 27 Jul 2020 22:26:57 +0200 From: Wolfram Sang To: Ray Jui Cc: Dhananjay Phadke , Rayagonda Kokatanur , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Ray Jui , bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH] i2c: iproc: fix race between client unreg and isr Message-ID: <20200727202657.GA18997@ninjato> References: <1595115599-100054-1-git-send-email-dphadke@linux.microsoft.com> <116ac90c-8b49-ca89-90a4-9a28f43a7c50@broadcom.com> <20200722104128.GK1030@ninjato> <5048cf44-e2c2-ee31-a9fb-b823f16c2c7d@broadcom.com> <20200725101815.GA1519@ninjato> <4cf12c92-889d-ffbf-f8de-c1e08cfb8ce9@broadcom.com> <20200727181346.GA1034@ninjato> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <20200727181346.GA1034@ninjato> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 27, 2020 at 08:13:46PM +0200, Wolfram Sang wrote: >=20 > > Can you confirm that even if we have irq pending at the i2c IP core > > level, as long as we execute Step 2. below (to disable/mask all slave > > interrupts), after 'enable_irq' is called, we still will not receive any > > further i2c slave interrupt? >=20 > This is HW dependant. From my tests with Renesas HW, this is not the > case. But the actual error case was impossible to trigger for me, so > far. I might try again later. But even in the worst case, I would only > get a "spurious interrupt" and not an NULL-ptr OOPS. Let me explain how I verified this: 0) add a debug print whenever the slave irq part is called 1) Put a 2 second delay after disable_irq() and before clearing interrupt enable register 2) unbind the slave driver in the background, triggering the 2s delay 3) during the delay, try to read from the to-be-unbound slave in the foreground 4) ensure there is no prinout from the slave irq Worked fine for me with the Renesas R-Car I2C IP interface. As mentioned before, I couldn't trigger a bad case with my setup. So, I hope this new fix will work for Rayagonda's test case, too! --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl8fOI0ACgkQFA3kzBSg KbZ2mg//ZffoljqCUbULydJcx1FgcZDwTaniwi7AmmFMvl8rSVkihNTlBHi6mt39 Feh+yk6Je7+A/nQm554rrkMHjqc6c7B+LtwzXbBIAIz99U75QPS9bSRhAofitsMX +4ixLRywn2cwqSTtgGIb2J5/M24zM3F0jw1ifdi6xzGajrLKVzOGLemxp2WUCirU hey2hVLyq9j8iTYev7Vg+BKQJhHqUu4/uxM3Z47ymE4+KhMBmc0mAN31SE7hceps 7VBVX7elaIKWn8HfoqDjmmaLnne6A+yqK4ep7Uuh/1uz24jcy15f0XZ0dvN4baOu z1k38J2B9C03eAEsuR15gY1kSbEI1Ce5Mi34Z4b6qhjpI8jj6mdzYrBxgu4euCA8 2yYcG0z2k27jmqFl+7O4te9chDSxpJotYEF0bPLGkzduNMjeBF5PAPzvxsN/ZPaP cAwuOkYwiQTbOpKYYLNREIe0+KzuvVGGhhWcJapxCZhj1Hv73lu+HJiCTzmzDat6 gVi59UWhyycjMFuU6rewotnpJYS8YN6bFJGPfBgCsTl3vl8IJc2YBpw+goikQ1E4 Y05RMGcE5dn/2x7eR9u8owH/lL4JkcQGksj0xJLkQQ1BQg1IkTWCmHAlMHD6GGal qS+yQqAudo3/HPbC4TtFMamCgzNwDtftu95Mf0E3H1QhTc0dLTg= =0k9R -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--