linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ray Jui <ray.jui@broadcom.com>
To: Wolfram Sang <wsa@kernel.org>,
	Dhananjay Phadke <dphadke@linux.microsoft.com>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ray Jui <rjui@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH] i2c: iproc: fix race between client unreg and isr
Date: Fri, 7 Aug 2020 09:40:21 -0700	[thread overview]
Message-ID: <574e1d63-cfe0-8e0b-1b45-f91ee9b3cb84@broadcom.com> (raw)
In-Reply-To: <20200805091725.GI1229@kunai>

Hi Rayagonda/Dhananjay,

On 8/5/2020 2:17 AM, Wolfram Sang wrote:
> On Mon, Jul 27, 2020 at 01:43:40PM -0700, Ray Jui wrote:
>>
>>
>> On 7/27/2020 1:26 PM, Wolfram Sang wrote:
>>> On Mon, Jul 27, 2020 at 08:13:46PM +0200, Wolfram Sang wrote:
>>>>
>>>>> 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?
>>>>
>>>> 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!
>>>
>>
>> Sure. I suggest Dhananjay gives the sequence you proposed here a try
>> (with delay added during the testing to widen the window to cover corner
>> cases). If it works, we can just go with your proposed sequence here.
> 
> Any progress yet?
> 

I don't know if Dhananjay is actively working on this or not.

Rayagonda, given that you have the I2C slave setup already, do you think
you can help to to test and above sequence from Wolfram (by using the
widened delay window as instructed)?

Thanks,

Ray

  reply	other threads:[~2020-08-07 16:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 23:39 [PATCH] i2c: iproc: fix race between client unreg and isr Dhananjay Phadke
2020-07-19  7:59 ` Rayagonda Kokatanur
2020-07-20 17:40   ` Scott Branden
2020-07-20 17:49 ` Ray Jui
2020-07-22 10:41   ` Wolfram Sang
2020-07-22 15:51     ` Ray Jui
2020-07-22 16:55       ` Ray Jui
2020-07-23  0:58       ` Dhananjay Phadke
2020-07-25 10:18       ` Wolfram Sang
2020-07-27  4:32         ` Rayagonda Kokatanur
2020-07-27 15:42         ` Ray Jui
2020-07-27 17:38           ` Dhananjay Phadke
2020-07-27 18:13           ` Wolfram Sang
2020-07-27 20:26             ` Wolfram Sang
2020-07-27 20:43               ` Ray Jui
2020-08-05  9:17                 ` Wolfram Sang
2020-08-07 16:40                   ` Ray Jui [this message]
2020-08-07 17:38                     ` Dhananjay Phadke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574e1d63-cfe0-8e0b-1b45-f91ee9b3cb84@broadcom.com \
    --to=ray.jui@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dphadke@linux.microsoft.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=rjui@broadcom.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).