Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe



> On Jun 29, 2021, at 4:35 PM, Björn Johannesson  wrote:
> 
> Hello and thanks again for looking into this. I really appreciate it.

No problem.  It’s all of my MII / ifmedia locking changes that probably broke 
it in the first place :-)

> We have some progress. The patch compiles after fixing two typos.
> Two instances of one struct too many
> struct struct dp8390_softc *sc = arg;

Fixed! :-)

> # ifconfig ne2
> ne2: flags=0x8802 mtu 1500
> ec_capabilities=0x1
> ec_enabled=0
> address: 00:0d:88:40:68:0e
> # dhcpcd ne2
> dhcpcd-9.4.0 starting
> DUID 00:01:00:01:1a:14:11:b8:00:0d:88:40:68:0e
> ne2: waiting for carrier
> ne2: carrier unknown, assuming up
> ne2: IAID 88:40:68:0e
> ne2: adding address fe80::53b7:6ccf:4e12:3fb7
> ne2: carrier lost - roaming
> ne2: carrier lost - roaming
> ne2: soliciting an IPv6 router
> ne2: carrier acquired
> ne2: IAID 88:40:68:0e
> ne2: soliciting an IPv6 router
> ne2: soliciting a DHCP lease
> ne2: offered 192.168.1.32 from 192.168.1.1
> ne2: leased 192.168.1.32 for 1800 seconds
> ne2: adding route to 192.168.1.0/24
> ne2: adding default route via 192.168.1.1
> forked to background, child pid 854
> # 
> 
> I don't remember at the top of my head if it acted like this in re: carrier 
> previously but it gets there in the end.

Ok, that’s good.

> However there is still no detach event for when its been unused.

That I have no idea what’s going on.  Let’s get the interface more-or-less 
working first, then we can dive into the CardBus code.

> And when detaching a used card it still crashes.
> 
> # dhcpcd -k ne2
> sending signal ALRM to pid 854
> waiting for pid 854 to exit
> # Jun 29 00:05:35 abbie dhcpcd[851]: ps_root_log: Connection reset by peer
> route flush
> # ifconfig ne2
> ne2: flags=0x8843 mtu 1500
> ec_capabilities=0x1
> ec_enabled=0
> address: 00:0d:88:40:68:0e
> status: active
> # <--- detach here
> [ 279.3474089] nsphyter0: detached
> [ 279.3838727] ne2: detached
> [ 279.8574170] panic: kernel diagnostic assertion "mii_locked(mii)" failed: 
> file "../../../../dev/mii/mii.c", line 342 

Oops.  Adding a "callout_stop(&sc->sc_tick_ch);” before the mii_detach() call 
should fix that.

New composite patch:

https://www.netbsd.org/~thorpej/dp8390-assert-patch-v4.txt

-- thorpej



daily CVS update output

2021-06-29 Thread NetBSD source update


Updating src tree:
P src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S
P src/distrib/sets/lists/man/mi
P src/distrib/sets/lists/tests/mi
P src/doc/CHANGES
P src/etc/MAKEDEV.tmpl
P src/external/cddl/osnet/sys/sys/vnode.h
P src/external/gpl3/gcc.old/dist/gcc/config.host
P src/lib/libc/arch/arm/gen/swapcontext.S
P src/lib/libc/arch/arm/sys/__clone.S
P src/lib/libpci/Makefile
P src/share/man/man4/Makefile
P src/share/man/man4/ddb.4
P src/share/man/man4/lagg.4
P src/share/man/man4/usb.4
cvs update: `src/share/man/man4/uscanner.4' is no longer in the repository
P src/share/man/man4/usscanner.4
P src/share/man/man9/errno.9
P src/share/man/man9/vnsubr.9
P src/sys/arch/aarch64/conf/majors.aarch64
P src/sys/arch/algor/conf/P4032
P src/sys/arch/algor/conf/P5064
P src/sys/arch/algor/conf/P6032
P src/sys/arch/algor/conf/majors.algor
P src/sys/arch/alpha/conf/GENERIC
P src/sys/arch/alpha/conf/majors.alpha
P src/sys/arch/amd64/conf/ALL
P src/sys/arch/amd64/conf/XEN3_DOM0
P src/sys/arch/amd64/conf/majors.amd64
P src/sys/arch/arm/amlogic/gxlphy.c
P src/sys/arch/arm/conf/majors.arm32
P src/sys/arch/cats/conf/GENERIC
P src/sys/arch/cobalt/conf/majors.cobalt
P src/sys/arch/epoc32/conf/majors.epoc32
P src/sys/arch/evbarm/conf/HDL_G
P src/sys/arch/evbarm/conf/HPT5325
P src/sys/arch/evbarm/conf/MINI2440
P src/sys/arch/evbarm/conf/MMNET_GENERIC
P src/sys/arch/evbarm/conf/MPCSA_GENERIC
P src/sys/arch/evbarm/conf/POGO
P src/sys/arch/evbarm/conf/SHEEVAPLUG
P src/sys/arch/evbarm/conf/SMDK2410
P src/sys/arch/evbarm/conf/TS7200
P src/sys/arch/evbarm/conf/TWINTAIL
P src/sys/arch/evbarm/conf/std.hdl_g
P src/sys/arch/evbmips/conf/majors.evbmips
P src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT
P src/sys/arch/evbppc/conf/PMPPC
P src/sys/arch/evbppc/conf/majors.evbppc
P src/sys/arch/hpcarm/conf/majors.hpcarm
P src/sys/arch/hpcmips/conf/GENERIC
P src/sys/arch/hpcmips/conf/TX3922
P src/sys/arch/hpcmips/conf/VR41XX
P src/sys/arch/hpcmips/conf/majors.hpcmips
P src/sys/arch/hppa/conf/GENERIC
P src/sys/arch/i386/conf/ALL
P src/sys/arch/i386/conf/XEN3PAE_DOM0
P src/sys/arch/i386/conf/majors.i386
P src/sys/arch/ia64/conf/majors.ia64
P src/sys/arch/landisk/conf/GENERIC
P src/sys/arch/landisk/conf/majors.landisk
P src/sys/arch/ofppc/conf/GENERIC
P src/sys/arch/or1k/conf/majors.or1k
P src/sys/arch/playstation2/conf/DEBUG
P src/sys/arch/playstation2/conf/majors.playstation2
P src/sys/arch/powerpc/conf/majors.powerpc
P src/sys/arch/prep/conf/GENERIC
P src/sys/arch/sandpoint/conf/GENERIC
P src/sys/arch/sgimips/conf/majors.sgimips
P src/sys/arch/sparc64/conf/majors.sparc64
P src/sys/arch/x68k/conf/GENERIC
P src/sys/arch/x68k/conf/majors.x68k
P src/sys/arch/zaurus/conf/majors.zaurus
P src/sys/coda/coda_vnops.c
P src/sys/conf/majors.usb
P src/sys/dev/DEVNAMES
P src/sys/dev/dev_verbose.c
P src/sys/dev/dev_verbose.h
P src/sys/dev/devlist2h.awk
P src/sys/dev/firmload.c
P src/sys/dev/fss.c
P src/sys/dev/kloader.c
P src/sys/dev/vnd.c
P src/sys/dev/hdaudio/hdaudio.c
P src/sys/dev/hdaudio/hdaudiodevs.h
P src/sys/dev/hdaudio/hdaudiodevs_data.h
P src/sys/dev/mii/Makefile.miidevs
cvs update: `src/sys/dev/mii/devlist2h.awk' is no longer in the repository
P src/sys/dev/mii/gentbi.c
P src/sys/dev/mii/mii_physubr.c
P src/sys/dev/mii/mii_verbose.c
P src/sys/dev/mii/mii_verbose.h
P src/sys/dev/mii/miidevs.h
P src/sys/dev/mii/miidevs_data.h
P src/sys/dev/mii/miivar.h
P src/sys/dev/mii/ukphy.c
P src/sys/dev/pci/pci_subr.c
P src/sys/dev/pci/pcidevs.h
P src/sys/dev/pci/pcidevs_data.h
P src/sys/dev/pci/ixgbe/ixgbe.c
P src/sys/dev/usb/FILES
P src/sys/dev/usb/TODO.usbmp
P src/sys/dev/usb/files.usb
P src/sys/dev/usb/usbdevices.config
P src/sys/dev/usb/usbdevs.h
P src/sys/dev/usb/usbdevs_data.h
cvs update: `src/sys/dev/usb/uscanner.c' is no longer in the repository
P src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S
P src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S
P src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S
P src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S
P src/sys/fs/adosfs/advnops.c
P src/sys/fs/autofs/autofs_vnops.c
P src/sys/fs/cd9660/cd9660_vnops.c
P src/sys/fs/efs/efs_vnops.c
P src/sys/fs/filecorefs/filecore_vnops.c
P src/sys/fs/hfs/hfs_vnops.c
P src/sys/fs/msdosfs/msdosfs_vnops.c
P src/sys/fs/nilfs/nilfs_vnops.c
P src/sys/fs/ntfs/ntfs_vnops.c
P src/sys/fs/ptyfs/ptyfs_vnops.c
P src/sys/fs/puffs/puffs_vnops.c
P src/sys/fs/sysvbfs/sysvbfs.c
P src/sys/fs/tmpfs/tmpfs_fifoops.c
P src/sys/fs/tmpfs/tmpfs_specops.c
P src/sys/fs/tmpfs/tmpfs_vnops.c
P src/sys/fs/udf/udf_vnops.c
P src/sys/fs/union/union_vnops.c
P src/sys/fs/unionfs/unionfs_subr.c
P src/sys/fs/unionfs/unionfs_vnops.c
P src/sys/fs/v7fs/v7fs_extern.c
P src/sys/kern/kern_acct.c
P src/sys/kern/kern_core.c
P src/sys/kern/kern_descrip.c
P src/sys/kern/kern_ktrace_vfs.c
P src/sys/kern/kern_module_vfs.c
P src/sys/kern/subr_exec_fd.c
P src/sys/kern/subr_kobj_vfs.c
P src/sys/kern/tty_ptm.c
P src/sys/kern/vfs_getcwd.c
P src/sys/kern/vfs_lookup.c
P src/sys/k

Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe


> On Jun 29, 2021, at 1:11 PM, Jason Thorpe  wrote:
> 
> 
> 
>> On Jun 29, 2021, at 9:50 AM, Jason Thorpe  wrote:
>> 
>> I’ll see if I can figure out the link change problem later.
> 
> Ok, I think I see what’s wrong with the link change problem.  Hold.

The combined diff (again, not even compile tested, so you might have to tweak a 
few things) should address both crashes and the link issue that affects dhcpcd.

https://www.netbsd.org/~thorpej/dp8390-assert-patch-v3.txt

-- thorpej



Re: linux emul and newer glibc

2021-06-29 Thread Manuel Bouyer
On Mon, Jun 28, 2021 at 08:15:29AM +0900, Rin Okuyama wrote:
> Hi,
> 
> On 2021/06/28 2:40, Manuel Bouyer wrote:
> > Hello,
> > I'm trying to run a binary which wants GLIBCXX_3.4.21, while with the suse
> > packages we have GLIBCXX_3.4.19. Before I try grabbing newer libraries,
> > has anyone tried to run linux binaries with more recent libraries ?
> 
> For my amd64 machine, GLIBCXX_3.4.28 (from glibc 2.32) works just fine,
> which is extracted manually from Fedora 33 by pkgsrc/pkgtools/rpm2pkg.

indeed it works for me too. Now I need to make it not choke on udev errors ...

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe



> On Jun 29, 2021, at 9:50 AM, Jason Thorpe  wrote:
> 
> I’ll see if I can figure out the link change problem later.

Ok, I think I see what’s wrong with the link change problem.  Hold.

-- thorpej



Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe


> On Jun 29, 2021, at 9:31 AM, Jason Thorpe  wrote:
> 
>> Oh, I see what’s happening here… ifmedia_fini() is being called twice.  Let 
>> me see if I can de-tangle this quickly.
> 
> Oh, actually, ifmedia_fini() is being called on an ifmedia structure that was 
> never initialized or used.  Sigh, the dp8390 driver is kind of a mess in this 
> regard.

Nope, I was right the first time :-). Super easy fix for that one:

https://www.netbsd.org/~thorpej/dp8390-assert-patch-v2.txt

(Includes previous changes, too.)

That should fix the detach panic.  I’ll see if I can figure out the link change 
problem later.  (Going to be AFK again for a while…)

-- thorpej



Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe


> On Jun 29, 2021, at 9:29 AM, Jason Thorpe  wrote:
> 
>> On Jun 27, 2021, at 1:35 PM, Björn Johannesson  wrote:
>> 
>> Removing the card once it has been up and downed panics the kernel.
>> 
>> [ 1567.2547189] uvm_fault(0xc158f1e0, 0, 2) -> 0xe
>> [ 1567.3087962] fatal page fault in supervisor mode
>> [ 1567.3639110] trap type 6 code 0x2 eip 0xc011808e cs 0x8 eflags 0x10246 
>> cr2 0 ilevel 0 esp 0xc0dc35da
>> [ 1567.4731053] curlwp 0xc2329980 pid 0 lid 25 lowest kstack 0xd8a142c0
>> kernel: supervisor trap page fault, code=0
>> Stopped in pid 0.25 (system) at netbsd:mutex_enter+0xe: cmpxchgl %ecx,0(%
>> edx)
>> db{0}> bt
>> mutex_enter(c23fba44,,0,c23fb800,c23fb80c,c23fba44,d8a16ee0,c0590957,c23
>> fba44,c23fb800) at netbsd:mutex_enter+0xe
>> ifmedia_fini(c23fba44,c23fb800,c23c7200,d8a16f00,c0390c24,c23fb800,1,c2329980,c2
> 
> Oh, I see what’s happening here… ifmedia_fini() is being called twice.  Let 
> me see if I can de-tangle this quickly.

Oh, actually, ifmedia_fini() is being called on an ifmedia structure that was 
never initialized or used.  Sigh, the dp8390 driver is kind of a mess in this 
regard.

-- thorpej



Re: Pcmcia ne(4)/mii crash in -current

2021-06-29 Thread Jason Thorpe


> On Jun 27, 2021, at 1:35 PM, Björn Johannesson  wrote:
> 
> Removing the card once it has been up and downed panics the kernel.
> 
> [ 1567.2547189] uvm_fault(0xc158f1e0, 0, 2) -> 0xe
> [ 1567.3087962] fatal page fault in supervisor mode
> [ 1567.3639110] trap type 6 code 0x2 eip 0xc011808e cs 0x8 eflags 0x10246 cr2 
> 0 ilevel 0 esp 0xc0dc35da
> [ 1567.4731053] curlwp 0xc2329980 pid 0 lid 25 lowest kstack 0xd8a142c0
> kernel: supervisor trap page fault, code=0
> Stopped in pid 0.25 (system) at netbsd:mutex_enter+0xe: cmpxchgl %ecx,0(%
> edx)
> db{0}> bt
> mutex_enter(c23fba44,,0,c23fb800,c23fb80c,c23fba44,d8a16ee0,c0590957,c23
> fba44,c23fb800) at netbsd:mutex_enter+0xe
> ifmedia_fini(c23fba44,c23fb800,c23c7200,d8a16f00,c0390c24,c23fb800,1,c2329980,c2

Oh, I see what’s happening here… ifmedia_fini() is being called twice.  Let me 
see if I can de-tangle this quickly.

-- thorpej