From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: davem@davemloft.net, sowmini.varadhan@oracle.com
Cc: netdev@vger.kernel.org, sparclinux@vger.kernel.org
Subject: [PATCHv5 3/4] sparc64: Avoid irqsave/restore on vio.lock if in_softirq()
Date: Wed, 22 Oct 2014 22:12:45 +0000 [thread overview]
Message-ID: <20141022221245.GE17252@oracle.com> (raw)
For NAPIfied drivers , there is no need to
synchronize by doing irqsave/restore on vio.lock in the I/O
path.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
arch/sparc/kernel/viohs.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/kernel/viohs.c b/arch/sparc/kernel/viohs.c
index 526fcb5..92e2a32 100644
--- a/arch/sparc/kernel/viohs.c
+++ b/arch/sparc/kernel/viohs.c
@@ -747,10 +747,11 @@ EXPORT_SYMBOL(vio_ldc_free);
void vio_port_up(struct vio_driver_state *vio)
{
- unsigned long flags;
+ unsigned long flags = 0;
int err, state;
- spin_lock_irqsave(&vio->lock, flags);
+ if (!in_softirq())
+ spin_lock_irqsave(&vio->lock, flags);
state = ldc_state(vio->lp);
@@ -777,7 +778,8 @@ void vio_port_up(struct vio_driver_state *vio)
mod_timer(&vio->timer, expires);
}
- spin_unlock_irqrestore(&vio->lock, flags);
+ if (!in_softirq())
+ spin_unlock_irqrestore(&vio->lock, flags);
}
EXPORT_SYMBOL(vio_port_up);
--
1.8.4.2
WARNING: multiple messages have this Message-ID (diff)
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: davem@davemloft.net, sowmini.varadhan@oracle.com
Cc: netdev@vger.kernel.org, sparclinux@vger.kernel.org
Subject: [PATCHv5 3/4] sparc64: Avoid irqsave/restore on vio.lock if in_softirq()
Date: Wed, 22 Oct 2014 18:12:45 -0400 [thread overview]
Message-ID: <20141022221245.GE17252@oracle.com> (raw)
For NAPIfied drivers , there is no need to
synchronize by doing irqsave/restore on vio.lock in the I/O
path.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
arch/sparc/kernel/viohs.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/kernel/viohs.c b/arch/sparc/kernel/viohs.c
index 526fcb5..92e2a32 100644
--- a/arch/sparc/kernel/viohs.c
+++ b/arch/sparc/kernel/viohs.c
@@ -747,10 +747,11 @@ EXPORT_SYMBOL(vio_ldc_free);
void vio_port_up(struct vio_driver_state *vio)
{
- unsigned long flags;
+ unsigned long flags = 0;
int err, state;
- spin_lock_irqsave(&vio->lock, flags);
+ if (!in_softirq())
+ spin_lock_irqsave(&vio->lock, flags);
state = ldc_state(vio->lp);
@@ -777,7 +778,8 @@ void vio_port_up(struct vio_driver_state *vio)
mod_timer(&vio->timer, expires);
}
- spin_unlock_irqrestore(&vio->lock, flags);
+ if (!in_softirq())
+ spin_unlock_irqrestore(&vio->lock, flags);
}
EXPORT_SYMBOL(vio_port_up);
--
1.8.4.2
next reply other threads:[~2014-10-22 22:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 22:12 Sowmini Varadhan [this message]
2014-10-22 22:12 ` [PATCHv5 3/4] sparc64: Avoid irqsave/restore on vio.lock if in_softirq() Sowmini Varadhan
2014-10-25 18:28 ` David Miller
2014-10-25 18:28 ` 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=20141022221245.GE17252@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.