NetBSD Problem Report #52885
From clare@csel.org Mon Jan 1 07:04:45 2018
Return-Path: <clare@csel.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 0C88E7A1DF
for <gnats-bugs@gnats.NetBSD.org>; Mon, 1 Jan 2018 07:04:45 +0000 (UTC)
Message-Id: <20180101070439.4C471146CA3@router.csel.org>
Date: Mon, 1 Jan 2018 16:04:39 +0900 (JST)
From: Shinichi Doyashiki <clare@csel.org>
Reply-To: clare@csel.org
To: gnats-bugs@NetBSD.org
Subject: The wm(4) has possible typo in comment
X-Send-Pr-Version: 3.95
>Number: 52885
>Category: kern
>Synopsis: The wm(4) has possible typo in comment
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: jnemeth
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 01 07:05:00 +0000 2018
>Closed-Date: Mon Jan 01 08:35:16 +0000 2018
>Last-Modified: Sat Aug 11 13:35:01 +0000 2018
>Originator: Shinichi Doyashiki
>Release: NetBSD 8.99.9
>Organization:
at home
>Environment:
System: NetBSD router.csel.org 8.99.9 NetBSD 8.99.9 (XCYMINIPC) #17: Sat Dec 30 01:26:39 JST 2017 clare@router.csel.org:/export/stage/hack/sys/arch/amd64/compile/XCYMINIPC amd64
Architecture: x86_64
Machine: amd64
>Description:
The wm(4) has possible typo in comment.
>How-To-Repeat:
See the source.
>Fix:
Index: if_wm.c
===================================================================
RCS file: /export/cvsroot/netbsd/src/sys/dev/pci/if_wm.c,v
retrieving revision 1.550
diff -u -r1.550 if_wm.c
--- if_wm.c 28 Dec 2017 06:13:50 -0000 1.550
+++ if_wm.c 1 Jan 2018 06:58:03 -0000
@@ -7870,7 +7876,7 @@
lasttx = nexttx;
nexttx = WM_NEXTTX(txq, nexttx);
/*
- * fill in the next descriptors. legacy or adcanced format
+ * fill in the next descriptors. legacy or advanced format
* is the same here
*/
for (seg = 1; seg < dmamap->dm_nsegs;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->jnemeth
Responsible-Changed-By: jnemeth@NetBSD.org
Responsible-Changed-When: Mon, 01 Jan 2018 08:35:16 +0000
Responsible-Changed-Why:
I fixed it.
State-Changed-From-To: open->closed
State-Changed-By: jnemeth@NetBSD.org
State-Changed-When: Mon, 01 Jan 2018 08:35:16 +0000
State-Changed-Why:
Patch applied. Thanks for the PR!
From: "John Nemeth" <jnemeth@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52885 CVS commit: src/sys/dev/pci
Date: Mon, 1 Jan 2018 08:33:28 +0000
Module Name: src
Committed By: jnemeth
Date: Mon Jan 1 08:33:28 UTC 2018
Modified Files:
src/sys/dev/pci: if_wm.c
Log Message:
PR/52885 - Shinichi Doyashiki -- typo in comment
To generate a diff of this commit:
cvs rdiff -u -r1.550 -r1.551 src/sys/dev/pci/if_wm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52885 CVS commit: [netbsd-8] src
Date: Mon, 5 Feb 2018 15:07:30 +0000
Module Name: src
Committed By: martin
Date: Mon Feb 5 15:07:30 UTC 2018
Modified Files:
src/share/man/man4 [netbsd-8]: wm.4
src/sys/dev/pci [netbsd-8]: if_wm.c
Log Message:
Pull up following revision(s) (requested by knakahara in ticket #529):
sys/dev/pci/if_wm.c: revision 1.560
sys/dev/pci/if_wm.c: revision 1.561
sys/dev/pci/if_wm.c: revision 1.562
share/man/man4/wm.4: revision 1.37
share/man/man4/wm.4: revision 1.38
sys/dev/pci/if_wm.c: revision 1.551
sys/dev/pci/if_wm.c: revision 1.553
sys/dev/pci/if_wm.c: revision 1.554
sys/dev/pci/if_wm.c: revision 1.555
sys/dev/pci/if_wm.c: revision 1.556
sys/dev/pci/if_wm.c: revision 1.557
sys/dev/pci/if_wm.c: revision 1.558
sys/dev/pci/if_wm.c: revision 1.559
PR/52885 - Shinichi Doyashiki -- typo in comment
Fix legacy Tx descriptors printing when WM_DEBUG is enabled.
improve comments
Fix wm_watchdog_txq() lock region.
Not only wm_txeof() but also wm_watchdog_txq() itself requires txq_lock
as it reads Tx descriptor management variables such as "txq_free".
There is almost no influence on performance.
Fix duplicated "rxintr" evcnt counting. Pointed out by ozaki-r@n.o, thanks.
wm_txeof() can limit the loop count the same as wm_rxeof() now.
add WM_TX_PROCESS_LIMIT_DEFAULT and WM_TX_INTR_PROCESS_LIMIT_DEFAULT man.
More markup.
CID-1427779: Fix uninitialized variables
Fix 82574 MSI-X mode cannot receive packets after 82574 receives high rate traffic.
In short, 82574 MSI-X mode does not cause RXQ MSI-X vector when 82574's
phys FIFO overflows. I don't know why but 82574 causes not RXQ MSI-X vector
but OTHER MSI-X vector at the situation.
see:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc9&id=4aea7a5c5e940c1723add439f4088844cd26196d
advised by msaitoh@n.o, thanks.
Fix if_wm.c:r1.557 merge miss, sorry.
Fix unmatched return type. The return value of wm_txeof() is not useded yet.
Make wm(4) watchdog MP-safe. There is almost no influence on performance.
wm(4) does not use ifp->if_watchdog now, that is, it does not touch
ifp->if_timer.
It also uses own callout(wm_tick) as watchdog now. The watchdog uses
per-queue counter to check timeout. So, global lock is not required.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/share/man/man4/wm.4
cvs rdiff -u -r1.508.4.12 -r1.508.4.13 src/sys/dev/pci/if_wm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52885 CVS commit: [netbsd-7] src
Date: Sat, 11 Aug 2018 13:34:21 +0000
Module Name: src
Committed By: martin
Date: Sat Aug 11 13:34:21 UTC 2018
Modified Files:
src/share/man/man4 [netbsd-7]: wm.4
src/sys/dev/mii [netbsd-7]: ihphyreg.h inbmphyreg.h
src/sys/dev/pci [netbsd-7]: if_wm.c if_wmreg.h if_wmvar.h pcidevs
pcireg.h
Log Message:
Pull up the following, requested by msaitoh in ticket #1628:
share/man/man4/wm.4 1.40 via patch
sys/dev/mii/ihphyreg.h 1.2
sys/dev/mii/inbmphyreg.h 1.10
sys/dev/pci/if_wm.c 1.504, 1.506, 1.510-1.535, 1.539-1.540, 1.546, 1.548, 1.551-1.552, 1.558, 1.565-1.573, 1.575, 1.579, 1.582, 1.584 via patch
sys/dev/pci/if_wmreg.h 1.99-1.103, 1.106-1.107 via patch
sys/dev/pci/if_wmvar.h 1.34-1.39 via patch
sys/dev/pci/pcidevs 1.1327 via patch
sys/dev/pci/pcidevs.h regen
sys/dev/pci/pcidevs_data.h regen
sys/dev/pci/pcireg.h patch
Sync wm(4) up to 2018/08/08 except MSI/MSI-X and NET_MPSAFE:
- remove extra "+"
- Fix a bug that non-GMII devices don't send a routing message when
the link status is changed.
- Set WMREG_KABGTXD not in wm_init_locked() but in wm_reset(). Same as
other OSes.
- If a interrupt is a spurious interrupt, don't print debug message.
- Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).
- Print sc_flags with snprintb().
- Fix a bug that a RAL was written at incorrect address when the index
number is more than 16 on 82544 and newer.
- The layout of RAL on PCH* are different from others. Fix it.
- Flush every MTA write. Same as Linux.
- Move the location of calling wm_set_filter. Same as some other OSes.
- Add CSR_WRITE_FLUSH() after writing WMREG_CTRL in
wm_gmii_mediachange().
- Add missing "else" in wm_nvm_release().
- Make new wm_phy_post_reset() and use this function at all location
after resetting phy.
- Move the location of calling wm_get_hw_control. Same as Linux.
- Add I219 specific wokaround for legacy interrupt. From OpenBSD.
- Move the location of calling wm_lplu_d0_disable().
- Fix latency calculation in wm_platform_pm_pch_lpt().
- Set OBFF water mark and enable OBFF on PCH_LPT and newer.
- Disable D0 LPLU on 8257[12356], 82580, I350 and I21[01], too. Before
this commit, above devices and non-PCIe devices accessed wrong
register.
- Use device_printf() instead of aprint_error_dev() for PHY read/write
functions because those are used not only in device attach.
- Fix a bug that wm_gmii_i82544_{read,write}reg() didn't take care of
page select. PHY access from igphy() automatically did it, but
accessing from wm(4) for wrokaround didn't work correctly. This
change affects 8254[17], 8257[12] ICH8, ICH9 and ICH10.
- Call wm_kmrn_lock_loss_workaround_ich8lan() before any PHY access in
wm_linkintr_gmii().
- Register access in wm_kmrn_lock_loss_workaround_ich8lan() now works
correctly. Enable this function.
- Configure the LCD with the extended configuration region in NVM if
it's required.
- If TX is not required to flush, RX is also not required to flush
in wm_flush_desc_rings(). Same as other OSes.
- Remove wrong semaphore access in wm_nvm_{read,write}_{ich8,spt} to
prevent hangup. A semaphore is get/put in wm_nvm_{read,write}.
- Move some initialization stuff in wm_attach() before wm_reset(). Some
flags and callback function are required to set correctly before
wm_reset() because wm_reset() and some helper functions refer them.
- Add wm_write_smbus_addr() to set SMBus address by software.
- Modify wm_gmii_hv_{read,write}reg_locked() to make them access
HV_SMB_ADDR correctly.
- Use new nvm.{acquire,release}() for semaphore.
- Our MII readreg/writereg API has not way to detect an error.
kmrn_{read,write}reg() are not used for MII API, so it's not required
for these functions to use the same API. So,
- Change return value as error code.
- Change register value from int to uint16_t.
- read: pass pointer for uint16_t as an argument.
- Check return value on caller side.
- Check whether it's required to use MDIC workaround for 80003 or not
in wm_reset(). If the workaround isn't required, don't use the
workaround code in wm_gmii_i80003_{read,write}reg.
- Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers
say "In rare circumstances, the SW semaphore may already be held
unintentionally on I21[01]". PXE boot is one of the case.
- Qemu's e1000e emulation (82574L)'s SPI has only 64 words. I've never
seen on real 82574 hardware with such small SPI ROM. Check
sc->sc_nvm_wordsize before accessing higher address words to prevent
timeout.
- Check some wm_nvm_read()'s return vale.
- Print NVM offset and word count when EERD polling failed.
- On I219, drop TARC0 bit 28 for DMA hang workaround (from Linux).
- 82583 supports jumbo frame. Fixes PR#52773 reported by
Shinichi Doyashiki.
- Fix typo in comment. Reported by Shinichi Doyashiki in PR#52885.
- Add ASPM workaround for 8257[1234] and 82583 to prevent device
timeout or hangup. Fixes PR#52818 reported by Shinichi Doyashiki.
- CID-1427779: Fix uninitialized variables.
- Fix a bug that wm_pll_workaround_i210() is not called when
a) Chip is I211 or b) Chip is I210 and it uses iNVM (not FLASH).
- Do wm_reset_mdicnfg_82580() on 82580 only.
- Fix FLASH access on PCH_SPT and newer. Their FLASH access should be
done by 32bit. Especially for ICH_FLASH_HSFCTL register, it's located
at 0x0006, so it must be accessed via ICH_FLASH_HSFSTS(0x0004) and
use shift or mask.
- Make wm_nvm_valid_bank_detect_ich8lan() the same as other OSes.
- If the extended configuration size in the EXTCNFSIZE register is 0,
don't continue in wm_init_lcd_from_nvm().
- Add PCH_CNP support (I219 with Intel 300 series chipset).
- Enable I219 support.
- I354 uses an external PHY, so don't use wm_set_eee_i350().
- Fix a bug that the link can't detect in link interrupt function for
non-SERDES fiber.
- Fix a bug that 82542 misunderstand fiber's signal detection.
- Add debug printf()s.
- Update comment.
- Rename functions and variables.
- Add diagnostic code.
- Sort registers.
- Lowercase hexadecimal values.
- KNF.
To generate a diff of this commit:
cvs rdiff -u -r1.30.2.1 -r1.30.2.2 src/share/man/man4/wm.4
cvs rdiff -u -r1.1 -r1.1.38.1 src/sys/dev/mii/ihphyreg.h
cvs rdiff -u -r1.3.30.1 -r1.3.30.2 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.289.2.14 -r1.289.2.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.60.2.8 -r1.60.2.9 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.19.2.6 -r1.19.2.7 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.1199.2.11 -r1.1199.2.12 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.95.2.3 -r1.95.2.4 src/sys/dev/pci/pcireg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.