netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Ott <alan@signal11.us>
To: David Hauweele <david@hauweele.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-zigbee-devel@lists.sourceforge.net
Subject: Re: [PATCH beta 1] 0/3] Fix race conditions in mrf24j40 interrupts
Date: Thu, 23 May 2013 15:33:50 -0400	[thread overview]
Message-ID: <519E6F1E.8000200@signal11.us> (raw)
In-Reply-To: <CAO+c-UVMoctgG2qM2EzOVJwsEY_2TT79J-AuzX-xrPkSUHrQtw@mail.gmail.com>

On 05/23/2013 01:54 PM, David Hauweele wrote:
> 2013/5/23 Alan Ott <alan@signal11.us>:
>> On 5/22/13 4:32 PM, David Hauweele wrote:
>>>
>>> I cannot use level-triggered interrupts with GPIO on the RPi, so I
>>> cannot test this specific patch.
>>
>>
>> Is there another interrupt line you can tie into which does support
>> level-trigger interrupts (INT0 or something)?
> 
> According to the datasheet it should be possible but the bcm2708 port
> does not support it. I've been told that we shouldn't use level-triggered
> interrupts in the first place.


Who is "we," and why shouldn't we use level-triggered interrupts? The
CPU needs to detect whatever type of interrupt the attached hardware
generates.


> 
>>
>>
>>> However I agree with the idea of level-triggered interrupts, that
>>> would fix all major problems related to missed interrupts.
>>>
>>> Beside this I'm running a ping -f since more than two hours now and it
>>> seems to work well.
>>>
>>
>> So that surprises me. I thought level-trigger interrupts were the thing that
>> would fix this problem, and if you're not running with that patch, you just
>> have the INIT_COMPLETION() fix (which you said didn't fix your issue) and
>> the threaded interrupts patch, which I was fairly sure I had determined
>> wasn't fixing any actual race-condition-related problems.
> 
> I should have been more clear about this. I've tested [PATCH 1/3]
> which fixes the race condition with tx_complete. That is the
> INIT_COMPLETION() fix. But it is still possible to miss an interrupt,
> perhaps it just took longer this time. I ran the test again today and
> it failed after 30 minutes.
> 
> I did not test [PATCH 2/3], that is the threaded IRQ. Instead I
> removed interrupt enable/disable from the IRQ handler and the
> workqueue. Without this the driver would fail within seconds of a ping
> -f.


Without what? What do you mean by "without this?" Without the
enable/disable, or without the change that removes the enable/disable?


> Have you observed this too ? Perhaps this problem is specific to
> the bcm2708 port.
> 

What I observe right now is that it seems to work great (ping -f for 6.5
hours) when using the three patches in this patch set on a BeagleBone.

> 
>>
>> I'm glad, but surprised that you're no longer seeing issues.
>>
>> Alan.
>>
>>
>>>
>>> 2013/5/22 Alan Ott <alan@signal11.us>:
>>>>
>>>> On 05/21/2013 10:01 PM, Alan Ott wrote:
>>>>>
>>>>> David Hauweele noticed that the mrf24j40 would hang arbitrarily after
>>>>> some
>>>>> period of heavy traffic.  Two race conditions were discovered, and the
>>>>> driver was changed to use threaded interrupts, since the enable/disable
>>>>> of
>>>>> interrupts in the driver has recently been a lighning rod whenever
>>>>> issues
>>>>> arise related to interrupts (costing engineering time), and since
>>>>> threaded
>>>>> interrupts are the right way to do it.
>>>>>
>>>>> Alan Ott (3):
>>>>>    mrf24j40: Move INIT_COMPLETION() to before packet transmission
>>>>>    mrf24j40: Use threaded IRQ handler
>>>>>    mrf24j40: Use level-triggered interrupts
>>>>>
>>>>>   drivers/net/ieee802154/mrf24j40.c | 31 +++++++++----------------------
>>>>>   1 file changed, 9 insertions(+), 22 deletions(-)
>>>>
>>>>
>>>> I forgot to add, I ran ping -f both ways all afternoon (6.5 hours), and
>>>> it seems solid.
>>>>
>>

      reply	other threads:[~2013-05-23 19:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 15:19 [PATCH 1/2] mrf24j40: Avoid transmission while receiving a frame David Hauweele
2013-05-09 15:19 ` [PATCH 2/2] mrf24j40: Keep the interrupt line enabled David Hauweele
     [not found]   ` <1368112788-25701-2-git-send-email-david-1EggE+PRa6vk1uMJSBkQmQ@public.gmane.org>
2013-05-14  3:55     ` Alan Ott
2013-05-16 21:34       ` [Linux-zigbee-devel] " David Hauweele
2013-05-19 23:04         ` Alan Ott
2013-05-21 16:17           ` David Hauweele
     [not found]             ` <CAO+c-UXymPjYysvh2kM36gcOsL3P51YWq+aYhEqX8oCySwBcaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-21 18:22               ` Alan Ott
2013-05-14  3:22 ` [Linux-zigbee-devel] [PATCH 1/2] mrf24j40: Avoid transmission while receiving a frame Alan Ott
     [not found]   ` <5191ADE4.8040709-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2013-05-16 17:45     ` David Hauweele
     [not found]       ` <CAO+c-UVJQJbmmmCS4hxAEYHKa8gEU1Bs=y+Rv_A75UHeBZxc+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-20  0:05         ` [PATCH testing] mrf24j40: Move INIT_COMPLETION to before the packet is sent Alan Ott
2013-05-22  2:01         ` [PATCH beta 1] 0/3] Fix race conditions in mrf24j40 interrupts Alan Ott
     [not found]           ` <1369188080-8904-1-git-send-email-alan-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2013-05-22  2:01             ` [PATCH beta 1] 1/3] mrf24j40: Move INIT_COMPLETION() to before packet transmission Alan Ott
2013-05-22  2:01             ` [PATCH beta 1] 2/3] mrf24j40: Use threaded IRQ handler Alan Ott
2013-10-06  3:52             ` [PATCH v1 0/3] Fix race conditions in mrf24j40 interrupts Alan Ott
     [not found]               ` <1381031544-2960-1-git-send-email-alan-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2013-10-06  3:52                 ` [PATCH v1 1/3] mrf24j40: Move INIT_COMPLETION() to before packet transmission Alan Ott
2013-10-06  3:52                 ` [PATCH v1 2/3] mrf24j40: Use threaded IRQ handler Alan Ott
2013-10-06  3:52                 ` [PATCH v1 3/3] mrf24j40: Use level-triggered interrupts Alan Ott
2013-10-08 19:32               ` [PATCH v1 0/3] Fix race conditions in mrf24j40 interrupts David Miller
2013-05-22  2:01           ` [PATCH beta 1] 3/3] mrf24j40: Use level-triggered interrupts Alan Ott
2013-05-22  2:03           ` [PATCH beta 1] 0/3] Fix race conditions in mrf24j40 interrupts Alan Ott
2013-05-22 20:32             ` David Hauweele
     [not found]               ` <CAO+c-UV1bZZEE=9=7VVn3f1eLWzCpYCK9eZnnvzNwcPOKKtKLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-23  6:36                 ` Alan Ott
     [not found]                   ` <519DB8E6.4020709-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2013-05-23 17:54                     ` David Hauweele
2013-05-23 19:33                       ` Alan Ott [this message]

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=519E6F1E.8000200@signal11.us \
    --to=alan@signal11.us \
    --cc=david@hauweele.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-zigbee-devel@lists.sourceforge.net \
    --cc=netdev@vger.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).