CVS commit: src/usr.bin/calendar

2020-12-24 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Dec 25 07:00:52 UTC 2020

Modified Files:
src/usr.bin/calendar: Makefile

Log Message:
List calendar's known calendars explicitly, and only install those.

Prevents build failures caused by installing editor backups and other
such silliness.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/calendar/Makefile

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/Makefile
diff -u src/usr.bin/calendar/Makefile:1.14 src/usr.bin/calendar/Makefile:1.15
--- src/usr.bin/calendar/Makefile:1.14	Tue Apr 14 22:15:17 2009
+++ src/usr.bin/calendar/Makefile	Fri Dec 25 07:00:52 2020
@@ -1,12 +1,18 @@
-#	$NetBSD: Makefile,v 1.14 2009/04/14 22:15:17 lukem Exp $
+#	$NetBSD: Makefile,v 1.15 2020/12/25 07:00:52 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
 
+CALENDARS=	birthday christian computer history holiday judaic \
+		lotr music netbsd usholiday
+
 PROG=	calendar
+
 .if ${MKSHARE} != "no"
 FILESDIR=/usr/share/calendar
-FILES!= echo ${.CURDIR}/calendars/calendar.*
+.for _C_ in ${CALENDARS}
+FILES+=${.CURDIR}/calendars/calendar.${_C_}
+.endfor
 .endif
 
 .include 



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 22:36:43 UTC 2020

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

Log Message:
 Simplify setting of EIAC register. No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 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.269 src/sys/dev/pci/ixgbe/ixgbe.c:1.270
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.269	Thu Dec 24 18:32:53 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 22:36:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.269 2020/12/24 18:32:53 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.270 2020/12/24 22:36:43 msaitoh Exp $ */
 
 /**
 
@@ -5085,13 +5085,11 @@ ixgbe_enable_intr(struct adapter *adapte
 
 	/* With MSI-X we use auto clear */
 	if (adapter->msix_mem) {
-		mask = IXGBE_EIMS_ENABLE_MASK;
-		/* Don't autoclear Link */
-		mask &= ~IXGBE_EIMS_OTHER;
-		mask &= ~IXGBE_EIMS_LSC;
-		if (adapter->feat_cap & IXGBE_FEATURE_SRIOV)
-			mask &= ~IXGBE_EIMS_MAILBOX;
-		IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask);
+		/*
+		 * It's not required to set TCP_TIMER because we don't use
+		 * it.
+		 */
+		IXGBE_WRITE_REG(hw, IXGBE_EIAC, IXGBE_EIMS_RTX_QUEUE);
 	}
 
 	/*



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 18:32:53 UTC 2020

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

Log Message:
 Fix a bug that INTx is disabled if the INTx line is shared with other device.
ixgbe.c rev. 1.264 was not correct.

 Restore EIMS before return. To read ECIR, clearing EIMC is required for
an errata, so
0) save the original EIMS value
1) clear EIMS
2) read EICR
3) restore with the saved value.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 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.268 src/sys/dev/pci/ixgbe/ixgbe.c:1.269
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.268	Thu Dec 24 15:51:33 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 18:32:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.268 2020/12/24 15:51:33 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.269 2020/12/24 18:32:53 msaitoh Exp $ */
 
 /**
 
@@ -5161,9 +5161,14 @@ ixgbe_legacy_irq(void *arg)
 	bool		more = false;
 	bool		reenable_intr = true;
 	u32		eicr, eicr_mask;
+	u32		eims_orig;
 	u32		task_requests = 0;
 
-	/* Silicon errata #26 on 82598. Disable all interrupts */
+	eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
+	/*
+	 * Silicon errata #26 on 82598. Disable all interrupts before reading
+	 * EICR.
+	 */
 	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
 
 	/* Read and clear EICR */
@@ -5173,6 +5178,7 @@ ixgbe_legacy_irq(void *arg)
 	++que->irqs.ev_count;
 	if (eicr == 0) {
 		adapter->stats.pf.intzero.ev_count++;
+		IXGBE_WRITE_REG(hw, IXGBE_EIMS, eims_orig);
 		return 0;
 	}
 



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 15:51:33 UTC 2020

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

Log Message:
 The EICR register are cleared in the beginning of the ixgbe_legacy_irq(),
so it's not required to clear each bit later in the function.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 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.267 src/sys/dev/pci/ixgbe/ixgbe.c:1.268
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.267	Thu Dec 24 15:51:04 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 15:51:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.267 2020/12/24 15:51:04 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.268 2020/12/24 15:51:33 msaitoh Exp $ */
 
 /**
 
@@ -5166,6 +5166,7 @@ ixgbe_legacy_irq(void *arg)
 	/* Silicon errata #26 on 82598. Disable all interrupts */
 	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
 
+	/* Read and clear EICR */
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
 	adapter->stats.pf.legint.ev_count++;
@@ -5218,14 +5219,11 @@ ixgbe_legacy_irq(void *arg)
 		if ((eicr & eicr_mask)
 		|| ((hw->phy.sfp_type == ixgbe_sfp_type_not_present)
 			&& (eicr & IXGBE_EICR_LSC))) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask);
 			task_requests |= IXGBE_REQUEST_TASK_MOD;
 		}
 
 		if ((hw->mac.type == ixgbe_mac_82599EB) &&
 		(eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR,
-			IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
 			task_requests |= IXGBE_REQUEST_TASK_MSF;
 		}
 	}
@@ -5233,7 +5231,6 @@ ixgbe_legacy_irq(void *arg)
 	/* Check for fan failure */
 	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
 		ixgbe_check_fan_failure(adapter, eicr, true);
-		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
 	}
 
 	/* External PHY interrupt */



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 15:51:04 UTC 2020

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

Log Message:
 The EICR register's all OTHER interrupt bits are cleared in the beginning of
the ixgbe_msix_admin(), so it's not required to clear each bit later in the
function.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 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.266 src/sys/dev/pci/ixgbe/ixgbe.c:1.267
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.266	Thu Dec 24 10:37:47 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 15:51:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.266 2020/12/24 10:37:47 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.267 2020/12/24 15:51:04 msaitoh Exp $ */
 
 /**
 
@@ -3130,14 +3130,11 @@ ixgbe_msix_admin(void *arg)
 		if ((eicr & eicr_mask)
 		|| ((hw->phy.sfp_type == ixgbe_sfp_type_not_present)
 			&& (eicr & IXGBE_EICR_LSC))) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask);
 			task_requests |= IXGBE_REQUEST_TASK_MOD;
 		}
 
 		if ((hw->mac.type == ixgbe_mac_82599EB) &&
 		(eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR,
-			IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
 			task_requests |= IXGBE_REQUEST_TASK_MSF;
 		}
 	}
@@ -3156,7 +3153,6 @@ ixgbe_msix_admin(void *arg)
 		if (eicr & IXGBE_EICR_ECC) {
 			device_printf(adapter->dev,
 			"CRITICAL: ECC ERROR!! Please Reboot!!\n");
-			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC);
 		}
 
 		/* Check for over temp condition */
@@ -3167,8 +3163,6 @@ ixgbe_msix_admin(void *arg)
 	break;
 IXGBE_WRITE_REG(hw, IXGBE_EIMC,
 IXGBE_EICR_GPI_SDP0_X550EM_a);
-IXGBE_WRITE_REG(hw, IXGBE_EICR,
-IXGBE_EICR_GPI_SDP0_X550EM_a);
 retval = hw->phy.ops.check_overtemp(hw);
 if (retval != IXGBE_ERR_OVERTEMP)
 	break;
@@ -3183,7 +3177,6 @@ ixgbe_msix_admin(void *arg)
 	break;
 device_printf(adapter->dev, "CRITICAL: OVER TEMP!! PHY IS SHUT DOWN!!\n");
 device_printf(adapter->dev, "System shutdown required!\n");
-IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS);
 break;
 			}
 		}
@@ -3198,13 +3191,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);
-		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
 	}
 
 	/* External PHY interrupt */
 	if ((hw->phy.type == ixgbe_phy_x550em_ext_t) &&
 	(eicr & IXGBE_EICR_GPI_SDP0_X540)) {
-		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0_X540);
 		task_requests |= IXGBE_REQUEST_TASK_PHY;
 	}
 



CVS commit: src/sys/arch/arm/cortex

2020-12-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Dec 24 14:44:49 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/cortex/gicv3_its.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/arm/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.30 src/sys/arch/arm/cortex/gicv3_its.c:1.31
--- src/sys/arch/arm/cortex/gicv3_its.c:1.30	Fri Dec 11 22:42:31 2020
+++ src/sys/arch/arm/cortex/gicv3_its.c	Thu Dec 24 14:44:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.30 2020/12/11 22:42:31 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.31 2020/12/24 14:44:49 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.30 2020/12/11 22:42:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.31 2020/12/24 14:44:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -292,7 +292,7 @@ gicv3_its_msi_alloc_lpi(struct gicv3_its
 
 	if (vmem_alloc(its->its_gic->sc_lpi_pool, 1, VM_INSTANTFIT|VM_SLEEP, ) != 0)
 		return -1;
-	
+
 	KASSERT(its->its_pa[n] == NULL);
 
 	new_pa = kmem_alloc(sizeof(*new_pa), KM_SLEEP);
@@ -437,7 +437,7 @@ gicv3_its_msix_enable(struct gicv3_its *
 	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_ADDR_HI, (uint32_t)(addr >> 32));
 	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_DATA, lpi - its->its_pic->pic_irqbase);
 	val = bus_space_read_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_VECTCTL);
-	val &= ~PCI_MSIX_VECTCTL_MASK;  
+	val &= ~PCI_MSIX_VECTCTL_MASK;
 	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_VECTCTL, val);
 
 	ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);



CVS commit: src/sys/kern

2020-12-24 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Dec 24 12:14:50 UTC 2020

Modified Files:
src/sys/kern: kern_descrip.c kern_proc.c

Log Message:
Avoid negating the minimum size of pid_t (this overflows).

Reported-by: syzbot+e2eb02f9dfaf4f2e6...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/sys/kern/kern_descrip.c
cvs rdiff -u -r1.261 -r1.262 src/sys/kern/kern_proc.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/kern/kern_descrip.c
diff -u src/sys/kern/kern_descrip.c:1.249 src/sys/kern/kern_descrip.c:1.250
--- src/sys/kern/kern_descrip.c:1.249	Fri Aug 28 10:20:14 2020
+++ src/sys/kern/kern_descrip.c	Thu Dec 24 12:14:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_descrip.c,v 1.249 2020/08/28 10:20:14 christos Exp $	*/
+/*	$NetBSD: kern_descrip.c,v 1.250 2020/12/24 12:14:50 nia Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.249 2020/08/28 10:20:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.250 2020/12/24 12:14:50 nia Exp $");
 
 #include 
 #include 
@@ -1767,6 +1767,9 @@ fsetown(pid_t *pgid, u_long cmd, const v
 	pid_t id = *(const pid_t *)data;
 	int error;
 
+	if (id == INT_MIN)
+		return EINVAL;
+
 	switch (cmd) {
 	case TIOCSPGRP:
 		if (id < 0)

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.261 src/sys/kern/kern_proc.c:1.262
--- src/sys/kern/kern_proc.c:1.261	Thu Sep 17 11:37:35 2020
+++ src/sys/kern/kern_proc.c	Thu Dec 24 12:14:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.261 2020/09/17 11:37:35 martin Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.262 2020/12/24 12:14:50 nia Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.261 2020/09/17 11:37:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.262 2020/12/24 12:14:50 nia Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -619,6 +619,9 @@ pgid_in_session(struct proc *p, pid_t pg
 	struct session *session;
 	int error;
 
+	if (pg_id == INT_MIN)
+		return EINVAL;
+
 	mutex_enter(_lock);
 	if (pg_id < 0) {
 		struct proc *p1 = proc_find(-pg_id);



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 10:37:47 UTC 2020

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

Log Message:
 Reorder some code to reduce diff between ixgbe_legacy_irq() and
ixgbe_msix_admin. No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 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.265 src/sys/dev/pci/ixgbe/ixgbe.c:1.266
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.265	Thu Dec 24 10:00:36 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 10:37:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.265 2020/12/24 10:00:36 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.266 2020/12/24 10:37:47 msaitoh Exp $ */
 
 /**
 
@@ -3108,6 +3108,12 @@ ixgbe_msix_admin(void *arg)
 	/* Clear all OTHER interrupts with write */
 	IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr);
 
+	/* Link status change */
+	if (eicr & IXGBE_EICR_LSC) {
+		IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC);
+		task_requests |= IXGBE_REQUEST_TASK_LSC;
+	}
+
 	if (ixgbe_is_sfp(hw)) {
 		/* Pluggable optics-related interrupt */
 		if (hw->mac.type >= ixgbe_mac_X540)
@@ -3136,12 +3142,6 @@ 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;
-	}
-
 	if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
 		if ((adapter->feat_en & IXGBE_FEATURE_FDIR) &&
 		(eicr & IXGBE_EICR_FLOW_DIR)) {
@@ -5207,11 +5207,9 @@ ixgbe_legacy_irq(void *arg)
 		IXGBE_TX_UNLOCK(txr);
 	}
 
-	/* Check for fan failure */
-	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
-		ixgbe_check_fan_failure(adapter, eicr, true);
-		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
-	}
+	/* Link status change */
+	if (eicr & IXGBE_EICR_LSC)
+		task_requests |= IXGBE_REQUEST_TASK_LSC;
 
 	if (ixgbe_is_sfp(hw)) {
 		/* Pluggable optics-related interrupt */
@@ -5241,9 +5239,11 @@ ixgbe_legacy_irq(void *arg)
 		}
 	}
 
-	/* Link status change */
-	if (eicr & IXGBE_EICR_LSC)
-		task_requests |= IXGBE_REQUEST_TASK_LSC;
+	/* Check for fan failure */
+	if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) {
+		ixgbe_check_fan_failure(adapter, eicr, true);
+		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
+	}
 
 	/* External PHY interrupt */
 	if ((hw->phy.type == ixgbe_phy_x550em_ext_t) &&



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

2020-12-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 24 10:00:36 UTC 2020

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

Log Message:
Add some debug printf()s and modify comments.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 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.264 src/sys/dev/pci/ixgbe/ixgbe.c:1.265
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.264	Thu Dec 24 06:14:41 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Dec 24 10:00:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.264 2020/12/24 06:14:41 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.265 2020/12/24 10:00:36 msaitoh Exp $ */
 
 /**
 
@@ -3105,7 +3105,7 @@ ixgbe_msix_admin(void *arg)
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICS);
 	/* Be sure the queue bits are not cleared */
 	eicr &= ~IXGBE_EICR_RTX_QUEUE;
-	/* Clear interrupt with write */
+	/* Clear all OTHER interrupts with write */
 	IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr);
 
 	if (ixgbe_is_sfp(hw)) {
@@ -5172,7 +5172,7 @@ ixgbe_legacy_irq(void *arg)
 	u32		eicr, eicr_mask;
 	u32		task_requests = 0;
 
-	/* Silicon errata #26 on 82598 */
+	/* Silicon errata #26 on 82598. Disable all interrupts */
 	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
 
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
@@ -5186,7 +5186,8 @@ ixgbe_legacy_irq(void *arg)
 
 	if ((ifp->if_flags & IFF_RUNNING) != 0) {
 		/*
-		 * The same as ixgbe_msix_que() about "que->txrx_use_workqueue".
+		 * The same as ixgbe_msix_que() about
+		 * "que->txrx_use_workqueue".
 		 */
 		que->txrx_use_workqueue = adapter->txrx_use_workqueue;
 
@@ -6142,6 +6143,8 @@ ixgbe_print_debug_info(struct adapter *a
 		device_printf(dev, "EIMS_EX(1):\t%08x\n",
 			  IXGBE_READ_REG(hw, IXGBE_EIMS_EX(1)));
 	}
+	device_printf(dev, "EIAM:\t%08x\n", IXGBE_READ_REG(hw, IXGBE_EIAM));
+	device_printf(dev, "EIAC:\t%08x\n", IXGBE_READ_REG(hw, IXGBE_EIAC));
 } /* ixgbe_print_debug_info */
 
 /
@@ -6566,10 +6569,12 @@ ixgbe_handle_que(void *context)
 		que->req.ev_count++;
 		ixgbe_sched_handle_que(adapter, que);
 	} else if (que->res != NULL) {
-		/* Re-enable this interrupt */
+		/* MSIX: Re-enable this interrupt */
 		ixgbe_enable_queue(adapter, que->msix);
-	} else
+	} else {
+		/* INTx or MSI */
 		ixgbe_enable_intr(adapter);
+	}
 
 	return;
 } /* ixgbe_handle_que */