Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/pci/ixgbe Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/9ab6b701fee1
branches: netbsd-8
changeset: 938107:9ab6b701fee1
user: martin <martin%NetBSD.org@localhost>
date: Wed Sep 02 12:24:08 2020 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #1600):
sys/dev/pci/ixgbe/if_bypass.c: revision 1.6
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.28
sys/dev/pci/ixgbe/ixgbe.c: revision 1.246
Fix checking return value of atomic_cas_uint().
This change fixes a bug that extra delay() is called only once even if
atomic_cas_uint() isn't failed or delay() isn't called when atomic_cas_uint()
failed.
The reason of this bug was that I simply converted FreeBSD' atomic_cmpset_int()
to atomic_cas_uint(). The return value's semantics is different.
-
Minor change.
- Print "X550EM X" instead of "X550EM" for Xeon D devices.
- Fix typo in comment. Same as FreeBSD.
diffstat:
sys/dev/pci/ixgbe/if_bypass.c | 18 +++++++++---------
sys/dev/pci/ixgbe/ixgbe.c | 4 ++--
sys/dev/pci/ixgbe/ixgbe_common.c | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diffs (107 lines):
diff -r 7db6261dea3c -r 9ab6b701fee1 sys/dev/pci/ixgbe/if_bypass.c
--- a/sys/dev/pci/ixgbe/if_bypass.c Fri Aug 28 19:45:21 2020 +0000
+++ b/sys/dev/pci/ixgbe/if_bypass.c Wed Sep 02 12:24:08 2020 +0000
@@ -45,9 +45,9 @@
static void
ixgbe_bypass_mutex_enter(struct adapter *adapter)
{
- while (atomic_cas_uint(&adapter->bypass.low, 0, 1) == 0)
+ while (atomic_cas_uint(&adapter->bypass.low, 0, 1) != 0)
usec_delay(3000);
- while (atomic_cas_uint(&adapter->bypass.high, 0, 1) == 0)
+ while (atomic_cas_uint(&adapter->bypass.high, 0, 1) != 0)
usec_delay(3000);
return;
} /* ixgbe_bypass_mutex_enter */
@@ -58,9 +58,9 @@
static void
ixgbe_bypass_mutex_clear(struct adapter *adapter)
{
- while (atomic_cas_uint(&adapter->bypass.high, 1, 0) == 0)
+ while (atomic_cas_uint(&adapter->bypass.high, 1, 0) != 1)
usec_delay(6000);
- while (atomic_cas_uint(&adapter->bypass.low, 1, 0) == 0)
+ while (atomic_cas_uint(&adapter->bypass.low, 1, 0) != 1)
usec_delay(6000);
return;
} /* ixgbe_bypass_mutex_clear */
@@ -73,7 +73,7 @@
static void
ixgbe_bypass_wd_mutex_enter(struct adapter *adapter)
{
- while (atomic_cas_uint(&adapter->bypass.high, 0, 1) == 0)
+ while (atomic_cas_uint(&adapter->bypass.high, 0, 1) != 0)
usec_delay(3000);
return;
} /* ixgbe_bypass_wd_mutex_enter */
@@ -84,7 +84,7 @@
static void
ixgbe_bypass_wd_mutex_clear(struct adapter *adapter)
{
- while (atomic_cas_uint(&adapter->bypass.high, 1, 0) == 0)
+ while (atomic_cas_uint(&adapter->bypass.high, 1, 0) != 1)
usec_delay(6000);
return;
} /* ixgbe_bypass_wd_mutex_clear */
@@ -585,7 +585,7 @@
return (error);
/* Keep the log display single-threaded */
- while (atomic_cas_uint(&adapter->bypass.log, 0, 1) == 0)
+ while (atomic_cas_uint(&adapter->bypass.log, 0, 1) != 0)
usec_delay(3000);
ixgbe_bypass_mutex_enter(adapter);
@@ -713,14 +713,14 @@
status = 0; /* reset */
/* Another log command can now run */
- while (atomic_cas_uint(&adapter->bypass.log, 1, 0) == 0)
+ while (atomic_cas_uint(&adapter->bypass.log, 1, 0) != 1)
usec_delay(3000);
return (error);
unlock_err:
ixgbe_bypass_mutex_clear(adapter);
status = 0; /* reset */
- while (atomic_cas_uint(&adapter->bypass.log, 1, 0) == 0)
+ while (atomic_cas_uint(&adapter->bypass.log, 1, 0) != 1)
usec_delay(3000);
return (EINVAL);
} /* ixgbe_bp_log */
diff -r 7db6261dea3c -r 9ab6b701fee1 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Aug 28 19:45:21 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 02 12:24:08 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.40 2020/08/05 15:58:02 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.41 2020/09/02 12:24:08 martin Exp $ */
/******************************************************************************
@@ -858,7 +858,7 @@
str = "X550";
break;
case ixgbe_mac_X550EM_x:
- str = "X550EM";
+ str = "X550EM X";
break;
case ixgbe_mac_X550EM_a:
str = "X550EM A";
diff -r 7db6261dea3c -r 9ab6b701fee1 sys/dev/pci/ixgbe/ixgbe_common.c
--- a/sys/dev/pci/ixgbe/ixgbe_common.c Fri Aug 28 19:45:21 2020 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_common.c Wed Sep 02 12:24:08 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.13.2.9 2020/08/05 15:58:02 martin Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.13.2.10 2020/09/02 12:24:08 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -5234,7 +5234,7 @@
nvm_ver->oem_valid = FALSE;
hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset);
- /* Return is offset to OEM Product Version block is invalid */
+ /* Return if offset to OEM Product Version block is invalid */
if (offset == 0x0 || offset == NVM_INVALID_PTR)
return;
Home |
Main Index |
Thread Index |
Old Index