NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52818: The wm driver stops working after large traffic



The following reply was made to PR kern/52818; it has been noted by GNATS.

From: Shinichi Doyashiki <clare%csel.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Hisashi T Fujinaka <htodd%twofifty.com@localhost>
Subject: Re: kern/52818: The wm driver stops working after large traffic
Date: Thu, 21 Dec 2017 01:22:38 +0900 (JST)

 This patch is a workaround of the 82583's errata.
 
 Index: if_wm.c
 ===================================================================
 RCS file: /export/cvsroot/netbsd/src/sys/dev/pci/if_wm.c,v
 retrieving revision 1.549
 diff -u -r1.549 if_wm.c
 --- if_wm.c	8 Dec 2017 05:22:23 -0000	1.549
 +++ if_wm.c	20 Dec 2017 16:07:06 -0000
 @@ -1851,6 +1851,43 @@
  
  	wm_adjust_qnum(sc, pci_msix_count(pa->pa_pc, pa->pa_tag));
  
 +	/*
 +	 * The 82573 disappears when PCIe ASPM L0s is enabled.
 +	 *
 +	 * The 82574 and 82583 does not support PCIe ASPM L0s with
 +	 * some chipset.  The document of 82574 and 82583 says that
 +	 * disabling L0s with some specific chipset is sufficient,
 +	 * but we follow as of the Intel em driver does.
 +	 *
 +	 * References:
 +	 * Errata 8 of the Specification Update of i82573.
 +	 * Errata 20 of the Specification Update of i82574.
 +	 * Errata 9 of the Specification Update of i82583.
 +	 */
 +	switch (sc->sc_type) {
 +		int ok;
 +		int capoff;
 +
 +	case WM_T_82573:
 +	case WM_T_82574:
 +	case WM_T_82583:
 +		ok = pci_get_capability(pc, pa->pa_tag,
 +		    PCI_CAP_PCIEXPRESS, &capoff, NULL);
 +		if (!ok)
 +			break;
 +		reg = pci_conf_read(pc, pa->pa_tag, capoff + PCIE_LCAP);
 +		if ((reg & PCIE_LCAP_ASPM) == 0)
 +			break;
 +		reg = pci_conf_read(pc, pa->pa_tag, capoff + PCIE_LCSR);
 +		reg &= ~PCIE_LCSR_ASPM_L1;
 +		reg &= ~PCIE_LCSR_ASPM_L0S;
 +		pci_conf_write(pc, pa->pa_tag, capoff + PCIE_LCSR, reg);
 +		aprint_verbose_dev(sc->sc_dev, "ASPM was disabled to workaround the errata.\n");
 +		break;
 +	default:
 +		break;
 +	}
 +
  	/* Allocation settings */
  	max_type = PCI_INTR_TYPE_MSIX;
  	/*
 


Home | Main Index | Thread Index | Old Index