netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Andy Fleming <afleming@freescale.com>,
	Jeff Garzik <jgarzik@pobox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes
Date: Thu, 20 Sep 2007 16:53:48 -0700	[thread overview]
Message-ID: <20070920165348.0b25be3d.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64N.0709171750220.17606@blysk.ds.pg.gda.pl>

On Wed, 19 Sep 2007 15:38:19 +0100 (BST)
"Maciej W. Rozycki" <macro@linux-mips.org> wrote:

>  Keep track of disable_irq_nosync() invocations and call enable_irq() the 
> right number of times if work has been cancelled that would include them.
> 
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
> ---
>  Now that the call to flush_work_keventd() (problematic because of 
> rtnl_mutex being held) has been replaced by cancel_work_sync() another 
> issue has arisen and been left unresolved.  As the MDIO bus cannot be 
> accessed from the interrupt context the PHY interrupt handler uses 
> disable_irq_nosync() to prevent from looping and schedules some work to be 
> done as a softirq, which, apart from handling the state change of the 
> originating PHY, is responsible for reenabling the interrupt.  Now if the 
> interrupt line is shared by another device and a call to the softirq 
> handler has been cancelled, that call to enable_irq() never happens and 
> the other device cannot use its interrupt anymore as its stuck disabled.
> 
>  I decided to use a counter rather than a flag because there may be more 
> than one call to phy_change() cancelled in the queue -- a real one and a 
> fake one triggered by free_irq() if DEBUG_SHIRQ is used, if nothing else.  
> Therefore because of its nesting property enable_irq() has to be called 
> the right number of times to match the number disable_irq_nosync() was 
> called and restore the original state.  This DEBUG_SHIRQ feature is also 
> the reason why free_irq() has to be called before cancel_work_sync().
> 
>  While at it I updated the comment about phy_stop_interrupts() being 
> called from `keventd' -- this is no longer relevant as the use of 
> cancel_work_sync() makes such an approach unnecessary.  OTOH a similar 
> comment referring to flush_scheduled_work() in phy_stop() still applies as 
> using cancel_work_sync() there would be dangerous.
> 
>  Checked with checkpatch.pl and at the run time (with and without 
> DEBUG_SHIRQ).

You always put boring, crappy, insufficient text in the for-the-changelog
section and interesting, useful, sufficient text in the not-for-the-changelog
section.

But you can't fool me!  I have an editor and I fix it up.

  reply	other threads:[~2007-09-20 23:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 14:38 [PATCH] PHYLIB: IRQ event workqueue handling fixes Maciej W. Rozycki
2007-09-20 23:53 ` Andrew Morton [this message]
2007-09-21 12:51   ` Maciej W. Rozycki
2007-09-21 18:42     ` Andrew Morton
2007-10-15 12:53 ` Jarek Poplawski
2007-10-15 17:03   ` Maciej W. Rozycki
2007-10-16  6:21     ` Jarek Poplawski
2007-10-16 17:19       ` Maciej W. Rozycki
2007-10-17  8:58         ` Jarek Poplawski
2007-10-17  9:08           ` Benjamin Herrenschmidt
2007-10-17  9:09           ` Jarek Poplawski
2007-10-18  6:31           ` Jarek Poplawski
2007-10-18  7:05             ` [PATCH] flush_work_sync vs. flush_scheduled_work " Jarek Poplawski
2007-10-18 15:48               ` Oleg Nesterov
2007-10-18 15:58                 ` Maciej W. Rozycki
2007-10-19  7:50                 ` Jarek Poplawski
2007-10-19  8:01                   ` Jarek Poplawski
2007-10-22  6:11                   ` Jarek Poplawski
2007-10-22 18:02                     ` Oleg Nesterov
2007-10-23  6:59                       ` Jarek Poplawski
2007-10-23  9:21                       ` Jarek Poplawski
2007-10-19  8:00                 ` Johannes Berg
2007-10-18 11:37             ` Maciej W. Rozycki
2007-10-18 11:30           ` Maciej W. Rozycki
2007-10-18 14:37             ` Jarek Poplawski
2007-10-18 15:31               ` Maciej W. Rozycki
2007-10-19  8:17             ` Jarek Poplawski
2007-10-19 12:57               ` Maciej W. Rozycki
2007-10-19 11:38             ` Maciej W. Rozycki
2007-10-19 14:39               ` Jarek Poplawski
2007-10-19 17:58                 ` Maciej W. Rozycki
2007-10-19 21:46                 ` Benjamin Herrenschmidt

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=20070920165348.0b25be3d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=afleming@freescale.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --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).