NetBSD Problem Report #53301

From www@NetBSD.org  Sun May 20 13:46:49 2018
Return-Path: <www@NetBSD.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 609047A1D2
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 May 2018 13:46:49 +0000 (UTC)
Message-Id: <20180520134648.942A87A1FB@mollari.NetBSD.org>
Date: Sun, 20 May 2018 13:46:48 +0000 (UTC)
From: chris@sogubsys.com
Reply-To: chris@sogubsys.com
To: gnats-bugs@NetBSD.org
Subject: msk0 device reports no link, when there is link on same laptop with Windows and Linux. 
X-Send-Pr-Version: www-1.0

>Number:         53301
>Category:       kern
>Synopsis:       msk0 device reports no link, when there is link on same laptop with Windows and Linux.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 20 13:50:00 +0000 2018
>Closed-Date:    
>Last-Modified:  Wed Jan 20 21:49:31 +0000 2021
>Originator:     Chris Humphries
>Release:        8.0_RC1
>Organization:
>Environment:
Samsung R580

root@localhost:~$ dmesg|grep msk
mskc0 at pci3 dev 0 function 0, Yukon (Unknown) (0x0): ioapic0 pin 19
msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
ukphy0 at msk0 phy 0: OUI 0x000ac2, model 0x0026, rev. 0
root@localhost:~$ 

NetBSD localhost 8.0_RC1 NetBSD 8.0_RC1 (GENERIC.201804191727Z) amd64

>Description:
msk0 was not detected in 7.1 installation. I don't remember if it worked then even after reboot.

msk0 is now detected in 8.0_RC1 installation, but never gets link. This problem persists into reboot after installation.

The card doesn't seem to work in NetBSD and I have to use wireless instead.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
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/53301: msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.
Date: Fri, 25 May 2018 12:41:06 +0900

 On 2018/05/20 22:50, chris@sogubsys.com wrote:
 >> Number:         53301
 >> Category:       kern
 >> Synopsis:       msk0 device reports no link, when there is link on same laptop with Windows and Linux.
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       high
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Sun May 20 13:50:00 +0000 2018
 >> Originator:     Chris Humphries
 >> Release:        8.0_RC1
 >> Organization:
 >> Environment:
 > Samsung R580
 > 
 > root@localhost:~$ dmesg|grep msk
 > mskc0 at pci3 dev 0 function 0, Yukon (Unknown) (0x0): ioapic0 pin 19
 > msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 > ukphy0 at msk0 phy 0: OUI 0x000ac2, model 0x0026, rev. 0
 > root@localhost:~$
 > 
 > NetBSD localhost 8.0_RC1 NetBSD 8.0_RC1 (GENERIC.201804191727Z) amd64
 > 
 >> Description:
 > msk0 was not detected in 7.1 installation. I don't remember if it worked then even after reboot.
 > 
 > msk0 is now detected in 8.0_RC1 installation, but never gets link. This problem persists into reboot after installation.
 > 
 > The card doesn't seem to work in NetBSD and I have to use wireless instead.
 >> How-To-Repeat:
 > 
 >> Fix:
 > 

   Please show me the output of "pcictl pci0 list -n"
 (Don't forget to add "-n" flag).

   Thanks in advance.

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

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/53301: msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.
Date: Sat, 26 May 2018 22:23:53 +0200

 >> msk0 was not detected in 7.1 installation. I don't remember if it 
 >> worked then even after reboot.
 >> 
 >> msk0 is now detected in 8.0_RC1 installation, but never gets link. 
 >> This problem persists into reboot after installation.
 >> 
 >> The card doesn't seem to work in NetBSD and I have to use wireless instead.

 See also 
 <http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=49270> for 
 Samsung NC10.

 Cheerio,
 hauke

From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/53301: msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.
Date: Sun, 27 May 2018 00:21:42 -0400

 Thank you. I'll check it out. Currently using non-NetBSD on that
 laptop at the moment, but will get more info and check into that other
 ticket changes you made, Hauke.

 On Sat, May 26, 2018 at 4:30 PM, Hauke Fath
 <hauke@espresso.rhein-neckar.de> wrote:
 > The following reply was made to PR kern/53301; it has been noted by GNATS.
 >
 > From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
 > To: gnats-bugs@NetBSD.org
 > Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org
 > Subject: Re: kern/53301: msk0 device reports no link, when there is link on
 >  same laptop with Windows and Linux.
 > Date: Sat, 26 May 2018 22:23:53 +0200
 >
 >  >> msk0 was not detected in 7.1 installation. I don't remember if it
 >  >> worked then even after reboot.
 >  >>
 >  >> msk0 is now detected in 8.0_RC1 installation, but never gets link.
 >  >> This problem persists into reboot after installation.
 >  >>
 >  >> The card doesn't seem to work in NetBSD and I have to use wireless instead.
 >
 >  See also
 >  <http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=49270> for
 >  Samsung NC10.
 >
 >  Cheerio,
 >  hauke
 >



 -- 
 Chris Humphries

 PGP: 6338DD29 chris@sogubsys.com

Responsible-Changed-From-To: kern-bug-people->jdolecek
Responsible-Changed-By: jdolecek@NetBSD.org
Responsible-Changed-When: Mon, 11 Jun 2018 19:24:48 +0000
Responsible-Changed-Why:
I've added some Yukon variant support code which might potentially
fix this.


State-Changed-From-To: open->feedback
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Mon, 11 Jun 2018 19:24:48 +0000
State-Changed-Why:
Can you confirm if kernel with dev/pci/if_msk.c rev 1.57 or later works
for you?


From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Wed, 6 Jun 2018 00:32:33 -0400

 I am currently working on it now. Installing 7.1.2 and then will build current on the laptop. 

From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Wed, 6 Jun 2018 03:46:11 -0400

 The device gets link but can't seem to get on a network. DHCP server
 is functional on other machines in the house. I'm sorry, but it isn't
 fixed for me.



 uname -a
 ========
 NetBSD neo.sogubsys.com 8.99.19 NetBSD 8.99.19 (GENERIC) #0: Tue Jun 12 06:07:15 EDT 2018  root@neo.sogubsys.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64


 dmesg | grep msk
 ================
 [    1.042116] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 [    1.042116] ukphy0 at msk0 phy 0: OUI 0x000ac2, model 0x0026, rev. 0


 pcictl
 ======
 000:00:0: Intel Iron Lake Host Bridge (host bridge, revision 0x02)
 000:02:0: Intel Iron Lake Integrated Graphics Device (VGA display, revision 0x02)
 000:22:0: Intel 3400 MEI (miscellaneous communications, revision 0x06)
 000:26:0: Intel 3400 USB ECHI (USB serial bus, EHCI, revision 0x05)
 000:27:0: Intel 3400 HD Audio (mixed mode multimedia, revision 0x05)
 000:28:0: Intel 3400 PCIE (PCI bridge, revision 0x05)
 000:28:2: Intel 3400 PCIE (PCI bridge, revision 0x05)
 000:28:3: Intel 3400 PCIE (PCI bridge, revision 0x05)
 000:29:0: Intel 3400 USB EHCI (USB serial bus, EHCI, revision 0x05)
 000:30:0: Intel 82801BAM Hub-PCI Bridge (PCI bridge, subtractive decode, revision 0xa5)
 000:31:0: Intel HM55 LPC Interface Bridge (ISA bridge, revision 0x05)
 000:31:2: Intel 3400 AHCI (SATA mass storage, AHCI 1.0, revision 0x05)
 000:31:3: Intel 3400 SMBus (SMBus serial bus, revision 0x05)
 000:31:6: Intel 3400 Thermal (miscellaneous DASP, revision 0x05)
 002:00:0: Intel WiFi Link 1000 (miscellaneous network)
 006:00:0: Marvell Yukon 88E8040 (ethernet network)
 063:00:0: Intel product 2c62 (host bridge, revision 0x02)
 063:00:1: Intel Core i5-600, i3-500 and Pentium 6000 QuickPath Generic System Address Decoder (host bridge, revision 0x02)
 063:02:0: Intel Core i5-600, i3-500 and Pentium 6000 QPI Link (host bridge, revision 0x02)
 063:02:1: Intel Core i5-600, i3-500 and Pentium 6000 QPI Physical (host bridge, revision 0x02)
 063:02:2: Intel Core i5-600, i3-500 and Pentium 6000 Reserved (host bridge, revision 0x02)
 063:02:3: Intel Core i5-600, i3-500 and Pentium 6000 Reserved (host bridge, revision 0x02)


 /etc/ifconfig.msk0
 ==================
 up
 !dhcpcd $int


 ifconfig msk0
 =============
 msk0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
 	ec_capabilities=5<VLAN_MTU,JUMBO_MTU>
 	ec_enabled=0
 	address: 00:24:54:b4:47:c3
 	media: Ethernet autoselect (none)
 	status: active
 	inet 169.254.34.66/16 broadcast 169.254.255.255 flags 0x0
 	inet6 fe80::224:54ff:feb4:47c3%msk0/64 flags 0x0 scopeid 0x2


 syslog for dhcpcd on the device
 ===============================
 Jun 12 06:48:18 neo dhcpcd[248]: control command: dhcpcd -1 msk0
 Jun 12 06:48:18 neo dhcpcd[248]: msk0: carrier acquired
 Jun 12 06:48:18 neo dhcpcd[248]: msk0: IAID 54:b4:47:c3
 Jun 12 06:48:19 neo dhcpcd[248]: msk0: soliciting a DHCP lease
 Jun 12 06:48:19 neo dhcpcd[248]: msk0: soliciting an IPv6 router
 Jun 12 06:48:24 neo dhcpcd[248]: msk0: probing for an IPv4LL address
 Jun 12 06:48:24 neo dhcpcd[248]: msk0: using IPv4LL address 169.254.34.66
 Jun 12 06:48:29 neo dhcpcd[248]: msk0: adding route to 169.254.0.0/16
 Jun 12 06:48:31 neo dhcpcd[248]: msk0: no IPv6 Routers available




 -- 
 Chris Humphries <chris@sogubsys.com>
 5223 9548 E1DE DE87 F509  1888 8141 8451 6338 DD29

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Wed, 13 Jun 2018 09:36:41 +0200

 I'm working on more thorough sync of the OpenBSD changes to our
 driver. I'll probably do several smaller commits to this effect in
 upcoming days. If you can check those out it would be nice.

 Also I should have an SK-9E21D for testing within a week, which will
 help with the testing on my side.

 Jaromir



 2018-06-06 13:57 GMT+02:00 Chris Humphries <chris@sogubsys.com>:
 > Tried out the new changes you made to msk stuff today, just-in-case
 > there was a change, even though you didn't advise me to try. Same
 > results, though.
 >
 >
 > NetBSD neo.sogubsys.com 8.99.19 NetBSD 8.99.19 (GENERIC) #1: Tue Jun 12 19:58:27 EDT 2018  root@neo.sogubsys.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
 >
 > [    1.049321] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0): ioapic0 pin 19
 > [    1.049321] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 > [    1.049321] ukphy0 at msk0 phy 0: OUI 0x000ac2, model 0x0026, rev. 0
 > [    7.603052] mskc0: interrupt moderation is 1000 us

From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53301 CVS commit: src/sys/dev/mii
Date: Wed, 13 Jun 2018 23:27:48 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Wed Jun 13 23:27:48 UTC 2018

 Modified Files:
 	src/sys/dev/mii: makphy.c

 Log Message:
 sort the models, and add several more variants; data found in OpenBSD eephy.c

 this also makes makphy match model 88E3016, which adresses PR kern/53301
 by Chris Humphries


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/sys/dev/mii/makphy.c

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

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Thu, 14 Jun 2018 01:31:32 +0200

 Hello,

 I've commited change so that makphy* would attach instead of ukphy*.
 Can you check if that changes behaviour? You need sys/dev/mii/makphy.c
 revision 1.43 or later.

 Jaromir

From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: PR/53301 CVS commit: src/sys/dev/mii
Date: Wed, 6 Jun 2018 15:52:11 -0400

 Updating and compiling now, thank you!
 -- 
 Chris Humphries <chris@sogubsys.com>
 5223 9548 E1DE DE87 F509  1888 8141 8451 6338 DD29

From: Chris Humphries <chris@sogubsys.com>
To: =?utf-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Wed, 6 Jun 2018 16:08:56 -0400

 I just compiled a new current kernel. I appreciate the difficulty in
 working on this problem when you can't replicate the issue. I'm not
 there yet with skills in kernel programming :(

 -Chris

 NetBSD neo.sogubsys.com 8.99.19 NetBSD 8.99.19 (GENERIC) #2: Wed Jun 13 20:51:51 EDT 2018  chris@neo.sogubsys.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64

 Jun 13 21:10:27 neo /netbsd: [   1.0456873] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0): ioapic0 pin 19
 Jun 13 21:10:27 neo /netbsd: [   1.0456873] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 Jun 13 21:10:27 neo /netbsd: [   1.0456873] makphy0 at msk0 phy 0: Marvell 88E3016 10/100 Fast Ethernet PHY, rev. 0
 Jun 13 21:10:27 neo /netbsd: [   7.4508461] mskc0: interrupt moderation is 1000 us

 Jun 13 21:10:30 neo dhcpcd[285]: msk0: using IPv4LL address 169.254.34.66/16
 Jun 13 21:10:30 neo dhcpcd[285]: msk0: adding route to 169.254.0.0/16
 Jun 13 21:10:30 neo dhcpcd[285]: msk0: adding default route
 Jun 13 21:10:30 neo dhcpcd[167]: msk0: deleted default route
 Jun 13 21:10:36 neo dhcpcd[285]: msk0: no IPv6 Routers available

 Jun 13 21:10:39 neo ntpd[963]: Listen normally on 5 msk0 [fe80::224:54ff:feb4:47c3%2]:123
 Jun 13 21:10:39 neo ntpd[963]: Listen normally on 6 msk0 169.254.34.66:123

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Thu, 14 Jun 2018 09:17:10 +0200

 Don't worry :)

 So with this patch, does it detect the link at least, what's ifconfig output?

 Also, can you try to apply and run with the patch at
 http://www.netbsd.org/~jdolecek/if_msk_fix_hard_lock.diff

 It also contains change from OpenBSD rev. 1.69, which had commit
 message "Make Yukon-2 FE+ (88E8040, 88E8042) work." - that is your
 device :)

 Jaromir

 2018-06-06 22:08 GMT+02:00 Chris Humphries <chris@sogubsys.com>:
 > I just compiled a new current kernel. I appreciate the difficulty in
 > working on this problem when you can't replicate the issue. I'm not
 > there yet with skills in kernel programming :(
 >
 > -Chris
 >
 > NetBSD neo.sogubsys.com 8.99.19 NetBSD 8.99.19 (GENERIC) #2: Wed Jun 13 20:51:51 EDT 2018  chris@neo.sogubsys.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
 >
 > Jun 13 21:10:27 neo /netbsd: [   1.0456873] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0): ioapic0 pin 19
 > Jun 13 21:10:27 neo /netbsd: [   1.0456873] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 > Jun 13 21:10:27 neo /netbsd: [   1.0456873] makphy0 at msk0 phy 0: Marvell 88E3016 10/100 Fast Ethernet PHY, rev. 0
 > Jun 13 21:10:27 neo /netbsd: [   7.4508461] mskc0: interrupt moderation is 1000 us
 >
 > Jun 13 21:10:30 neo dhcpcd[285]: msk0: using IPv4LL address 169.254.34.66/16
 > Jun 13 21:10:30 neo dhcpcd[285]: msk0: adding route to 169.254.0.0/16
 > Jun 13 21:10:30 neo dhcpcd[285]: msk0: adding default route
 > Jun 13 21:10:30 neo dhcpcd[167]: msk0: deleted default route
 > Jun 13 21:10:36 neo dhcpcd[285]: msk0: no IPv6 Routers available
 >
 > Jun 13 21:10:39 neo ntpd[963]: Listen normally on 5 msk0 [fe80::224:54ff:feb4:47c3%2]:123
 > Jun 13 21:10:39 neo ntpd[963]: Listen normally on 6 msk0 169.254.34.66:123

From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Wed, 6 Jun 2018 23:47:55 -0400

 I applied your patch successfully, but appears nothing has changed on
 my end.

 Same results with dhcp, dmesg|grep msk, etc. 

 -Chris

From: Chris Humphries <chris@sogubsys.com>
To: =?utf-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Thu, 7 Jun 2018 00:41:01 -0400

 It is attaching the wrong device?


 pcictl pci0 list|grep Marvell
 -----------------------------
 006:00:0: Marvell Yukon 88E8040 (ethernet network)

 lspci|grep Marvell
 ------------------
 06:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller

 dmesg|grep msk
 --------------
 [    1.040190] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0): ioapic0 pin 19
 [    1.040190] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 [    1.040190] makphy0 at msk0 phy 0: Marvell 88E3016 10/100 Fast Ethernet PHY, rev. 0
 [    7.355489] mskc0: interrupt moderation is 1000 us

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Cc: Chris Humphries <chris@sogubsys.com>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sat, 16 Jun 2018 02:09:14 +0200

 Can you send me ifconfig output? To confirm if at least the PHY now
 works, i.e. if the link is now detected.

 Jaromir

 2018-06-15 1:35 GMT+02:00 Chris Humphries <chris@sogubsys.com>:
 > The following reply was made to PR kern/53301; it has been noted by GNATS.
 >
 > From: Chris Humphries <chris@sogubsys.com>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 >  same laptop with Windows and Linux.)
 > Date: Wed, 6 Jun 2018 23:47:55 -0400
 >
 >  I applied your patch successfully, but appears nothing has changed on
 >  my end.
 >
 >  Same results with dhcp, dmesg|grep msk, etc.
 >
 >  -Chris
 >

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sat, 16 Jun 2018 16:38:09 +0200

 On Sat, 16 Jun 2018 00:10:01 +0000 (UTC), Jarom=EDr Dolecek wrote:
 > Can you send me ifconfig output? To confirm if at least the PHY now
 >  works, i.e. if the link is now detected.

 Not Chris, but with a Samsung NC10 I am in the same boat (kern/49270),=20
 and eagerly following your commits:

 [hauke@nc10-wi] ~ > dmesg | grep msk
 [   1.0303920] mskc0 at pci2 dev 0 function 0, Yukon-2 FE+ rev. A0=20
 (0x0): ioapic0 pin 18
 [   1.0303920] msk0 at mskc0 port A: Ethernet address 00:13:77:f3:7d:44
 [   1.0303920] msk_jumbo_buf =3D 0xdb665000
 [   1.0303920] makphy0 at msk0 phy 0: Marvell 88E3016 10/100 Fast=20
 Ethernet PHY, rev. 0
 [hauke@nc10-wi] ~ > ifconfig msk0
 msk0: flags=3D0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
 =09ec_capabilities=3D5<VLAN_MTU,JUMBO_MTU>
 =09ec_enabled=3D0
 =09address: 00:13:77:f3:7d:44
 =09media: Ethernet autoselect (none)
 [hauke@nc10-wi] ~ >=20

 Cheerio,
 hauke

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sat, 16 Jun 2018 16:48:11 +0200

 On Sat, 16 Jun 2018 16:38:09 +0200, Hauke Fath wrote:
 > 	media: Ethernet autoselect (none)

 And an 'ifconfig msk0 up' changes this to

 msk0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
 	ec_capabilities=5<VLAN_MTU,JUMBO_MTU>
 	ec_enabled=0
 	address: 00:13:77:f3:7d:44
 	media: Ethernet autoselect (none)
 	status: no carrier
 	inet6 fe80::213:77ff:fef3:7d44%msk0/64 flags 0x8<DETACHED> scopeid 0x2

 -- link lights are off, un-/replugging the cable does not make a 
 difference. Ethernet works fine with a Xubuntu installation.

 Cheerio,
 hauke

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sat, 16 Jun 2018 17:07:32 +0200

 On Sat, 16 Jun 2018 16:48:11 +0200, Hauke Fath wrote:
 > And an 'ifconfig msk0 up' changes this to [...]

 dmesg has

 [ 888.4161199] msk0 jumbo allocation failed -- packet dropped!
 [ 888.4161199] mskc0: interrupt moderation is 1000 us
 [ 888.9864732] msk0 jumbo allocation failed -- packet dropped!
 [ 888.9864732] msk0: link state DOWN (was UNKNOWN)

From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53301 CVS commit: src/sys/dev/mii
Date: Sat, 16 Jun 2018 17:44:53 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Sat Jun 16 17:44:53 UTC 2018

 Modified Files:
 	src/sys/dev/mii: makphy.c
 Added Files:
 	src/sys/dev/mii: e1000phyreg.h
 Removed Files:
 	src/sys/dev/mii: makphyreg.h

 Log Message:
 switch to using OpenBSD eehpy(4) code to drive maphy(4), synchronizing support
 for several special PHY conditions, particularly:
 - Properly re-initialise the PHY upon resume
 - Store next page in the Link Partner Next Page register for compatibility
   with 802.3ab on 88E3016 PHYs.  Fixes some autonegotiation problems on msk(4)
 - Make 88E3016 actually work
 - Make sure page 0 is selected when we initialize the PHY.  Fixes problems
   with the eephy(4) that attaches to nfe(4) on machines like the Sun Ultra 40.
   (we had condition for this, now the page 0 is selected for any PHY type)
 - Disable fiber/copper auto-selection on the 88E1111 if it is in RGMII mode, to
   work around the fact that the onboard PHYs attached to nfe(4) on the Sun
   X4100 M2 have fiber/copper auto-selection enabled even though the interfaces
   are clearly copper-only

 make sure to also add appropriate licenses, since basically nothing
 really significant remains out of previous code

 use FreeBSD <dev/mii/e1000reg.h> for register definitions as a base instead
 of OpenBSD <dev/mii/eephyreg.h>, since it has some extra definitions for some
 3016 bits, but add the several extra bits from OpenBSD needed by the code;
 removed no longed used <dev/mii/makphyreg.h>

 tested with PHY 88E1111, there no particular change observed - the
 link status works as it did before, just now it does media nego
 even before the interface is up

 should however fix 88E3016 support and hence PR kern/49270 and PR kern/53301


 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 src/sys/dev/mii/e1000phyreg.h
 cvs rdiff -u -r1.43 -r1.44 src/sys/dev/mii/makphy.c
 cvs rdiff -u -r1.6 -r0 src/sys/dev/mii/makphyreg.h

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

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Cc: Chris Humphries <chris@sogubsys.com>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sat, 16 Jun 2018 19:52:54 +0200

 I checked in a change to makphy(4) which should address the link
 problem, you need rev. 1.44 for dev/mii/makphy.c. Can you try it out
 and let me know? Send me also ifconfig output.

 It's intedepedant to the patch for if_msk.c. You might want to try
 pristine if_msk.c without the patch.

 Jaromir

 2018-06-15 1:35 GMT+02:00 Chris Humphries <chris@sogubsys.com>:
 > The following reply was made to PR kern/53301; it has been noted by GNATS.
 >
 > From: Chris Humphries <chris@sogubsys.com>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 >  same laptop with Windows and Linux.)
 > Date: Wed, 6 Jun 2018 23:47:55 -0400
 >
 >  I applied your patch successfully, but appears nothing has changed on
 >  my end.
 >
 >  Same results with dhcp, dmesg|grep msk, etc.
 >
 >  -Chris
 >

From: Chris Humphries <chris@sogubsys.com>
To: =?utf-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Thu, 7 Jun 2018 18:16:44 -0400

 OK, I will test it out again soon! Thank you for your diligence :) 
 -- 
 Chris Humphries <chris@sogubsys.com>
 5223 9548 E1DE DE87 F509  1888 8141 8451 6338 DD29

From: Chris Humphries <chris@sogubsys.com>
To: gnats-bugs@NetBSD.org
Cc: jdolecek@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Thu, 7 Jun 2018 23:13:56 -0400

 machine locks up and reboots when i plug in ethernet, also panics and reboots when ethernet not plugged in.

 trying to transfer kernel and dump to another machine also panics and reboots. unsure the cause. have to reinstall back to stable ;)

 think one times was fpu related, but unsure.

 thanks!

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Sun, 17 Jun 2018 19:48:42 +0200

 Is this with the the if_msk.c having applied the previous patch?

 If yes, please try with clean if_msk.c. John Halfpenny already
 reported he get's lockup with my patch.


 Jaromir

 2018-06-08 5:13 GMT+02:00 Chris Humphries <chris@sogubsys.com>:
 > machine locks up and reboots when i plug in ethernet, also panics and reboots when ethernet not plugged in.
 >
 > trying to transfer kernel and dump to another machine also panics and reboots. unsure the cause. have to reinstall back to stable ;)
 >
 > think one times was fpu related, but unsure.
 >
 > thanks!

From: Chris Humphries <chris@sogubsys.com>
To: =?utf-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Fri, 8 Jun 2018 06:59:36 -0400

 On Sun, Jun 17, 2018 at 07:48:42PM +0200, Jaromír Doleček wrote:
 > Is this with the the if_msk.c having applied the previous patch?
 > 

 Totally clean install of 7.1.2, checkout of current, and build of
 current.

 > If yes, please try with clean if_msk.c. John Halfpenny already
 > reported he get's lockup with my patch.
 > 

 I can try again this weekend. Maybe there's something else odd at
 play?

From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53301 CVS commit: src/sys/dev/pci
Date: Mon, 2 Jul 2018 06:03:13 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Mon Jul  2 06:03:13 UTC 2018

 Modified Files:
 	src/sys/dev/pci: if_msk.c if_mskvar.h

 Log Message:
 sync OpenBSD if_msk.c revs 1.66-1.79 skipping framework changes and already
 present changes:
 - Make Yukon-2 FE+ (88E8040, 88E8042) work
 - 88E8057 is a Yukon 2 Ultra 2, and this might make it work on a little
   shiny green box in Japan
 - Prevent null pointer dereference that could happen when we process an RX
   interrupt that was queued while stopping the interface.
 - Remove holdover XMAC II writes/reads inherited from sk as
   they aren't required and cause problems like the 88E8072
   hard locking a system when enabling macsec bypass.
 - Bypass macsec on extreme/supreme based chips.
   Makes my 88E8072 work.
 - Add detach support to a few more drivers, and in others do the neccessary
   operations in the detach function in the right order.

 towards resolution of PR kern/53301 but will need more work

 tested by John Halfpenny on another 8040/Yukon-2 FE+ and reported
 improving behaviour (system hang to stall) so committing as stopgap; also
 tested on my SK-9E22 (Yukon-2 XL), there works without any issues both before
 and after


 To generate a diff of this commit:
 cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_msk.c
 cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_mskvar.h

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

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Mon, 2 Jul 2018 08:10:55 +0200

 I've now committed the (modified) patch. Let me know if you see any
 change of behaviour with if_msk.c rev. 1.67.

 In case of panic, can you get me a backtrace for the panic or at least
 exact message? For the backtrace, one way would be to allow sysctl
 ddb.onpanic, do 'bt' when system gets to ddb if it's not done
 automatically.

 There is one more needed change I'm aware, about re-filling RX queue
 to avoid stalls. I'll do this within couple of days, but until then
 I'd like to confirm if the panics are gone.

 Jaromir

From: =?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?= <jaromir.dolecek@gmail.com>
To: Chris Humphries <chris@sogubsys.com>
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Mon, 2 Jul 2018 08:14:41 +0200

 Err, it was meant to be if_msk.c rev. 1.68.

 Le lun. 2 juil. 2018 =C3=A0 08:10, Jarom=C3=ADr Dole=C4=8Dek
 <jaromir.dolecek@gmail.com> a =C3=A9crit :
 > In case of panic, can you get me a backtrace for the panic or at least
 > exact message? For the backtrace, one way would be to allow sysctl
 > ddb.onpanic, do 'bt' when system gets to ddb if it's not done
 > automatically.

From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53301 CVS commit: src/sys/dev/pci
Date: Tue, 10 Jul 2018 18:32:25 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Tue Jul 10 18:32:25 UTC 2018

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

 Log Message:
 add callout for re-filling RX ring - it's invoked when the RX refill
 code can't get enough buffers; fixes possible stall when the RXSTAT
 interrupt arrives while no buffers are available

 idea from OpenBSD if_msk.c rev. 1.131

 as part of this remove the confusingly commented re-fill code from
 msk_jfree() and instead just invoke the callout if needed; also
 refill in msk_intr() only when running low instead of every RX intr;
 this simplifies the code, and gives small RX performance boost on
 my hardware (6%: ~38 MB/s -> ~40 MB/s)

 tested on SK-9E22 (Yukon-2 XL rev. A3) by me, and 88E8071 (Yukon-2
 Extreme rev. B0) by Jogn Halfpenny; unfortunately still doesn't
 resolve the PR kern/53301 stall


 To generate a diff of this commit:
 cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/if_msk.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/53301 CVS commit: [netbsd-8] src/sys/dev/mii
Date: Thu, 17 Jan 2019 17:23:03 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jan 17 17:23:03 UTC 2019

 Modified Files:
 	src/sys/dev/mii [netbsd-8]: makphy.c makphyreg.h miidevs

 Log Message:
 Pull up the following (requested by msaitoh in ticket #1164):

 	sys/dev/mii/miidevs			1.128, 1.132 (patch)
 	sys/dev/mii/makphy.c			1.43-1.51
 	sys/dev/mii/makphyreg.h 		1.7-1.9

 - miidevs: Add E1000 with model id 0x0006, it exists according to
   OpenBSD rename E1000 model 0x0000 to E1000_0 for consistency.
 - Match 88E1112, 88E1118, 88E1512, 88E3082 and G65G.
 - Match 88E3016 and add some 88E3016 specific code. Fixes part of
   PR kern/49270 and PR kern/53301.
 - Make sure page 0 is selected when we initialize the PHY. Fixes
   problems with the eephy(4) that attaches to nfe(4) on machines like
   the Sun Ultra 40. (we had condition for this, now the page 0 is
   selected for any PHY type)
 - If autonegotiation is not enabled, we need a software reset for the
   settings to take effect in makphy_service().
 - Don't set PSCR_CRS_ON_TX on newer. Those chips have no this bit.
 - Control BMCR_PDOWN for IFM_NONE. Some chips still don't work as
   expected. It would be required to modify PSCR and/or other register.
 - Set mii_media_active correctly on non-autonego mode.
 - Remove obsolete comment.
 - Whitespace fix.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/dev/mii/makphy.c
 cvs rdiff -u -r1.6 -r1.6.20.1 src/sys/dev/mii/makphyreg.h
 cvs rdiff -u -r1.125.6.3 -r1.125.6.4 src/sys/dev/mii/miidevs

 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, jdolecek@NetBSD.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org, chris@sogubsys.com
Cc: msaitoh@execsw.org
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Mon, 21 Jan 2019 14:12:10 +0900

 Hi, Chris.

   Have you tried -current recently? Does this problem still exist?

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

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 same laptop with Windows and Linux.)
Date: Mon, 21 Jan 2019 19:57:38 +0000

 These two mails were never field in gnats.
 (gnats traffic should go to gnats-bugs@; sometimes this needs to be
 set by hand when replying to your own postings)

    ------

 From: Chris Humphries <chris@sogubsys.com>
 To: jdolecek@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 	same laptop with Windows and Linux.)
 Date: Wed, 6 Jun 2018 07:57:30 -0400

 Tried out the new changes you made to msk stuff today, just-in-case
 there was a change, even though you didn't advise me to try. Same
 results, though. 


 NetBSD neo.sogubsys.com 8.99.19 NetBSD 8.99.19 (GENERIC) #1: Tue Jun 12 19:58:27 EDT 2018  root@neo.sogubsys.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64

 [    1.049321] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0): ioapic0 pin 19
 [    1.049321] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 [    1.049321] ukphy0 at msk0 phy 0: OUI 0x000ac2, model 0x0026, rev. 0
 [    7.603052] mskc0: interrupt moderation is 1000 us

    ------

 From: Hauke Fath <hf@spg.tu-darmstadt.de>
 To: netbsd-bugs@NetBSD.org
 Cc: jdolecek@NetBSD.org, gnats-admin@NetBSD.org, chris@sogubsys.com
 Subject: Re: kern/53301 (msk0 device reports no link, when there is link on
 	same laptop with Windows and Linux.)
 Date: Fri, 15 Jun 2018 12:02:51 +0200

 On 06/15/18 03:55, Chris Humphries wrote:
 >   It is attaching the wrong device?
 >
 >   pcictl pci0 list|grep Marvell
 >   -----------------------------
 >   006:00:0: Marvell Yukon 88E8040 (ethernet network)

 [...]

 >   dmesg|grep msk
 >   --------------
 >   [    1.040190] mskc0 at pci3 dev 0 function 0, Yukon-2 FE+ rev. A0 (0x0):
 ioapic0 pin 19
 >   [    1.040190] msk0 at mskc0 port A: Ethernet address 00:24:54:b4:47:c3
 >   [    1.040190] makphy0 at msk0 phy 0: Marvell 88E3016 10/100 Fast Ethernet
 PHY, rev. 0

 This would be the phy, not the ethernet controller, I guess.

 Cheerio,
 hauke

 >   [    7.355489] mskc0: interrupt moderation is 1000 us

State-Changed-From-To: feedback->open
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 27 May 2019 14:42:31 +0000
State-Changed-Why:
Feedback provided. despite a lotof effort from jdolecek, it seems like the last version doesn't work still.


Responsible-Changed-From-To: jdolecek->kern-bug-people
Responsible-Changed-By: jdolecek@NetBSD.org
Responsible-Changed-When: Wed, 20 Jan 2021 21:49:31 +0000
Responsible-Changed-Why:
I did what I could, but can't do further testing since I don't have
the specific msk(4) revision of the hw.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.