CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:27:38 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Copy & paste some missing part (flow director, ECC and temp sensor) from
ixgbe_msix_admin() to ixgbe_legacy_irq(). Now it's ready to make a new
function to share the common part. It'll be done in near future.


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.275 src/sys/dev/pci/ixgbe/ixgbe.c:1.276
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.275	Sat Dec 26 06:17:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:27:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.275 2020/12/26 06:17:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.276 2020/12/26 06:27:38 msaitoh Exp $ */
 
 /**
 
@@ -5272,6 +5272,61 @@ ixgbe_legacy_irq(void *arg)
 		}
 	}
 
+	if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
+		if ((adapter->feat_en & IXGBE_FEATURE_FDIR) &&
+		(eicr & IXGBE_EICR_FLOW_DIR)) {
+			if (!atomic_cas_uint(>fdir_reinit, 0, 1)) {
+task_requests |= IXGBE_REQUEST_TASK_FDIR;
+/* Disable the interrupt */
+eims_disable |= IXGBE_EIMS_FLOW_DIR;
+			}
+		}
+
+		if (eicr & IXGBE_EICR_ECC) {
+			device_printf(adapter->dev,
+			"CRITICAL: ECC ERROR!! Please Reboot!!\n");
+			/* Disable interrupt to prevent log spam */
+			eims_disable |= IXGBE_EICR_ECC;
+		}
+
+		/* Check for over temp condition */
+		if (adapter->feat_en & IXGBE_FEATURE_TEMP_SENSOR) {
+			switch (adapter->hw.mac.type) {
+			case ixgbe_mac_X550EM_a:
+if (!(eicr & IXGBE_EICR_GPI_SDP0_X550EM_a))
+	break;
+/* Disable interrupt to prevent log spam */
+eims_disable |= IXGBE_EICR_GPI_SDP0_X550EM_a;
+
+retval = hw->phy.ops.check_overtemp(hw);
+if (retval != IXGBE_ERR_OVERTEMP)
+	break;
+device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
+device_printf(adapter->dev, "System shutdown required!\n");
+break;
+			default:
+if (!(eicr & IXGBE_EICR_TS))
+	break;
+/* Disable interrupt to prevent log spam */
+eims_disable |= IXGBE_EIMS_TS;
+
+retval = hw->phy.ops.check_overtemp(hw);
+if (retval != IXGBE_ERR_OVERTEMP)
+	break;
+device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
+device_printf(adapter->dev, "System shutdown required!\n");
+break;
+			}
+		}
+
+		/* Check for VF message */
+		if ((adapter->feat_en & IXGBE_FEATURE_SRIOV) &&
+		(eicr & IXGBE_EICR_MAILBOX)) {
+			task_requests |= IXGBE_REQUEST_TASK_MBX;
+			eims_disable |= IXGBE_EIMS_MAILBOX;
+		}
+	}
+
 	/* Check for fan failure */
 	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
 		retval = ixgbe_check_fan_failure(adapter, eicr, true);



CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:17:55 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Don't return in the middle of ixgbe_msix_admin() when an flow director reinit
failed. NetBSD currently doesn't support flow director, so this is not a real
bug.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.274 src/sys/dev/pci/ixgbe/ixgbe.c:1.275
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.274	Sat Dec 26 06:10:17 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:17:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.274 2020/12/26 06:10:17 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.275 2020/12/26 06:17:55 msaitoh Exp $ */
 
 /**
 
@@ -3151,12 +3151,11 @@ ixgbe_msix_admin(void *arg)
 	if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
 		if ((adapter->feat_en & IXGBE_FEATURE_FDIR) &&
 		(eicr & IXGBE_EICR_FLOW_DIR)) {
-			/* This is probably overkill :) */
-			if (!atomic_cas_uint(>fdir_reinit, 0, 1))
-return 1;
-			task_requests |= IXGBE_REQUEST_TASK_FDIR;
-			/* Disable the interrupt */
-			eims_disable |= IXGBE_EIMS_FLOW_DIR;
+			if (!atomic_cas_uint(>fdir_reinit, 0, 1)) {
+task_requests |= IXGBE_REQUEST_TASK_FDIR;
+/* Disable the interrupt */
+eims_disable |= IXGBE_EIMS_FLOW_DIR;
+			}
 		}
 
 		if (eicr & IXGBE_EICR_ECC) {



CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:10:17 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h

Log Message:
Disable some interrupt in ixgbe_{legacy_irq,msix_admin}() to prevent log spam.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/ixgbe/ixgbe_type.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.273 src/sys/dev/pci/ixgbe/ixgbe.c:1.274
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.273	Sat Dec 26 06:07:16 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:10:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.273 2020/12/26 06:07:16 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.274 2020/12/26 06:10:17 msaitoh Exp $ */
 
 /**
 
@@ -175,7 +175,7 @@ static void	ixgbe_init_locked(struct ada
 static void	ixgbe_ifstop(struct ifnet *, int);
 static void	ixgbe_stop_locked(void *);
 static void	ixgbe_init_device_features(struct adapter *);
-static void	ixgbe_check_fan_failure(struct adapter *, u32, bool);
+static int	ixgbe_check_fan_failure(struct adapter *, u32, bool);
 static void	ixgbe_add_media_types(struct adapter *);
 static void	ixgbe_media_status(struct ifnet *, struct ifmediareq *);
 static int	ixgbe_media_change(struct ifnet *);
@@ -3162,6 +3162,8 @@ ixgbe_msix_admin(void *arg)
 		if (eicr & IXGBE_EICR_ECC) {
 			device_printf(adapter->dev,
 			"CRITICAL: ECC ERROR!! Please Reboot!!\n");
+			/* Disable interrupt to prevent log spam */
+			eims_disable |= IXGBE_EICR_ECC;
 		}
 
 		/* Check for over temp condition */
@@ -3170,6 +3172,8 @@ ixgbe_msix_admin(void *arg)
 			case ixgbe_mac_X550EM_a:
 if (!(eicr & IXGBE_EICR_GPI_SDP0_X550EM_a))
 	break;
+/* Disable interrupt to prevent log spam */
+eims_disable |= IXGBE_EICR_GPI_SDP0_X550EM_a;
 
 retval = hw->phy.ops.check_overtemp(hw);
 if (retval != IXGBE_ERR_OVERTEMP)
@@ -3180,6 +3184,8 @@ ixgbe_msix_admin(void *arg)
 			default:
 if (!(eicr & IXGBE_EICR_TS))
 	break;
+/* Disable interrupt to prevent log spam */
+eims_disable |= IXGBE_EIMS_TS;
 
 retval = hw->phy.ops.check_overtemp(hw);
 if (retval != IXGBE_ERR_OVERTEMP)
@@ -3200,7 +3206,11 @@ ixgbe_msix_admin(void *arg)
 
 	/* Check for fan failure */
 	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
-		ixgbe_check_fan_failure(adapter, eicr, true);
+		retval = ixgbe_check_fan_failure(adapter, eicr, true);
+		if (retval == IXGBE_ERR_FAN_FAILURE) {
+			/* Disable interrupt to prevent log spam */
+			eims_disable |= IXGBE_EIMS_GPI_SDP1_BY_MAC(hw);
+		}
 	}
 
 	/* External PHY interrupt */
@@ -5185,6 +5195,7 @@ ixgbe_legacy_irq(void *arg)
 	u32		eims_enable = 0;
 	u32		eims_disable = 0;
 	u32		task_requests = 0;
+	s32		retval;
 
 	eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
 	/*
@@ -5264,7 +5275,11 @@ ixgbe_legacy_irq(void *arg)
 
 	/* Check for fan failure */
 	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
-		ixgbe_check_fan_failure(adapter, eicr, true);
+		retval = ixgbe_check_fan_failure(adapter, eicr, true);
+		if (retval == IXGBE_ERR_FAN_FAILURE) {
+			/* Disable interrupt to prevent log spam */
+			eims_disable |= IXGBE_EIMS_GPI_SDP1_BY_MAC(hw);
+		}
 	}
 
 	/* External PHY interrupt */
@@ -6539,7 +6554,7 @@ ixgbe_ioctl(struct ifnet *ifp, u_long co
 /
  * ixgbe_check_fan_failure
  /
-static void
+static int
 ixgbe_check_fan_failure(struct adapter *adapter, u32 reg, bool in_interrupt)
 {
 	u32 mask;
@@ -6547,8 +6562,12 @@ ixgbe_check_fan_failure(struct adapter *
 	mask = (in_interrupt) ? IXGBE_EICR_GPI_SDP1_BY_MAC(>hw) :
 	IXGBE_ESDP_SDP1;
 
-	if (reg & mask)
+	if (reg & mask) {
 		device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n");
+		return IXGBE_ERR_FAN_FAILURE;
+	}
+
+	return IXGBE_SUCCESS;
 } /* ixgbe_check_fan_failure */
 
 /

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.47 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.48
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.47	Sat Dec 26 06:07:16 2020
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Sat Dec 26 06:10:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.47 2020/12/26 06:07:16 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.48 2020/12/26 06:10:17 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -4324,7 +4324,7 @@ struct ixgbe_hw {
 
 #define IXGBE_ERR_NOT_TRUSTED			-50 /* XXX NetBSD */
 #define IXGBE_ERR_NOT_IN_PROMISC		-51 /* XXX NetBSD */
-
+#define 

CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:07:16 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h ixgbe_type.h

Log Message:
Disable/enable the OTHER interrupts correctly.

 The OTHER interrupt was not blocked correctly when MSI-X is used.
ixgbe.c rev. 1.260 added new mutex to avoid the race but it didn't
disable the interrupt itself.

 Calling ixgbe_enable_intr() enables all interrupts, so it's not good to
call it when some interrupt sources should not be enabled (e.g.:
calling ixgbe_enable_intr() in ixgbe_handle_admin() enables queue
interrupt).

 IXGBE_REQUEST_TASK_NEED_ACKINTR doesn't work as expected because
ixgbe_handle_admin() can't know which task is enqueued from the
interrupt context and can't re-enable a specific EIMS bit.

 Solve the above three problems by the following two changes:

  - MSI-X: Disable the OTHER interrupts in the biginning of
ixgbe_msix_admin().

  - Set mask bits correctly at the end of ixgbe_legacy_irq() and
ixgbe_msix_admin() using with eim_orig, eims_enable and eims_disable.

  - Remove IXGBE_REQUEST_TASK_NEED_ACKINTR and add
IXGBE_REQUEST_TASK_{MOD,MSF}_WOI.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ixgbe/ixgbe_type.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.272 src/sys/dev/pci/ixgbe/ixgbe.c:1.273
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.272	Sat Dec 26 06:02:42 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:07:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.272 2020/12/26 06:02:42 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.273 2020/12/26 06:07:16 msaitoh Exp $ */
 
 /**
 
@@ -269,7 +269,7 @@ static int	ixgbe_msix_admin(void *);
 static void	ixgbe_handle_que(void *);
 static void	ixgbe_handle_link(void *);
 static void	ixgbe_handle_msf(void *);
-static void	ixgbe_handle_mod(void *);
+static void	ixgbe_handle_mod(void *, bool);
 static void	ixgbe_handle_phy(void *);
 
 /* Deferred workqueue handlers */
@@ -1566,9 +1566,9 @@ ixgbe_config_link(struct adapter *adapte
 	if (sfp) {
 		if (hw->phy.multispeed_fiber) {
 			ixgbe_enable_tx_laser(hw);
-			task_requests |= IXGBE_REQUEST_TASK_MSF;
+			task_requests |= IXGBE_REQUEST_TASK_MSF_WOI;
 		}
-		task_requests |= IXGBE_REQUEST_TASK_MOD;
+		task_requests |= IXGBE_REQUEST_TASK_MOD_WOI;
 
 		mutex_enter(>admin_mtx);
 		adapter->task_requests |= task_requests;
@@ -3090,17 +3090,24 @@ ixgbe_msix_admin(void *arg)
 	struct adapter	*adapter = arg;
 	struct ixgbe_hw *hw = >hw;
 	u32		eicr, eicr_mask;
+	u32		eims_orig;
+	u32		eims_disable = 0;
 	u32		task_requests = 0;
 	s32		retval;
 
 	++adapter->admin_irqev.ev_count;
 
-	/* First get the cause */
+	eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
+	/* Pause other interrupts */
+	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_MSIX_OTHER_CLEAR_MASK);
+
 	/*
+	 * First get the cause.
+	 *
 	 * The specifications of 82598, 82599, X540 and X550 say EICS register
 	 * is write only. However, Linux says it is a workaround for silicon
-	 * errata to read EICS instead of EICR to get interrupt cause. It seems
-	 * there is a problem about read clear mechanism for EICR register.
+	 * errata to read EICS instead of EICR to get interrupt cause.
+	 * At least, reading EICR clears lower 16bits of EIMS on 82598.
 	 */
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICS);
 	/* Be sure the queue bits are not cleared */
@@ -3110,8 +3117,8 @@ ixgbe_msix_admin(void *arg)
 
 	/* Link status change */
 	if (eicr & IXGBE_EICR_LSC) {
-		IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC);
 		task_requests |= IXGBE_REQUEST_TASK_LSC;
+		eims_disable |= IXGBE_EIMS_LSC;
 	}
 
 	if (ixgbe_is_sfp(hw)) {
@@ -3131,11 +3138,13 @@ ixgbe_msix_admin(void *arg)
 		|| ((hw->phy.sfp_type == ixgbe_sfp_type_not_present)
 			&& (eicr & IXGBE_EICR_LSC))) {
 			task_requests |= IXGBE_REQUEST_TASK_MOD;
+			eims_disable |= IXGBE_EIMS_LSC;
 		}
 
 		if ((hw->mac.type == ixgbe_mac_82599EB) &&
 		(eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) {
 			task_requests |= IXGBE_REQUEST_TASK_MSF;
+			eims_disable |= IXGBE_EIMS_GPI_SDP1_BY_MAC(hw);
 		}
 	}
 
@@ -3145,9 +3154,9 @@ ixgbe_msix_admin(void *arg)
 			/* This is probably overkill :) */
 			if (!atomic_cas_uint(>fdir_reinit, 0, 1))
 return 1;
-			/* Disable the interrupt */
-			IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_FLOW_DIR);
 			task_requests |= IXGBE_REQUEST_TASK_FDIR;
+			/* Disable the interrupt */
+			eims_disable |= IXGBE_EIMS_FLOW_DIR;
 		}
 
 		if (eicr & IXGBE_EICR_ECC) {
@@ -3161,8 +3170,7 @@ ixgbe_msix_admin(void *arg)
 			case ixgbe_mac_X550EM_a:
 if (!(eicr & 

CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:02:42 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Check EICR's queue bit instead of IFF_RUNNING. This change fixes a bug that
it might incorrectly enable interrupt when IFF_RUNNING is not set. It also
changes that the TX/RX is not processed if a queue interrupt isn't occurred.


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.271 src/sys/dev/pci/ixgbe/ixgbe.c:1.272
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.271	Sat Dec 26 06:01:22 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:02:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.271 2020/12/26 06:01:22 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.272 2020/12/26 06:02:42 msaitoh Exp $ */
 
 /**
 
@@ -5154,7 +5154,6 @@ ixgbe_legacy_irq(void *arg)
 	struct ix_queue *que = arg;
 	struct adapter	*adapter = que->adapter;
 	struct ixgbe_hw	*hw = >hw;
-	struct ifnet	*ifp = adapter->ifp;
 	struct		tx_ring *txr = adapter->tx_rings;
 	bool		reenable_intr = true;
 	u32		eicr, eicr_mask;
@@ -5172,14 +5171,16 @@ ixgbe_legacy_irq(void *arg)
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
 	adapter->stats.pf.legint.ev_count++;
-	++que->irqs.ev_count;
 	if (eicr == 0) {
 		adapter->stats.pf.intzero.ev_count++;
 		IXGBE_WRITE_REG(hw, IXGBE_EIMS, eims_orig);
 		return 0;
 	}
 
-	if ((ifp->if_flags & IFF_RUNNING) != 0) {
+	/* Queue (0) intr */
+	if ((eicr & IXGBE_EIMC_RTX_QUEUE) != 0) {
+		++que->irqs.ev_count;
+
 		/*
 		 * The same as ixgbe_msix_que() about
 		 * "que->txrx_use_workqueue".



CVS commit: src/sys/dev/pci/ixgbe

2020-12-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 26 06:01:22 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Don't use "more" flag for simplify in ixgbe_legacy_irq().
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.270 -r1.271 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.270 src/sys/dev/pci/ixgbe/ixgbe.c:1.271
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.270	Thu Dec 24 22:36:43 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat Dec 26 06:01:22 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.270 2020/12/24 22:36:43 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.271 2020/12/26 06:01:22 msaitoh Exp $ */
 
 /**
 
@@ -5156,7 +5156,6 @@ ixgbe_legacy_irq(void *arg)
 	struct ixgbe_hw	*hw = >hw;
 	struct ifnet	*ifp = adapter->ifp;
 	struct		tx_ring *txr = adapter->tx_rings;
-	bool		more = false;
 	bool		reenable_intr = true;
 	u32		eicr, eicr_mask;
 	u32		eims_orig;
@@ -5187,13 +5186,6 @@ ixgbe_legacy_irq(void *arg)
 		 */
 		que->txrx_use_workqueue = adapter->txrx_use_workqueue;
 
-#ifdef __NetBSD__
-		/* Don't run ixgbe_rxeof in interrupt context */
-		more = true;
-#else
-		more = ixgbe_rxeof(que);
-#endif
-
 		IXGBE_TX_LOCK(txr);
 		ixgbe_txeof(txr);
 #ifdef notyet
@@ -5201,6 +5193,10 @@ ixgbe_legacy_irq(void *arg)
 			ixgbe_start_locked(ifp, txr);
 #endif
 		IXGBE_TX_UNLOCK(txr);
+
+		que->req.ev_count++;
+		ixgbe_sched_handle_que(adapter, que);
+		reenable_intr = false;
 	}
 
 	/* Link status change */
@@ -5242,11 +5238,6 @@ ixgbe_legacy_irq(void *arg)
 	(eicr & IXGBE_EICR_GPI_SDP0_X540))
 		task_requests |= IXGBE_REQUEST_TASK_PHY;
 
-	if (more) {
-		que->req.ev_count++;
-		ixgbe_sched_handle_que(adapter, que);
-		reenable_intr = false;
-	}
 	if (task_requests != 0) {
 		/* Re-enabling other interrupts is done in the admin task */
 		task_requests |= IXGBE_REQUEST_TASK_NEED_ACKINTR;



CVS commit: src/usr.bin/make

2020-12-25 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Dec 26 03:54:48 UTC 2020

Modified Files:
src/usr.bin/make: main.c

Log Message:
Use .MAKE.DEPENDFILE as makefiles set it


To generate a diff of this commit:
cvs rdiff -u -r1.502 -r1.503 src/usr.bin/make/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.502 src/usr.bin/make/main.c:1.503
--- src/usr.bin/make/main.c:1.502	Wed Dec 23 14:13:49 2020
+++ src/usr.bin/make/main.c	Sat Dec 26 03:54:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.502 2020/12/23 14:13:49 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.503 2020/12/26 03:54:48 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.502 2020/12/23 14:13:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.503 2020/12/26 03:54:48 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1532,8 +1532,7 @@ main_PrepareMaking(void)
 {
 	/* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */
 	if (!opts.noBuiltins || opts.printVars == PVM_NONE) {
-		/* ignore /dev/null and anything starting with "no" */
-		(void)Var_Subst("${.MAKE.DEPENDFILE:N/dev/null:Nno*:T}",
+		(void)Var_Subst("${.MAKE.DEPENDFILE}",
 		VAR_CMDLINE, VARE_WANTRES, );
 		if (makeDependfile[0] != '\0') {
 			/* TODO: handle errors */



CVS commit: src/sys/arch/aarch64/aarch64

2020-12-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec 26 00:55:26 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S locore.S locore_el2.S

Log Message:
Always issue isb after cpacr_el1 writes since it is a context-changing
operation.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/aarch64/aarch64/cpuswitch.S
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/locore_el2.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.31 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.32
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.31	Thu Oct 22 07:36:02 2020
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Sat Dec 26 00:55:26 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.31 2020/10/22 07:36:02 skrll Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.32 2020/12/26 00:55:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include "opt_ddb.h"
 #include "opt_kasan.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.31 2020/10/22 07:36:02 skrll Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.32 2020/12/26 00:55:26 jmcneill Exp $")
 
 	ARMV8_DEFINE_OPTIONS
 
@@ -86,6 +86,7 @@ ENTRY_NP(cpu_switchto)
 	DISABLE_INTERRUPT
 	mov	sp, x4			/* restore stack pointer */
 	msr	cpacr_el1, x5		/* restore cpacr_el1 */
+	isb
 
 #ifdef ARMV83_PAC
 	/* Switch the PAC key. */
@@ -191,6 +192,7 @@ ENTRY_NP(cpu_switchto_softint)
 
 	mov	x5, #CPACR_FPEN_NONE
 	msr	cpacr_el1, x5		/* cpacr_el1 = CPACR_FPEN_NONE */
+	isb
 
 #ifdef ARMV83_PAC
 	/* Switch the PAC key. */
@@ -223,6 +225,7 @@ ENTRY_NP(cpu_switchto_softint)
 
 	mov	sp, x4			/* restore pinned_lwp sp */
 	msr	cpacr_el1, x5		/* restore pinned_lwp cpacr */
+	isb
 
 #ifdef ARMV83_PAC
 	/* Restore the PAC key. */

Index: src/sys/arch/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.74 src/sys/arch/aarch64/aarch64/locore.S:1.75
--- src/sys/arch/aarch64/aarch64/locore.S:1.74	Thu Oct 22 07:16:06 2020
+++ src/sys/arch/aarch64/aarch64/locore.S	Sat Dec 26 00:55:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.74 2020/10/22 07:16:06 ryo Exp $	*/
+/*	$NetBSD: locore.S,v 1.75 2020/12/26 00:55:26 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -38,7 +38,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.74 2020/10/22 07:16:06 ryo Exp $")
+RCSID("$NetBSD: locore.S,v 1.75 2020/12/26 00:55:26 jmcneill Exp $")
 
 #ifdef AARCH64_DEVICE_MEM_STRONGLY_ORDERED
 #define	MAIR_DEVICE_MEM		MAIR_DEVICE_nGnRnE
@@ -250,6 +250,7 @@ init_sysregs:
 
 	/* No trap system register access, and Trap FP/SIMD access */
 	msr	cpacr_el1, xzr
+	isb
 
 	/* allow to read CNTVCT_EL0 and CNTFRQ_EL0 from EL0 */
 	mrs	x0, cntkctl_el1

Index: src/sys/arch/aarch64/aarch64/locore_el2.S
diff -u src/sys/arch/aarch64/aarch64/locore_el2.S:1.7 src/sys/arch/aarch64/aarch64/locore_el2.S:1.8
--- src/sys/arch/aarch64/aarch64/locore_el2.S:1.7	Tue Sep 15 09:28:20 2020
+++ src/sys/arch/aarch64/aarch64/locore_el2.S	Sat Dec 26 00:55:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_el2.S,v 1.7 2020/09/15 09:28:20 ryo Exp $	*/
+/*	$NetBSD: locore_el2.S,v 1.8 2020/12/26 00:55:26 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012-2014 Andrew Turner
@@ -32,7 +32,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore_el2.S,v 1.7 2020/09/15 09:28:20 ryo Exp $")
+RCSID("$NetBSD: locore_el2.S,v 1.8 2020/12/26 00:55:26 jmcneill Exp $")
 
 /*
  * For use in #include "locore_el2.S".
@@ -85,6 +85,7 @@ in_el2:
 	bic	x2, x2, #CPACR_FPEN
 	orr	x2, x2, #CPACR_FPEN_ALL
 	msr	cpacr_el1, x2
+	isb
 
 	/* Don't trap to EL2 on access to various registers. */
 	mov	x2, #CPTR_RES1



CVS commit: src/sys/arch/hp300/dev

2020-12-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 26 00:16:16 UTC 2020

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c hil_intio.c

Log Message:
Fix a longstanding bug in hilkbd (and dnkbd) console attachment.

cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.
Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.
Should be pulleld up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/dev/dnkbd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp300/dev/hil_intio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.10 src/sys/arch/hp300/dev/dnkbd.c:1.11
--- src/sys/arch/hp300/dev/dnkbd.c:1.10	Sat Apr  8 17:04:56 2017
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Dec 26 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.10 2017/04/08 17:04:56 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.11 2020/12/26 00:16:16 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -69,6 +69,9 @@
 
 #include "opt_wsdisplay_compat.h"
 
+#include "wsdisplay.h"
+#include "wsmouse.h"
+
 #include 
 #include 
 #include 
@@ -87,7 +90,9 @@
 #include 
 #include 
 #include 
-#include "wsmouse.h"
+#if NWSDISPLAY > 0
+#include 
+#endif
 #if NWSMOUSE > 0
 #include 
 #endif
@@ -354,7 +359,8 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 	 * plugged), unless the console keyboard has been claimed already
 	 * (i.e. late hotplug with hil keyboard plugged first).
 	 */
-	if (major(cn_tab->cn_dev) == devsw_name2chr("wsdisplay", NULL, 0)) {
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc == wsdisplay_cnputc) {
 #if NHILKBD > 0
 		if (hil_is_console == -1) {
 			ka.console = 1;
@@ -365,7 +371,10 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 		ka.console = 1;
 #endif
 	} else
+#endif
+	{
 		ka.console = 0;
+	}
 
 	ka.keymap = _keymapdata;
 	ka.accessops = _accessops;

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.3 src/sys/arch/hp300/dev/hil_intio.c:1.4
--- src/sys/arch/hp300/dev/hil_intio.c:1.3	Sat Feb 19 05:36:49 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Sat Dec 26 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.4 2020/12/26 00:16:16 tsutsui Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -28,6 +28,8 @@
  *
  */
 
+#include "wsdisplay.h"
+
 #include 
 #include 
 #include 
@@ -38,6 +40,9 @@
 #include 
 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#endif
 
 #include 
 
@@ -88,8 +93,12 @@ hil_intio_attach(device_t parent, device
 	/*
 	 * Check that the configured console device is a wsdisplay.
 	 */
-	if (major(cn_tab->cn_dev) != devsw_name2chr("wsdisplay", NULL, 0))
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc != wsdisplay_cnputc)
+#endif
+	{
 		hil_is_console = 0;
+	}
 
 	hil_attach(sc, _is_console);
 	intr_establish(hil_intr, sc, ia->ia_ipl, IPL_TTY);



CVS commit: src/sys/dev/wscons

2020-12-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Dec 25 21:12:15 UTC 2020

Modified Files:
src/sys/dev/wscons: wsdisplay.c

Log Message:
Use C99 designated initializers for struct consdev.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/wscons/wsdisplay.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.160 src/sys/dev/wscons/wsdisplay.c:1.161
--- src/sys/dev/wscons/wsdisplay.c:1.160	Fri Dec  6 07:12:39 2019
+++ src/sys/dev/wscons/wsdisplay.c	Fri Dec 25 21:12:15 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.160 2019/12/06 07:12:39 maxv Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.161 2020/12/25 21:12:15 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.160 2019/12/06 07:12:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.161 2020/12/25 21:12:15 tsutsui Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -255,8 +255,11 @@ static int (*wsdisplay_cons_kbd_getc)(de
 static void (*wsdisplay_cons_kbd_pollc)(dev_t, int);
 
 static struct consdev wsdisplay_cons = {
-	NULL, NULL, wsdisplay_getc, wsdisplay_cnputc,
-	wsdisplay_pollc, NULL, NULL, NULL, NODEV, CN_NORMAL
+	.cn_getc = wsdisplay_getc,
+	.cn_putc = wsdisplay_cnputc,
+	.cn_pollc = wsdisplay_pollc,
+	.cn_dev = NODEV,
+	.cn_pri = CN_NORMAL
 };
 
 #ifndef WSDISPLAY_DEFAULTSCREENS



CVS commit: src/sys/dev/ic

2020-12-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Dec 25 20:41:24 UTC 2020

Modified Files:
src/sys/dev/ic: sti.c

Log Message:
Handle WSSCREEN_REVERSE properly.  Based on OpenBSD's sti(4).

Also remove WSSCREEN_UNDERLINE from capabilities that is not handled
by sti(4) ROM routines.

Tested on HP9000/425t with CRX.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/sti.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/sti.c
diff -u src/sys/dev/ic/sti.c:1.23 src/sys/dev/ic/sti.c:1.24
--- src/sys/dev/ic/sti.c:1.23	Wed Dec 23 08:34:35 2020
+++ src/sys/dev/ic/sti.c	Fri Dec 25 20:41:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sti.c,v 1.23 2020/12/23 08:34:35 tsutsui Exp $	*/
+/*	$NetBSD: sti.c,v 1.24 2020/12/25 20:41:24 tsutsui Exp $	*/
 
 /*	$OpenBSD: sti.c,v 1.61 2009/09/05 14:09:35 miod Exp $	*/
 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.23 2020/12/23 08:34:35 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.24 2020/12/25 20:41:24 tsutsui Exp $");
 
 #include "wsdisplay.h"
 
@@ -79,6 +79,18 @@ void sti_copyrows(void *, int, int, int)
 void sti_eraserows(void *, int, int, long);
 int  sti_alloc_attr(void *, int, int, int, long *);
 
+/* pseudo attribute ops for sti ROM putchar function */
+#define WSATTR_FG_SHIFT	24
+#define WSATTR_BG_SHIFT	16
+#define WSATTR_UNPACK_FG(attr)	(((attr) >> WSATTR_FG_SHIFT) & 0xff)
+#define WSATTR_UNPACK_BG(attr)	(((attr) >> WSATTR_BG_SHIFT) & 0xff)
+#define WSATTR_UNPACK_FLAG(attr) ((attr) & WSATTR_USERMASK)
+#define WSATTR_PACK_FG(fg)	((fg) << WSATTR_FG_SHIFT)
+#define WSATTR_PACK_BG(bg)	((bg) << WSATTR_BG_SHIFT)
+#define WSATTR_PACK_FLAG(flag)	((flag))
+#define WSATTR_PACK(fg, bg, flag)	\
+(WSATTR_PACK_FG(fg) | WSATTR_PACK_BG(bg) | WSATTR_PACK_FLAG(flag))
+
 struct wsdisplay_emulops sti_emulops = {
 	.cursor = sti_cursor,
 	.mapchar = sti_mapchar,
@@ -618,7 +630,7 @@ sti_screen_setup(struct sti_screen *scr,
 	scr->scr_wsd.textops = _emulops;
 	scr->scr_wsd.fontwidth = scr->scr_curfont.width;
 	scr->scr_wsd.fontheight = scr->scr_curfont.height;
-	scr->scr_wsd.capabilities = WSSCREEN_REVERSE | WSSCREEN_UNDERLINE;
+	scr->scr_wsd.capabilities = WSSCREEN_REVERSE;
 
 	scr->scr_scrlist[0] = >scr_wsd;
 	scr->scr_screenlist.nscreens = 1;
@@ -1293,6 +1305,10 @@ sti_putchar(void *v, int row, int col, u
 	struct sti_screen *scr = (struct sti_screen *)v;
 	struct sti_rom *rom = scr->scr_rom;
 	struct sti_font *fp = >scr_curfont;
+	int bg, fg;
+
+	fg = WSATTR_UNPACK_FG(attr);
+	bg = WSATTR_UNPACK_BG(attr);
 
 	if (scr->scr_romfont != NULL) {
 		/*
@@ -1307,9 +1323,8 @@ sti_putchar(void *v, int row, int col, u
 		memset(, 0, sizeof(a));
 
 		a.flags.flags = STI_UNPMVF_WAIT;
-		/* XXX does not handle text attributes */
-		a.in.fg_colour = STI_COLOUR_WHITE;
-		a.in.bg_colour = STI_COLOUR_BLACK;
+		a.in.fg_colour = fg;
+		a.in.bg_colour = bg;
 		a.in.x = col * fp->width;
 		a.in.y = row * fp->height;
 		a.in.font_addr = scr->scr_romfont;
@@ -1329,9 +1344,8 @@ sti_putchar(void *v, int row, int col, u
 		memset(, 0, sizeof(a));
 
 		a.flags.flags = STI_BLKMVF_WAIT;
-		/* XXX does not handle text attributes */
-		a.in.fg_colour = STI_COLOUR_WHITE;
-		a.in.bg_colour = STI_COLOUR_BLACK;
+		a.in.fg_colour = fg;
+		a.in.bg_colour = bg;
 
 		a.in.srcx = ((uc - fp->first) / scr->scr_fontmaxcol) *
 		fp->width + scr->scr_fontbase;
@@ -1397,8 +1411,18 @@ sti_alloc_attr(void *v, int fg, int bg, 
 	struct sti_screen *scr = (struct sti_screen *)v;
 #endif
 
-	*pattr = 0;
+	if ((flags & (WSATTR_HILIT | WSATTR_BLINK |
+	WSATTR_UNDERLINE | WSATTR_WSCOLORS)) != 0)
+		return EINVAL;
+	if ((flags & WSATTR_REVERSE) != 0) {
+		fg = STI_COLOUR_BLACK; 
+		bg = STI_COLOUR_WHITE;
+	} else {
+		fg = STI_COLOUR_WHITE;
+		bg = STI_COLOUR_BLACK; 
+	}
 
+	*pattr = WSATTR_PACK(fg, bg, flags);
 	return 0;
 }
 



CVS commit: src/etc/rc.d

2020-12-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec 25 13:42:02 UTC 2020

Modified Files:
src/etc/rc.d: ntpdate

Log Message:
Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/etc/rc.d/ntpdate

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/ntpdate
diff -u src/etc/rc.d/ntpdate:1.20 src/etc/rc.d/ntpdate:1.21
--- src/etc/rc.d/ntpdate:1.20	Mon Aug  3 18:43:48 2009
+++ src/etc/rc.d/ntpdate	Fri Dec 25 13:42:02 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ntpdate,v 1.20 2009/08/03 18:43:48 perry Exp $
+# $NetBSD: ntpdate,v 1.21 2020/12/25 13:42:02 martin Exp $
 #
 
 # PROVIDE: ntpdate
@@ -21,7 +21,7 @@ ntpdate_start()
 		ntpdate_hosts=$(awk '
 			/^#/{ next }
 			/^(server|peer)[ \t]*127.127/	{ next }
-			/^(server|peer)/		{ if ($2 ~ /^-[46]/)
+			/^(server|peer|pool)/		{ if ($2 ~ /^-[46]/)
 			print $3
 			  else
 			print $2 }



CVS commit: src/sys/dev/ic

2020-12-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 25 12:33:03 UTC 2020

Modified Files:
src/sys/dev/ic: mvsata.c siisata.c

Log Message:
Use designated initializers for struct ata_bustype


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.57 src/sys/dev/ic/mvsata.c:1.58
--- src/sys/dev/ic/mvsata.c:1.57	Tue May 19 08:08:51 2020
+++ src/sys/dev/ic/mvsata.c	Fri Dec 25 12:33:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.57 2020/05/19 08:08:51 jdolecek Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.58 2020/12/25 12:33:03 skrll Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.57 2020/05/19 08:08:51 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.58 2020/12/25 12:33:03 skrll Exp $");
 
 #include "opt_mvsata.h"
 
@@ -221,16 +221,16 @@ static void mvsata_print_eprd(struct mvs
 #endif
 
 static const struct ata_bustype mvsata_ata_bustype = {
-	SCSIPI_BUSTYPE_ATA,
-	mvsata_bio,
-	mvsata_reset_drive,
-	mvsata_reset_channel,
-	mvsata_exec_command,
-	ata_get_params,
-	mvsata_addref,
-	mvsata_delref,
-	mvsata_killpending,
-	mvsata_channel_recover,
+	.bustype_type = SCSIPI_BUSTYPE_ATA,
+	.ata_bio = mvsata_bio,
+	.ata_reset_drive = mvsata_reset_drive,
+	.ata_reset_channel = mvsata_reset_channel,
+	.ata_exec_command = mvsata_exec_command,
+	.ata_get_params = ata_get_params,
+	.ata_addref = mvsata_addref,
+	.ata_delref = mvsata_delref,
+	.ata_killpending = mvsata_killpending,
+	.ata_recovery = mvsata_channel_recover,
 };
 
 #if NATAPIBUS > 0

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.43 src/sys/dev/ic/siisata.c:1.44
--- src/sys/dev/ic/siisata.c:1.43	Sat Oct 10 20:27:54 2020
+++ src/sys/dev/ic/siisata.c	Fri Dec 25 12:33:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.43 2020/10/10 20:27:54 thorpej Exp $ */
+/* $NetBSD: siisata.c,v 1.44 2020/12/25 12:33:03 skrll Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.43 2020/10/10 20:27:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.44 2020/12/25 12:33:03 skrll Exp $");
 
 #include 
 #include 
@@ -184,16 +184,16 @@ void siisata_atapi_kill_pending(struct s
 #endif /* NATAPIBUS */
 
 const struct ata_bustype siisata_ata_bustype = {
-	SCSIPI_BUSTYPE_ATA,
-	siisata_ata_bio,
-	siisata_reset_drive,
-	siisata_reset_channel,
-	siisata_exec_command,
-	ata_get_params,
-	siisata_ata_addref,
-	siisata_ata_delref,
-	siisata_killpending,
-	siisata_channel_recover,
+	.bustype_type = SCSIPI_BUSTYPE_ATA,
+	.ata_bio = siisata_ata_bio,
+	.ata_reset_drive = siisata_reset_drive,
+	.ata_reset_channel = siisata_reset_channel,
+	.ata_exec_command = siisata_exec_command,
+	.ata_get_params = ata_get_params,
+	.ata_addref = siisata_ata_addref,
+	.ata_delref = siisata_ata_delref,
+	.ata_killpending = siisata_killpending,
+	.ata_recovery = siisata_channel_recover,
 };
 
 #if NATAPIBUS > 0



CVS commit: src/sys/ufs/ufs

2020-12-25 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Dec 25 10:00:40 UTC 2020

Modified Files:
src/sys/ufs/ufs: ufs_quota1.c

Log Message:
Avoid potentially accessing an array with an index out of range.

Reported-by: syzbot+8832f540234b996bc...@syzkaller.appspotmail.com
Reported-by: syzbot+0b785dd10d987350e...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/ufs/ufs/ufs_quota1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ufs/ufs_quota1.c
diff -u src/sys/ufs/ufs/ufs_quota1.c:1.22 src/sys/ufs/ufs/ufs_quota1.c:1.23
--- src/sys/ufs/ufs/ufs_quota1.c:1.22	Mon Jun 20 00:52:04 2016
+++ src/sys/ufs/ufs/ufs_quota1.c	Fri Dec 25 10:00:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_quota1.c,v 1.22 2016/06/20 00:52:04 dholland Exp $	*/
+/*	$NetBSD: ufs_quota1.c,v 1.23 2020/12/25 10:00:40 nia Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.22 2016/06/20 00:52:04 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.23 2020/12/25 10:00:40 nia Exp $");
 
 #include 
 #include 
@@ -311,6 +311,9 @@ quota1_handle_cmd_quotaon(struct lwp *l,
 	struct pathbuf *pb;
 	struct nameidata nd;
 
+	if (type < 0 || type >= MAXQUOTAS)
+		return EINVAL;
+
 	if (ump->um_flags & UFS_QUOTA2) {
 		uprintf("%s: quotas v2 already enabled\n",
 		mp->mnt_stat.f_mntonname);
@@ -421,6 +424,9 @@ quota1_handle_cmd_quotaoff(struct lwp *l
 	kauth_cred_t cred;
 	int i, error;
 
+	if (type < 0 || type >= MAXQUOTAS)
+		return EINVAL;
+
 	mutex_enter();
 	while ((ump->umq1_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0)
 		cv_wait(, );



CVS commit: src/sys/miscfs/specfs

2020-12-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Dec 25 09:28:56 UTC 2020

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
When reading from a block device, queue parallel block requests to
fill a buffer with breadn.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/miscfs/specfs/spec_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.180 src/sys/miscfs/specfs/spec_vnops.c:1.181
--- src/sys/miscfs/specfs/spec_vnops.c:1.180	Sat Jun 27 17:29:19 2020
+++ src/sys/miscfs/specfs/spec_vnops.c	Fri Dec 25 09:28:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.180 2020/06/27 17:29:19 christos Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.181 2020/12/25 09:28:56 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.180 2020/06/27 17:29:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.181 2020/12/25 09:28:56 mlelstv Exp $");
 
 #include 
 #include 
@@ -695,6 +695,10 @@ spec_read(void *v)
 	struct partinfo pi;
 	int n, on;
 	int error = 0;
+	int i, nra;
+	daddr_t lastbn, *rablks;
+	int *rasizes;
+	int nrablks, ratogo;
 
 	KASSERT(uio->uio_rw == UIO_READ);
 	KASSERTMSG(VMSPACE_IS_KERNEL_P(uio->uio_vmspace) ||
@@ -723,18 +727,45 @@ spec_read(void *v)
 			bsize = BLKDEV_IOSIZE;
 
 		bscale = bsize >> DEV_BSHIFT;
+
+		nra = uimax(16 * MAXPHYS / bsize - 1, 511);
+		rablks = kmem_alloc(nra * sizeof(*rablks), KM_SLEEP);
+		rasizes = kmem_alloc(nra * sizeof(*rasizes), KM_SLEEP);
+		lastbn = ((uio->uio_offset + uio->uio_resid - 1) >> DEV_BSHIFT)
+		&~ (bscale - 1);
+		nrablks = ratogo = 0;
 		do {
 			bn = (uio->uio_offset >> DEV_BSHIFT) &~ (bscale - 1);
 			on = uio->uio_offset % bsize;
 			n = uimin((unsigned)(bsize - on), uio->uio_resid);
-			error = bread(vp, bn, bsize, 0, );
-			if (error) {
-return (error);
+
+			if (ratogo == 0) {
+nrablks = uimin((lastbn - bn) / bscale, nra);
+ratogo = nrablks;
+
+for (i = 0; i < nrablks; ++i) {
+	rablks[i] = bn + (i+1) * bscale;
+	rasizes[i] = bsize;
+}
+
+error = breadn(vp, bn, bsize,
+	   rablks, rasizes, nrablks,
+	   0, );
+			} else {
+if (ratogo > 0)
+	--ratogo;
+error = bread(vp, bn, bsize, 0, );
 			}
+			if (error)
+break;
 			n = uimin(n, bsize - bp->b_resid);
 			error = uiomove((char *)bp->b_data + on, n, uio);
 			brelse(bp, 0);
 		} while (error == 0 && uio->uio_resid > 0 && n != 0);
+
+		kmem_free(rablks, nra * sizeof(*rablks));
+		kmem_free(rasizes, nra * sizeof(*rasizes));
+
 		return (error);
 
 	default:



CVS commit: src/usr.bin/calendar/calendars

2020-12-25 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 25 09:02:41 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.judaic

Log Message:
Update to 2021, hopefully less errors made in this year.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/calendar/calendars/calendar.judaic

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.judaic
diff -u src/usr.bin/calendar/calendars/calendar.judaic:1.9 src/usr.bin/calendar/calendars/calendar.judaic:1.10
--- src/usr.bin/calendar/calendars/calendar.judaic:1.9	Fri Dec 20 22:58:53 2019
+++ src/usr.bin/calendar/calendars/calendar.judaic	Fri Dec 25 09:02:41 2020
@@ -1,29 +1,29 @@
-01/21*  Tu B'Shvat (Feast of Trees)
-03/09*	Fast of Esther (Battle of Purim; 1 day before Purim; fast day)
-03/10*	Purim (Feast of Lots; 30 days before Pesach)
-04/09*	Pesach (First Day of Passover; sabbatical)
-04/10*	Pesach (sabbatical)
-04/11*	Pesach (sabbatical)
-04/16*	Pesach (Last Day of Passover; 8th day of Pesach; sabbatical)
-04/17*	Mimouna (Morrocan Jewish Celebration of End of Pesach)
-04/09*	Yom HaAtzma'ut (Israel Independence Day)
-05/12*	Lag B'Omer (Commemoration of the Great Rebellion)
-05/22*	Yom Yerushalayim (Reunification of Jerusalem)
-05/29*	Shavuot (Festival of Weeks; 50 days after Pesach; sabbatical)
-07/09*	Fast of Shiv'a Asar B'Tammuz (Tzom Tammuz) (Romans breach Wall of Jerusalem;
+01/28*  Tu B'Shvat (Feast of Trees)
+02/25*	Fast of Esther (Battle of Purim; 1 day before Purim; fast day)
+02/26*	Purim (Feast of Lots; 30 days before Pesach)
+03/29*	Pesach (First Day of Passover; sabbatical)
+03/30*	Pesach (sabbatical)
+03/31*	Pesach (sabbatical)
+04/04*	Pesach (Last Day of Passover; 8th day of Pesach; sabbatical)
+04/05*	Mimouna (Morrocan Jewish Celebration of End of Pesach)
+04/15*	Yom HaAtzma'ut (Israel Independence Day)
+04/30*	Lag B'Omer (Commemoration of the Great Rebellion)
+05/10*	Yom Yerushalayim (Reunification of Jerusalem)
+05/17*	Shavuot (Festival of Weeks; 50 days after Pesach; sabbatical)
+06/27*	Fast of Shiv'a Asar B'Tammuz (Tzom Tammuz) (Romans breach Wall of Jerusalem;
 	fast day)
-07/30*	Fast of Tish'a B'Av (Babylon/Rome destroys Holy Temple; fast day)
-09/19*	First Day of Rosh Hashanah (Jewish Lunar New Year; 5781 == 2021;
+07/18*	Fast of Tish'a B'Av (Babylon/Rome destroys Holy Temple; fast day)
+09/07*	First Day of Rosh Hashanah (Jewish Lunar New Year; 5782 == 2022;
 	sabbatical)
-09/20*	Rosh Hashanah (sabbatical)
-09/21*	Fast of Gedalya (Murder of Gedalya and subsequent Exile; 1 day
+09/08*	Rosh Hashanah (sabbatical)
+09/09*	Fast of Gedalya (Murder of Gedalya and subsequent Exile; 1 day
 	after Rosh Hashanah; fast day)
-09/28*	Yom Kippur (Day of Atonement; 9 days after Rosh Hashanah;
+09/16*	Yom Kippur (Day of Atonement; 9 days after Rosh Hashanah;
 	sabbatical, fast day)
-10/03*	Sukkot (Festival of Tabernacles; 14 days after Rosh Hashanah;
+09/21*	Sukkot (Festival of Tabernacles; 14 days after Rosh Hashanah;
 	sabbatical)
-10/09*	Hoshanah Rabba (7th day of Sukkot)
-10/01*	Shmini Atzeret (8th Day of Gathering; 1 day after Sukkot; sabbatical)
-11/16*	Sigd (Beta Israel; 50 days after Yom Kippur)
-12/10*	First Day of Chanukah
-12/25*	Fast of Asara B'Tevet (Babylonians put siege on Jerusalem; fast day)
+09/27*	Hoshanah Rabba (7th day of Sukkot)
+09/28*	Shmini Atzeret (8th Day of Gathering; 1 day after Sukkot; sabbatical)
+11/04*	Sigd (Beta Israel; 50 days after Yom Kippur)
+11/28*	First Day of Chanukah
+12/14*	Fast of Asara B'Tevet (Babylonians put siege on Jerusalem; fast day)



CVS commit: src/sys/dev/ic

2020-12-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 25 08:57:38 UTC 2020

Modified Files:
src/sys/dev/ic: ahcisata_core.c ahcisatavar.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/ahcisatavar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.86 src/sys/dev/ic/ahcisata_core.c:1.87
--- src/sys/dev/ic/ahcisata_core.c:1.86	Fri Dec 25 08:55:40 2020
+++ src/sys/dev/ic/ahcisata_core.c	Fri Dec 25 08:57:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.86 2020/12/25 08:55:40 skrll Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.87 2020/12/25 08:57:38 skrll Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.86 2020/12/25 08:55:40 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.87 2020/12/25 08:57:38 skrll Exp $");
 
 #include 
 #include 
@@ -176,7 +176,7 @@ static void
 ahci_setup_ports(struct ahci_softc *sc)
 {
 	int i, port;
-	
+
 	for (i = 0, port = 0; i < AHCI_MAX_PORTS; i++) {
 		if ((sc->sc_ahci_ports & (1U << i)) == 0)
 			continue;
@@ -254,7 +254,7 @@ ahci_attach(struct ahci_softc *sc)
 
 		sc->sc_init_data.cap = AHCI_READ(sc, AHCI_CAP);
 		sc->sc_init_data.ports = AHCI_READ(sc, AHCI_PI);
-		
+
 		ahci_rev = AHCI_READ(sc, AHCI_VS);
 		if (AHCI_VS_MJR(ahci_rev) > 1 ||
 		(AHCI_VS_MJR(ahci_rev) == 1 && AHCI_VS_MNR(ahci_rev) >= 20)) {
@@ -314,7 +314,7 @@ ahci_attach(struct ahci_softc *sc)
 	", %d port%s, %d slot%s, CAP %s\n",
 	AHCI_VS_MJR(ahci_rev), AHCI_VS_MNR(ahci_rev),
 	sc->sc_atac.atac_nchannels,
-	(sc->sc_atac.atac_nchannels == 1 ? "" : "s"), 
+	(sc->sc_atac.atac_nchannels == 1 ? "" : "s"),
 	sc->sc_ncmds, (sc->sc_ncmds == 1 ? "" : "s"), buf);
 
 	sc->sc_atac.atac_cap = ATAC_CAP_DATA16 | ATAC_CAP_DMA | ATAC_CAP_UDMA
@@ -434,18 +434,18 @@ ahci_attach(struct ahci_softc *sc)
 		achp->ahcic_bus_cmdh = sc->sc_cmd_hdrd->dm_segs[0].ds_addr +
 		AHCI_CMDH_SIZE * port;
 		achp->ahcic_rfis = (struct ahci_r_fis *)
-		((char *)cmdhp + 
-		 AHCI_CMDH_SIZE * sc->sc_atac.atac_nchannels + 
+		((char *)cmdhp +
+		 AHCI_CMDH_SIZE * sc->sc_atac.atac_nchannels +
 		 AHCI_RFIS_SIZE * port);
 		achp->ahcic_bus_rfis = sc->sc_cmd_hdrd->dm_segs[0].ds_addr +
-		 AHCI_CMDH_SIZE * sc->sc_atac.atac_nchannels + 
+		 AHCI_CMDH_SIZE * sc->sc_atac.atac_nchannels +
 		 AHCI_RFIS_SIZE * port;
 		AHCIDEBUG_PRINT(("port %d cmdh %p (0x%" PRIx64 ") "
  "rfis %p (0x%" PRIx64 ")\n", i,
 		   achp->ahcic_cmdh, (uint64_t)achp->ahcic_bus_cmdh,
 		   achp->ahcic_rfis, (uint64_t)achp->ahcic_bus_rfis),
 		   DEBUG_PROBE);
-		
+
 		for (j = 0; j < sc->sc_ncmds; j++) {
 			achp->ahcic_cmd_tbl[j] = (struct ahci_cmd_tbl *)
 			((char *)cmdtblp + AHCI_CMDTBL_SIZE * j);
@@ -718,7 +718,7 @@ ahci_intr_port(void *v)
 	if (__predict_false(recover)) {
 		ata_channel_lock(chp);
 		ata_channel_thaw_locked(chp);
-		ata_thread_run(chp, 0, ATACH_TH_RECOVERY, tfd); 
+		ata_thread_run(chp, 0, ATACH_TH_RECOVERY, tfd);
 		ata_channel_unlock(chp);
 	}
 
@@ -1198,7 +1198,7 @@ ahci_cmd_poll(struct ata_channel *chp, s
 	ata_channel_lock(chp);
 
 	/*
-	 * Polled command. 
+	 * Polled command.
 	 */
 	for (int i = 0; i < xfer->c_ata_c.timeout / 10; i++) {
 		if (xfer->c_ata_c.flags & AT_DONE)
@@ -1208,7 +1208,7 @@ ahci_cmd_poll(struct ata_channel *chp, s
 		ata_channel_lock(chp);
 		ata_delay(chp, 10, "ahcipl", xfer->c_ata_c.flags);
 	}
-	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel, 
+	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel,
 	AHCI_READ(sc, AHCI_GHC), AHCI_READ(sc, AHCI_IS),
 	AHCI_READ(sc, AHCI_P_CLBU(chp->ch_channel)),
 	AHCI_READ(sc, AHCI_P_CLB(chp->ch_channel)),
@@ -1444,7 +1444,7 @@ ahci_bio_poll(struct ata_channel *chp, s
 	struct ahci_channel *achp = (struct ahci_channel *)chp;
 
 	/*
-	 * Polled command. 
+	 * Polled command.
 	 */
 	for (int i = 0; i < ATA_DELAY * 10; i++) {
 		if (xfer->c_bio.flags & ATA_ITSDONE)
@@ -1452,7 +1452,7 @@ ahci_bio_poll(struct ata_channel *chp, s
 		ahci_intr_port(achp);
 		delay(100);
 	}
-	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel, 
+	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel,
 	AHCI_READ(sc, AHCI_GHC), AHCI_READ(sc, AHCI_IS),
 	AHCI_READ(sc, AHCI_P_CLBU(chp->ch_channel)),
 	AHCI_READ(sc, AHCI_P_CLB(chp->ch_channel)),
@@ -1536,7 +1536,7 @@ ahci_bio_complete(struct ata_channel *ch
 

CVS commit: src/sys/dev

2020-12-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 25 08:55:40 UTC 2020

Modified Files:
src/sys/dev/ata: ata_wdc.c
src/sys/dev/ic: ahcisata_core.c

Log Message:
Use designated initializers for struct ata_bustype


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/ic/ahcisata_core.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ata_wdc.c
diff -u src/sys/dev/ata/ata_wdc.c:1.118 src/sys/dev/ata/ata_wdc.c:1.119
--- src/sys/dev/ata/ata_wdc.c:1.118	Thu May 21 09:11:33 2020
+++ src/sys/dev/ata/ata_wdc.c	Fri Dec 25 08:55:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_wdc.c,v 1.118 2020/05/21 09:11:33 jdolecek Exp $	*/
+/*	$NetBSD: ata_wdc.c,v 1.119 2020/12/25 08:55:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.118 2020/05/21 09:11:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.119 2020/12/25 08:55:40 skrll Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -119,16 +119,16 @@ static int	wdc_ata_addref(struct ata_dri
 static void	wdc_ata_delref(struct ata_drive_datas *);
 
 const struct ata_bustype wdc_ata_bustype = {
-	SCSIPI_BUSTYPE_ATA,
-	wdc_ata_bio,
-	wdc_reset_drive,
-	wdc_reset_channel,
-	wdc_exec_command,
-	ata_get_params,
-	wdc_ata_addref,
-	wdc_ata_delref,
-	ata_kill_pending,
-	NULL,
+	.bustype_type = SCSIPI_BUSTYPE_ATA,
+	.ata_bio = wdc_ata_bio,
+	.ata_reset_drive = wdc_reset_drive,
+	.ata_reset_channel = wdc_reset_channel,
+	.ata_exec_command = wdc_exec_command,
+	.ata_get_params = ata_get_params,
+	.ata_addref = wdc_ata_addref,
+	.ata_delref = wdc_ata_delref,
+	.ata_killpending = ata_kill_pending,
+	.ata_recovery = NULL,
 };
 
 static const struct ata_xfer_ops wdc_bio_xfer_ops = {

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.85 src/sys/dev/ic/ahcisata_core.c:1.86
--- src/sys/dev/ic/ahcisata_core.c:1.85	Sun Dec 20 00:14:30 2020
+++ src/sys/dev/ic/ahcisata_core.c	Fri Dec 25 08:55:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.85 2020/12/20 00:14:30 jmcneill Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.86 2020/12/25 08:55:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.85 2020/12/20 00:14:30 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.86 2020/12/25 08:55:40 skrll Exp $");
 
 #include 
 #include 
@@ -113,16 +113,16 @@ static const struct scsipi_bustype ahci_
 #define AHCI_RST_WAIT (ATA_RESET_DELAY / 10)
 
 const struct ata_bustype ahci_ata_bustype = {
-	SCSIPI_BUSTYPE_ATA,
-	ahci_ata_bio,
-	ahci_reset_drive,
-	ahci_reset_channel,
-	ahci_exec_command,
-	ata_get_params,
-	ahci_ata_addref,
-	ahci_ata_delref,
-	ahci_killpending,
-	ahci_channel_recover,
+	.bustype_type = SCSIPI_BUSTYPE_ATA,
+	.ata_bio = ahci_ata_bio,
+	.ata_reset_drive = ahci_reset_drive,
+	.ata_reset_channel = ahci_reset_channel,
+	.ata_exec_command = ahci_exec_command,
+	.ata_get_params = ata_get_params,
+	.ata_addref = ahci_ata_addref,
+	.ata_delref = ahci_ata_delref,
+	.ata_killpending = ahci_killpending,
+	.ata_recovery = ahci_channel_recover,
 };
 
 static void ahci_setup_port(struct ahci_softc *sc, int i);