* [PATCHv3 RFC 3/4] sparc64: Avoid irqsave/restore on vio.lock if in_softirq()
@ 2014-10-15 16:43 Sowmini Varadhan
0 siblings, 0 replies; only message in thread
From: Sowmini Varadhan @ 2014-10-15 16:43 UTC (permalink / raw)
To: davem, sowmini.varadhan; +Cc: netdev, sparclinux
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 7ef081a..d731586 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-15 16:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-15 16:43 [PATCHv3 RFC 3/4] sparc64: Avoid irqsave/restore on vio.lock if in_softirq() Sowmini Varadhan
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).