Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: santosh nayak <santoshprasadnayak@gmail.com>
Cc: <jitendra.kalsaria@qlogic.com>, <ron.mercer@qlogic.com>,
	<linux-driver@qlogic.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 1/3] qla3xxx: ethernet: Fix bogus interrupt state flag.
Date: Fri, 2 Mar 2012 15:29:06 +0000	[thread overview]
Message-ID: <1330702146.2611.1.camel@bwh-desktop> (raw)
In-Reply-To: <1330700945-18195-1-git-send-email-santoshprasadnayak@gmail.com>

On Fri, 2012-03-02 at 20:39 +0530, santosh nayak wrote:
> From: Santosh Nayak <santoshprasadnayak@gmail.com>
> 
> In 'ql_adapter_initialize'
> the first call for 'spin_unlock_irqrestore()' is with hw_flags = 0,
> which is as good as 'spin_unlock_irq()' (unconditional interrupt
> enabling). If this is intended, then for better performance
> 'spin_unlock_irqrestore()' can be replaced with 'spin_unlock_irq()'
> and 'spin_lock_irqsave()' can be replaced by 'spin_lock_irq()

Maybe you should make the same change in ql_adapter_up(), which is the
caller that acquires this spinlock (and certainly shouldn't be called in
IRQ context).

Ben.

> Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
> ---
>  drivers/net/ethernet/qlogic/qla3xxx.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
> index d49f6da..8da3e41 100644
> --- a/drivers/net/ethernet/qlogic/qla3xxx.c
> +++ b/drivers/net/ethernet/qlogic/qla3xxx.c
> @@ -3017,7 +3017,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
>  		(void __iomem *)port_regs;
>  	u32 delay = 10;
>  	int status = 0;
> -	unsigned long hw_flags = 0;
>  
>  	if (ql_mii_setup(qdev))
>  		return -1;
> @@ -3228,9 +3227,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
>  		value = ql_read_page0_reg(qdev, &port_regs->portStatus);
>  		if (value & PORT_STATUS_IC)
>  			break;
> -		spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
> +		spin_unlock_irq(&qdev->hw_lock);
>  		msleep(500);
> -		spin_lock_irqsave(&qdev->hw_lock, hw_flags);
> +		spin_lock_irq(&qdev->hw_lock);
>  	} while (--delay);
>  
>  	if (delay == 0) {

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

  reply	other threads:[~2012-03-02 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 15:09 [PATCH 1/3] qla3xxx: ethernet: Fix bogus interrupt state flag santosh nayak
2012-03-02 15:29 ` Ben Hutchings [this message]
2012-03-02 15:54   ` santosh prasad nayak
2012-03-02 21:13     ` David Miller
2012-03-03  9:31       ` santosh prasad nayak
2012-03-02 18:51 ` Jitendra Kalsaria
2012-03-05 21:51 ` David Miller

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=1330702146.2611.1.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=jitendra.kalsaria@qlogic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-driver@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ron.mercer@qlogic.com \
    --cc=santoshprasadnayak@gmail.com \
    /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