netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Michel Hautbois <jhautbois@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: richard.cochran@omicron.at, shemminger@vyatta.com, tj@kernel.org,
	randy.dunlap@oracle.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] net: phy: balance disable/enable irq on change
Date: Fri, 24 Dec 2010 09:46:51 +0100	[thread overview]
Message-ID: <AANLkTinVEVcVCH01Hg4QXAV0V-J9UE+9guM1ttorQGLR@mail.gmail.com> (raw)
In-Reply-To: <20101223.112450.246547841.davem@davemloft.net>

2010/12/23 David Miller <davem@davemloft.net>:
> From: Jean-Michel Hautbois <jhautbois@gmail.com>
> Date: Sun, 19 Dec 2010 11:58:48 +0100
>
>> When phy interface changes its status, it calls phy_change() function.
>> This function calls the interrupt disabling functions for the driver
>> registered, but if this driver doesn't implement it, there is no IRQ
>> disabling. After doing the work, we call enable_irq and not the
>> respective driver function. This fixes it, as it could lead to an
>> unbalanced IRQ. Error code changed to EOPNOTSUPP.
>>
>> Signed-off-by: Jean-Michel Hautbois <jhautbois@gmail.com>
>
> This is completely bogus.
>
> First of all, there are 5 call sites for phy_change_interrupt() but
> you've only implemented the new semantics for two of those.
>
> Therefore, if we even wanted this, we should implement the behavior in
> phy_change_interrupt() itself instead of duplicating the logic at
> each and every call site.
>
> But we don't want this.

OK, I understand that point.

> It's not appropriate at all.  If a device lacks a way to turn
> interrupt off and on, using disable_irq() and enable_irq() is not
> necessarily correct.
>
> If the interrupt line is shared, for example, this will break
> everything.
>

OK, well, maybe is there at least one thing we could do : in
phy_change, instead of calling phy_disable_interrupts(), balanced by
enable_irq, we probably should use phy_enable_interrupts().

      reply	other threads:[~2010-12-24  8:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-19 10:58 [PATCH 1/4] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-19 10:58 ` [PATCH 2/4] net: phy: printk issues fixed Jean-Michel Hautbois
2010-12-19 10:58 ` [PATCH 3/4] net: phy: White space correction and switch/case braces Jean-Michel Hautbois
2010-12-19 10:58 ` [PATCH 4/4] net: phy: EXPORT_SYMBOL not following the function Jean-Michel Hautbois
2010-12-23 19:24 ` [PATCH 1/4] net: phy: balance disable/enable irq on change David Miller
2010-12-24  8:46   ` Jean-Michel Hautbois [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=AANLkTinVEVcVCH01Hg4QXAV0V-J9UE+9guM1ttorQGLR@mail.gmail.com \
    --to=jhautbois@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=richard.cochran@omicron.at \
    --cc=shemminger@vyatta.com \
    --cc=tj@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).