From 4109ce576c236d542a08dd84bcb68bf73709d89b Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Fri, 3 Oct 2014 06:36:11 +0000 Subject: dont take the kernel lock on every interrupt in case we might change the link state or to clear OACTIVE, just take it when we know we really are going to do those things. --- sys/dev/pci/if_myx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 4d2cb4c4469..a7e8712108e 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.64 2014/09/14 14:17:25 jsg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.65 2014/10/03 06:36:10 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -1716,15 +1716,18 @@ myx_intr(void *arg) return (1); } - KERNEL_LOCK(); - if (link != 0xffffffff) + if (link != 0xffffffff) { + KERNEL_LOCK(); myx_link_state(sc, link); + KERNEL_UNLOCK(); + } if (ISSET(ifp->if_flags, IFF_OACTIVE)) { + KERNEL_LOCK(); CLR(ifp->if_flags, IFF_OACTIVE); myx_start(ifp); + KERNEL_UNLOCK(); } - KERNEL_UNLOCK(); for (i = 0; i < 2; i++) { if (ISSET(refill, 1 << i)) { -- cgit v1.2.3