public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Jean-Michel Hautbois <jhautbois@gmail.com>
Cc: davem@davemloft.net, 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/2] net: phy: balance disable/enable irq on change
Date: Sat, 18 Dec 2010 16:47:12 +0000	[thread overview]
Message-ID: <1292690832.6533.39.camel@localhost> (raw)
In-Reply-To: <1292687723-31981-1-git-send-email-jhautbois@gmail.com>

On Sat, 2010-12-18 at 16:55 +0100, Jean-Michel Hautbois wrote:
> 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.
> 
> Signed-off-by: Jean-Michel Hautbois <jhautbois@gmail.com>
> ---
>  drivers/net/phy/phy.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 7670aac..b28f2ac 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -89,7 +89,8 @@ static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
>  	phydev->interrupts = interrupts;
>  	if (phydev->drv->config_intr)
>  		err = phydev->drv->config_intr(phydev);
> -
> +	else
> +		err = -ENOSYS;
[...]

ENOSYS means missing system call.  Perhaps EOPNOTSUPP is the appropriate
error code.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  parent reply	other threads:[~2010-12-18 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 15:55 [PATCH 1/2] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-18 15:55 ` [PATCH 2/2] net: phy: Fixed some checkpatch errors Jean-Michel Hautbois
2010-12-18 16:47 ` Ben Hutchings [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-12-18 18:38 [PATCH 1/2] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-18 18:41 Jean-Michel Hautbois

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=1292690832.6533.39.camel@localhost \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=jhautbois@gmail.com \
    --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