NetBSD Problem Report #51924

From jarle@festningen.uninett.no  Sun Jan 29 12:30:15 2017
Return-Path: <jarle@festningen.uninett.no>
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7EC457A16A
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 29 Jan 2017 12:30:15 +0000 (UTC)
Message-Id: <20170129123009.228E681AB0@festningen.uninett.no>
Date: Sun, 29 Jan 2017 13:30:09 +0100 (CET)
From: jarle@uninett.no
Reply-To: jarle@uninett.no
To: gnats-bugs@NetBSD.org
Subject: makphy @ wm on Lenovo T400s no longer works properly
X-Send-Pr-Version: 3.95

>Number:         51924
>Category:       kern
>Synopsis:       makphy @ wm on Lenovo T400s no longer works properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    msaitoh
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 29 12:35:00 +0000 2017
>Closed-Date:    Thu Mar 09 08:27:16 +0000 2017
>Last-Modified:  Fri Mar 10 06:55:00 +0000 2017
>Originator:     Jarle Greipsland
>Release:        NetBSD 7.99.59
>Organization:

>Environment:


System: NetBSD singsaker.uninett.no 7.99.59 NetBSD 7.99.59 (GENERIC) #4: Sun Jan 29 00:15:29 CET 2017  jarle@singsaker.uninett.no:/usr/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
I have just booted a -current i386 GENERIC kernel on my Lenovo
T400s laptop (userland is of 7.99.32 vintage).  There seems to be
something strange going on with regards to the carrier status for
the built in wm0 network interface.  When left unconfigured, it
reports 'active' as its status.  As soon as I bring the interface
up with ifconfig, the status changes to 'no carrier'.  However,
the interface will acquire an IPv6 address through SLAAC, so
something is working.  But the

  'dhcpcd -6 --nodhcp6 wm0'

command that would normally solicit a default route from the network hangs
waiting for carrier on the interface.  If I instead enter a static IPv6
default route, things behave as normal (sort of).

# ifconfig wm0
wm0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
        capabilities=7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
        capabilities=7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
        enabled=0
        ec_capabilities=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
        ec_enabled=0
        address: 00:11:22:33:44:55
        media: Ethernet autoselect (none)
        status: no carrier
        inet6 fe80::0211:22ff:fe33:4455%wm0 prefixlen 64 detached scopeid 0x2
        inet6 xxxx::0211:22ff:fe33:4455 prefixlen 64 autoconf

This used to work just fine with a 7.99.32 kernel.  The interface is
autoconfigured as:

wm0 at pci0 dev 25 function 0: 82801I mobile (AMT) LAN Controller (rev. 0x03)
wm0: interrupting at msi0 vec 0
wm0: PCI-Express bus
wm0: 2048 words FLASH
wm0: Ethernet address 00:11:22:33:44:55
makphy0 at wm0 phy 2: Marvell 88E1149 Gigabit PHY, rev. 1
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto

I think I have identified where the regression was introduced, and the
culprit is -r1.428 to sys/dev/pci/if_wm.c.  If I revert that commit, a
-current kernel boots fine, and wm0 behaves as expected.

>How-To-Repeat:

>Fix:

Revert -r1.428?

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->msaitoh
Responsible-Changed-By: msaitoh@NetBSD.org
Responsible-Changed-When: Mon, 30 Jan 2017 02:38:20 +0000
Responsible-Changed-Why:
mine.


From: Masanobu SAITOH <msaitoh@execsw.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: msaitoh@execsw.org
Subject: Re: kern/51924: makphy @ wm on Lenovo T400s no longer works properly
Date: Mon, 30 Jan 2017 13:16:06 +0900

 On 2017/01/29 21:35, jarle@uninett.no wrote:
 >> Number:         51924
 >> Category:       kern
 >> Synopsis:       makphy @ wm on Lenovo T400s no longer works properly
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       medium
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Sun Jan 29 12:35:00 +0000 2017
 >> Originator:     Jarle Greipsland
 >> Release:        NetBSD 7.99.59
 >> Organization:
 > 	
 >> Environment:
 > 	
 > 	
 > System: NetBSD singsaker.uninett.no 7.99.59 NetBSD 7.99.59 (GENERIC) #4: Sun Jan 29 00:15:29 CET 2017  jarle@singsaker.uninett.no:/usr/obj/sys/arch/i386/compile/GENERIC i386
 > Architecture: i386
 > Machine: i386
 >> Description:
 > I have just booted a -current i386 GENERIC kernel on my Lenovo
 > T400s laptop (userland is of 7.99.32 vintage).  There seems to be
 > something strange going on with regards to the carrier status for
 > the built in wm0 network interface.  When left unconfigured, it
 > reports 'active' as its status.  As soon as I bring the interface
 > up with ifconfig, the status changes to 'no carrier'.  However,
 > the interface will acquire an IPv6 address through SLAAC, so
 > something is working.  But the
 >
 >   'dhcpcd -6 --nodhcp6 wm0'
 >
 > command that would normally solicit a default route from the network hangs
 > waiting for carrier on the interface.  If I instead enter a static IPv6
 > default route, things behave as normal (sort of).
 >
 > # ifconfig wm0
 > wm0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
 >         capabilities=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
 >         capabilities=7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
 >         capabilities=7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
 >         enabled=0
 >         ec_capabilities=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
 >         ec_enabled=0
 >         address: 00:11:22:33:44:55
 >         media: Ethernet autoselect (none)
 >         status: no carrier
 >         inet6 fe80::0211:22ff:fe33:4455%wm0 prefixlen 64 detached scopeid 0x2
 >         inet6 xxxx::0211:22ff:fe33:4455 prefixlen 64 autoconf
 >
 > This used to work just fine with a 7.99.32 kernel.  The interface is
 > autoconfigured as:
 >
 > wm0 at pci0 dev 25 function 0: 82801I mobile (AMT) LAN Controller (rev. 0x03)
 > wm0: interrupting at msi0 vec 0
 > wm0: PCI-Express bus
 > wm0: 2048 words FLASH
 > wm0: Ethernet address 00:11:22:33:44:55
 > makphy0 at wm0 phy 2: Marvell 88E1149 Gigabit PHY, rev. 1
 > makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
 >
 > I think I have identified where the regression was introduced, and the
 > culprit is -r1.428 to sys/dev/pci/if_wm.c.  If I revert that commit, a
 > -current kernel boots fine, and wm0 behaves as expected.

   Could you apply the following diff? Linux and FreeBSD define the device's macro
 as "E1000_DEV_ID_ICH9_IGP_M_AMT" but it's not IGP but BM.

 Index: if_wm.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/if_wm.c,v
 retrieving revision 1.470
 diff -u -p -r1.470 if_wm.c
 --- if_wm.c	27 Jan 2017 05:04:47 -0000	1.470
 +++ if_wm.c	30 Jan 2017 04:12:27 -0000
 @@ -8684,6 +8684,7 @@ wm_gmii_mediainit(struct wm_softc *sc, p
   		break;
   	case PCI_PRODUCT_INTEL_82801H_82567V_3:
   	case PCI_PRODUCT_INTEL_82801I_BM:
 +	case PCI_PRODUCT_INTEL_82801I_IGP_M_AMT: /* This is not IGP but BM */
   	case PCI_PRODUCT_INTEL_82801J_R_BM_LM:
   	case PCI_PRODUCT_INTEL_82801J_R_BM_LF:
   	case PCI_PRODUCT_INTEL_82801J_D_BM_LM:





 >> How-To-Repeat:
 > 	
 >> Fix:
 > 	
 > Revert -r1.428?
 >
 >> Unformatted:
 >  	
 >  	
 >


 -- 
 -----------------------------------------------
                  SAITOH Masanobu (msaitoh@execsw.org
                                   msaitoh@netbsd.org)

From: Jarle Greipsland <jarle@uninett.no>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51924: makphy @ wm on Lenovo T400s no longer works
 properly
Date: Mon, 30 Jan 2017 15:44:11 +0100 (CET)

 Masanobu SAITOH <msaitoh@execsw.org> writes:
 > The following reply was made to PR kern/51924; it has been noted by GNATS.
 [ ... ]
 >    Could you apply the following diff? Linux and FreeBSD define the device's macro
 >  as "E1000_DEV_ID_ICH9_IGP_M_AMT" but it's not IGP but BM.
 >  
 >  Index: if_wm.c
 >  ===================================================================
 >  RCS file: /cvsroot/src/sys/dev/pci/if_wm.c,v
 >  retrieving revision 1.470
 >  diff -u -p -r1.470 if_wm.c
 >  --- if_wm.c	27 Jan 2017 05:04:47 -0000	1.470
 >  +++ if_wm.c	30 Jan 2017 04:12:27 -0000
 >  @@ -8684,6 +8684,7 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 >    		break;
 >    	case PCI_PRODUCT_INTEL_82801H_82567V_3:
 >    	case PCI_PRODUCT_INTEL_82801I_BM:
 >  +	case PCI_PRODUCT_INTEL_82801I_IGP_M_AMT: /* This is not IGP but BM */
 >    	case PCI_PRODUCT_INTEL_82801J_R_BM_LM:
 >    	case PCI_PRODUCT_INTEL_82801J_R_BM_LF:
 >    	case PCI_PRODUCT_INTEL_82801J_D_BM_LM:
 With this diff applied, the network interface works properly again.

 					-jarle

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51924 CVS commit: src/sys/dev/pci
Date: Wed, 1 Feb 2017 07:50:03 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Wed Feb  1 07:50:03 UTC 2017

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

 Log Message:
  Linux and FreeBSD defines 0x10f5 as E1000_DEV_ID_ICH9_IGP_M_AMT. In reality,
 This is not IGP but BM. Add new case to identify PHY type correctly on this
 device. Fixes PR#51924 reported byJarle Greipsland.

  This change fix only for 0x10f5. Need more work to be the best.


 To generate a diff of this commit:
 cvs rdiff -u -r1.473 -r1.474 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: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51924 CVS commit: [netbsd-7] src/sys/dev/pci
Date: Thu, 9 Mar 2017 06:28:36 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Thu Mar  9 06:28:36 UTC 2017

 Modified Files:
 	src/sys/dev/pci [netbsd-7]: if_wm.c if_wmreg.h if_wmvar.h

 Log Message:
 Pull up following revision(s) (requested by msaitoh in ticket #1372):
 	sys/dev/pci/if_wm.c: revisions 1.462, 1.464-1.465 1.474 via patch
 	sys/dev/pci/if_wmreg.h: revision 1.97
 	sys/dev/pci/if_wmvar.h: revision 1.33
 - Set IPV6EXDIS bit in RFCTL register because of an Errata on 82575 and
   newer devices.
 - Linux and FreeBSD defines 0x10f5 as E1000_DEV_ID_ICH9_IGP_M_AMT. In
   reality, This is not IGP but BM. Add new case to identify PHY type
   device. Fixes PR#51924 reported byJarle Greipsland.
 - Use new wm_gmii_setup_phytype() function to setup sc_phytype and
   mii_{read|write}reg. This change improves detection of PHY type.
 - Fix typo in comment.


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.2.12 -r1.289.2.13 src/sys/dev/pci/if_wm.c
 cvs rdiff -u -r1.60.2.7 -r1.60.2.8 src/sys/dev/pci/if_wmreg.h
 cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/sys/dev/pci/if_wmvar.h

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

State-Changed-From-To: open->closed
State-Changed-By: msaitoh@NetBSD.org
State-Changed-When: Thu, 09 Mar 2017 08:27:16 +0000
State-Changed-Why:
Fixed. Thanks.


From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: msaitoh@NetBSD.org, gnats-admin@NetBSD.org, jarle@uninett.no
Subject: Re: PR/51924 CVS commit: [netbsd-7] src/sys/dev/pci
Date: Thu, 9 Mar 2017 22:01:37 +0100

 On Thu,  9 Mar 2017 06:30:01 +0000 (UTC), Soren Jacobsen wrote:
 >  Modified Files:
 >  =09src/sys/dev/pci [netbsd-7]: if_wm.c if_wmreg.h if_wmvar.h

 This pull-up commit breaks the netbsd-7 amd64 build with

 [...]
 /public/netbsd-7/sys/dev/pci/if_wm.c: In function=20
 'wm_gmii_setup_phytype':
 /public/netbsd-7/sys/dev/pci/if_wm.c:6908:9: error:=20
 'MII_MODEL_xxMARVELL_I347' undeclared (first use in this function)
     case MII_MODEL_xxMARVELL_I347:
          ^
 /public/netbsd-7/sys/dev/pci/if_wm.c:6908:9: note: each undeclared=20
 identifier is reported only once for each function it appears in
 /public/netbsd-7/sys/dev/pci/if_wm.c:6910:9: error:=20
 'MII_MODEL_xxMARVELL_E1340M' undeclared (first use in this function)
     case MII_MODEL_xxMARVELL_E1340M:
          ^
 /public/netbsd-7/sys/dev/pci/if_wm.c:6932:9: error:=20
 'MII_MODEL_INTEL_I82580' undeclared (first use in this function)
     case MII_MODEL_INTEL_I82580:
          ^
 /public/netbsd-7/sys/dev/pci/if_wm.c:6933:9: error:=20
 'MII_MODEL_INTEL_I350' undeclared (first use in this function)
     case MII_MODEL_INTEL_I350:
          ^

 *** Failed target:  if_wm.o

 Cheerio,
 hauke

 --=20
      The ASCII Ribbon Campaign                    Hauke Fath
 ()     No HTML/RTF in email            Institut f=FCr Nachrichtentechnik
 /\     No Word docs in email                     TU Darmstadt
      Respect for open standards              Ruf +49-6151-16-21344

From: Soren Jacobsen <snj@blef.org>
To: gnats-bugs@NetBSD.org
Cc: hf@spg.tu-darmstadt.de
Subject: Re: PR/51924 CVS commit: [netbsd-7] src/sys/dev/pci
Date: Thu, 9 Mar 2017 22:52:32 -0800

 On 03/09 21:30, Hauke Fath wrote:
 > The following reply was made to PR kern/51924; it has been noted by GNATS.
 > 
 > From: Hauke Fath <hf@spg.tu-darmstadt.de>
 > To: gnats-bugs@NetBSD.org
 > Cc: msaitoh@NetBSD.org, gnats-admin@NetBSD.org, jarle@uninett.no
 > Subject: Re: PR/51924 CVS commit: [netbsd-7] src/sys/dev/pci
 > Date: Thu, 9 Mar 2017 22:01:37 +0100
 > 
 >  On Thu,  9 Mar 2017 06:30:01 +0000 (UTC), Soren Jacobsen wrote:
 >  >  Modified Files:
 >  >  =09src/sys/dev/pci [netbsd-7]: if_wm.c if_wmreg.h if_wmvar.h
 >  
 >  This pull-up commit breaks the netbsd-7 amd64 build with
 >  
 >  [...]
 >  /public/netbsd-7/sys/dev/pci/if_wm.c: In function=20
 >  'wm_gmii_setup_phytype':
 >  /public/netbsd-7/sys/dev/pci/if_wm.c:6908:9: error:=20
 >  'MII_MODEL_xxMARVELL_I347' undeclared (first use in this function)

 This should be fixed now.

 Soren

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.