NetBSD Problem Report #52039

From kardel@pip.kardel.name  Mon Mar  6 16:06:01 2017
Return-Path: <kardel@pip.kardel.name>
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 9DE147A20B
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  6 Mar 2017 16:06:01 +0000 (UTC)
Message-Id: <20170306160557.31AFDDA2CAA@pip.kardel.name>
Date: Mon,  6 Mar 2017 17:05:57 +0100 (CET)
From: kardel@netbsd.org
Reply-To: kardel@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: 7.1_RC2 amd64 panics wm_enable_wakeup on W510 at shutdown
X-Send-Pr-Version: 3.95

>Number:         52039
>Category:       kern
>Synopsis:       7.1_RC2 amd64 panics wm_enable_wakeup on W510 at shutdown
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kardel
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 06 16:10:00 +0000 2017
>Closed-Date:    Tue Jun 20 11:06:43 +0000 2017
>Last-Modified:  Mon Nov 06 09:25:01 +0000 2017
>Originator:     Frank Kardel
>Release:        NetBSD 7.1_RC2
>Organization:

>Environment:


System: NetBSD pip.kardel.name 71_RC2 NetBSD 7.1_RC2 (GENERIC)
Architecture: x86_64
Machine: amd64
>Description:
	The kernel of the install image crashes in shutdown in wm_enable_wakeup for the wm0 device.
	No correct shutdown is possible on a Lenovo W510.
Device from dmesg.boot (7.99.64 kernel though - which can correctly shut-down).
wm0 at pci0 dev 25 function 0: PCH LAN (82577LM) Controller (rev. 0x06)
wm0: interrupting at msi2 vec 0
wm0: PCI-Express bus
wm0: 2048 words FLASH
wm0: Ethernet address  xx::xx

>How-To-Repeat:
	Pick a 7.1_RC2 (RC1 has the same issue). Boot the install image on a Lenovo W510. 
	Exit install system. halt. => panic.

>Fix:
	n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->kardel
Responsible-Changed-By: kardel@NetBSD.org
Responsible-Changed-When: Wed, 08 Mar 2017 07:54:11 +0000
Responsible-Changed-Why:
take myself


From: "Frank Kardel" <kardel@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52039 CVS commit: src/sys/dev/pci
Date: Wed, 8 Mar 2017 08:00:09 +0000

 Module Name:	src
 Committed By:	kardel
 Date:		Wed Mar  8 08:00:09 UTC 2017

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

 Log Message:
 PR kern/52039: use same safeguard as for the 82578


 To generate a diff of this commit:
 cvs rdiff -u -r1.496 -r1.497 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: Masanobu SAITOH <msaitoh@execsw.org>
To: gnats-bugs@NetBSD.org, kardel@NetBSD.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Cc: msaitoh@execsw.org
Subject: Re: PR/52039 CVS commit: src/sys/dev/pci
Date: Wed, 8 Mar 2017 17:20:41 +0900

 On 2017/03/08 17:05, Frank Kardel wrote:
 > The following reply was made to PR kern/52039; it has been noted by GNATS.
 >
 > From: "Frank Kardel" <kardel@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:
 > Subject: PR/52039 CVS commit: src/sys/dev/pci
 > Date: Wed, 8 Mar 2017 08:00:09 +0000
 >
 >  Module Name:	src
 >  Committed By:	kardel
 >  Date:		Wed Mar  8 08:00:09 UTC 2017
 >
 >  Modified Files:
 >  	src/sys/dev/pci: if_wm.c
 >
 >  Log Message:
 >  PR kern/52039: use same safeguard as for the 82578

   Your change is correct.
 In your PR:

 > wm0 at pci0 dev 25 function 0: PCH LAN (82577LM) Controller (rev. 0x06)
 > wm0: interrupting at msi2 vec 0
 > wm0: PCI-Express bus
 > wm0: 2048 words FLASH
 > wm0: Ethernet address  xx::xx

 Isn't any PHY attached? Could you show me the dmesg of PHY device?
 If it doesn't exist, it's strange.

 >
 >  To generate a diff of this commit:
 >  cvs rdiff -u -r1.496 -r1.497 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.



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

From: Frank Kardel <kardel@netbsd.org>
To: 
Cc: gnats-bugs@netbsd.org
Subject: Re: PR/52039 CVS commit: src/sys/dev/pci
Date: Wed, 08 Mar 2017 09:31:17 +0100

 Hi,

 you are right that that is strange. At boot things look like this:

 wm0 at pci0 dev 25 function 0: PCH LAN (82577LM) Controller (rev. 0x06)
 wm0: interrupting at msi2 vec 0
 wm0: PCI-Express bus
 wm0: 2048 words FLASH
 wm0: Ethernet address f0:de:f1:3b:df:f8
 ihphy0 at wm0 phy 2: i82577 10/100/1000 media interface, rev. 3
 ihphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
 1000baseT-FDX, auto

 So there is a PHY attached. But at shutdown the code trips over the NULL 
 pointer,
 Could it be the the PHY is detached before the interface is shut-down?

 Thanks for having an eye on that. With the fix the kernel at least 
 manages to
 shut down cleanly without triggering a fsck at every boot - WOL might 
 not work though with the missing PHY. - I haven't checked that.

 Frank


 On 03/08/17 09:20, Masanobu SAITOH wrote:
 > On 2017/03/08 17:05, Frank Kardel wrote:
 >> The following reply was made to PR kern/52039; it has been noted by
 >> GNATS.
 >>
 >> From: "Frank Kardel" <kardel@netbsd.org>
 >> To: gnats-bugs@gnats.NetBSD.org
 >> Cc:
 >> Subject: PR/52039 CVS commit: src/sys/dev/pci
 >> Date: Wed, 8 Mar 2017 08:00:09 +0000
 >>
 >>  Module Name:    src
 >>  Committed By:    kardel
 >>  Date:        Wed Mar  8 08:00:09 UTC 2017
 >>
 >>  Modified Files:
 >>      src/sys/dev/pci: if_wm.c
 >>
 >>  Log Message:
 >>  PR kern/52039: use same safeguard as for the 82578
 >
 >  Your change is correct.
 > In your PR:
 >
 >> wm0 at pci0 dev 25 function 0: PCH LAN (82577LM) Controller (rev. 0x06)
 >> wm0: interrupting at msi2 vec 0
 >> wm0: PCI-Express bus
 >> wm0: 2048 words FLASH
 >> wm0: Ethernet address  xx::xx
 >
 > Isn't any PHY attached? Could you show me the dmesg of PHY device?
 > If it doesn't exist, it's strange.
 >
 >>
 >>  To generate a diff of this commit:
 >>  cvs rdiff -u -r1.496 -r1.497 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: Frank Kardel <kardel@netbsd.org>
To: gnats-bugs@netbsd.org, netbsd-bugs@netbsd.org, 
 Masanobu SAITOH <msaitoh@execsw.org>
Cc: 
Subject: Re: PR/52039 CVS commit: src/sys/dev/pci
Date: Wed, 08 Mar 2017 09:56:06 +0100

 I just checked: ihphy0 is detached long before wm0 like you would expect 
 with the normal device tree tear down.
 So at first sight the NULL pointer for the children is not surprising to 
 me.

 wd0: detached
 atabus3: detached
 atabus2: detached
 atabus0: detached
 pci8: detached
 pci4: detached
 pci2: detached
 ihphy0: detached
 sysbeep0: detached
 midi0: detached
 pchb15: detached
 pchb14: detached
 pchb13: detached
 pchb12: detached
 pchb11: detached
 pchb10: detached
 pchb9: detached
 pchb8: detached
 pchb7: detached
 pchb6: detached
 pchb5: detached
 pchb4: detached
 pchb3: detached
 pchb2: detached
 pchb1: detached
 ppb7: detached
 ppb3: detached
 ppb1: detached
 wm0: detached
 pchb0: detached
 thinkpad0: detached
 pci9: detached
 forcefully unmounted /dev/wd1a on / type ffs
 wd1: detached
 atabus1: detached

From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52039 CVS commit: [netbsd-7] src/sys/dev/pci
Date: Wed, 19 Apr 2017 17:06:22 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Wed Apr 19 17:06:21 UTC 2017

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

 Log Message:
 Pull up following revision(s) (requested by kardel in ticket #1385):
 	sys/dev/pci/if_wm.c: revision 1.497
 PR kern/52039: use same safeguard as for the 82578


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.2.13 -r1.289.2.14 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: Frank Kardel <kardel@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/52039 CVS commit: [netbsd-7] src/sys/dev/pci
Date: Tue, 20 Jun 2017 12:56:55 +0200

 Verified to work correctly on netbsd-7.

 Can be closed now.

State-Changed-From-To: open->closed
State-Changed-By: kardel@NetBSD.org
State-Changed-When: Tue, 20 Jun 2017 11:06:43 +0000
State-Changed-Why:
issued resolved and netbsd-7 pullup verified


From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52039 CVS commit: [netbsd-7-1] src/sys/dev/pci
Date: Mon, 6 Nov 2017 09:21:48 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Mon Nov  6 09:21:48 UTC 2017

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

 Log Message:
 Pull up following revision(s) (requested by kardel in ticket #1385):
 	sys/dev/pci/if_wm.c: revision 1.497
 PR kern/52039: use same safeguard as for the 82578


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.2.13 -r1.289.2.13.2.1 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.

>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.