Index | Thread | Search

From:
Mark Kettenis <mark.kettenis@xs4all.nl>
Subject:
Re: make qwx(4) flush Rx rings when the interface goes down
To:
Stefan Sperling <stsp@stsp.name>
Cc:
tech@openbsd.org
Date:
Fri, 25 Apr 2025 19:17:31 +0200

Download raw body.

Thread
> Date: Fri, 25 Apr 2025 17:22:10 +0200
> From: Stefan Sperling <stsp@stsp.name>
> 
> On Fri, Apr 25, 2025 at 12:23:25AM +0200, Mark Kettenis wrote:
> > Sadly this doesn't fix the panic I'm seeing on the x13s.
> > 
> > What I'm doing to provoke the panic is:
> > 
> > 1. Log in to the machine over ssh
> > 
> > 2. Run 'ifconfig qwx0 down'
> > 
> > 3. Pick up the laptop
> > 
> > 4. Run 'ifconfig qwx0 up'
> > 
> > There seems to be something really fishy going on with bringing the
> > interface down when there are packets in flight...
> 
> Thanks Mark! I could reproduce the crash on Z13 by following your recipe.
> 
> This diff, applied on top of the previous diff, seems to fix it for me.
> Can you confirm?

Yes, that fixes the panic.  Both in the "remote ifconfig down" and
"remote zzz" cases.

However, when suspending the laptop, I see some error messages upon
resume.  The machine recovers and qwx(4) works fine afterwards.  But
it suggests there is still something not quite right with the state
machine?


OpenBSD 7.7-current (GENERIC.MP) #2: Fri Apr 25 20:34:20 CEST 2025
    kettenis@lully.sibelius.xs4all.nl:/home/kettenis/src/qwx2/sys/arch/arm64/compile/GENERIC.MP
real mem  = 16522309632 (15756MB)
avail mem = 15970353152 (15230MB)
random: good seed from bootblocks
mainbus0 at root: Lenovo ThinkPad X13s
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
efi0 at mainbus0: UEFI 2.7
efi0: Lenovo rev 0x1590
smbios0 at efi0: SMBIOS 3.3
smbios0: vendor LENOVO version "N3HET87W (1.59 )" date 12/05/2023
smbios0: LENOVO 21BX0015US
cpu0 at mainbus0 mpidr 0: ARM Cortex-A78C r0p0
cpu0: 32KB 64b/line 4-way L1 PIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 8-way L2 cache
cpu0: 8192KB 64b/line 16-way L3 cache
cpu0: mismatched ID_AA64ISAR1_EL1
cpu0: TS,DP,RDM,Atomic,CRC32,SHA2,SHA1,AES+PMULL,GPA,LRCPC+LDAPUR,APA+EPAC2,DPB,ASID16,PAN+ATS1E1,LO,HPDS,VH,HAFDBS,AT,CSV3,CSV2,RAS,AdvSIMD+HP,FP+HP,SSBS
cpu1 at mainbus0 mpidr 100: ARM Cortex-A78C r0p0
cpu1: 32KB 64b/line 4-way L1 PIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 8-way L2 cache
cpu1: 8192KB 64b/line 16-way L3 cache
cpu2 at mainbus0 mpidr 200: ARM Cortex-A78C r0p0
cpu2: 32KB 64b/line 4-way L1 PIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 8-way L2 cache
cpu2: 8192KB 64b/line 16-way L3 cache
cpu3 at mainbus0 mpidr 300: ARM Cortex-A78C r0p0
cpu3: 32KB 64b/line 4-way L1 PIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 8-way L2 cache
cpu3: 8192KB 64b/line 16-way L3 cache
cpu4 at mainbus0 mpidr 400: ARM Cortex-X1C r0p0
cpu4: 64KB 64b/line 4-way L1 PIPT I-cache, 64KB 64b/line 4-way L1 D-cache
cpu4: 1024KB 64b/line 8-way L2 cache
cpu4: 8192KB 64b/line 16-way L3 cache
cpu5 at mainbus0 mpidr 500: ARM Cortex-X1C r0p0
cpu5: 64KB 64b/line 4-way L1 PIPT I-cache, 64KB 64b/line 4-way L1 D-cache
cpu5: 1024KB 64b/line 8-way L2 cache
cpu5: 8192KB 64b/line 16-way L3 cache
cpu6 at mainbus0 mpidr 600: ARM Cortex-X1C r0p0
cpu6: 64KB 64b/line 4-way L1 PIPT I-cache, 64KB 64b/line 4-way L1 D-cache
cpu6: 1024KB 64b/line 8-way L2 cache
cpu6: 8192KB 64b/line 16-way L3 cache
cpu7 at mainbus0 mpidr 700: ARM Cortex-X1C r0p0
cpu7: 64KB 64b/line 4-way L1 PIPT I-cache, 64KB 64b/line 4-way L1 D-cache
cpu7: 1024KB 64b/line 8-way L2 cache
cpu7: 8192KB 64b/line 16-way L3 cache
qcscm0 at mainbus0
"reserved-region" at mainbus0 not configured
"cmd-db-region" at mainbus0 not configured
"reserved-region" at mainbus0 not configured
qcsmem0 at mainbus0
"reserved-region" at mainbus0 not configured
"reserved-region" at mainbus0 not configured
"reserved-region" at mainbus0 not configured
"adsp-region" at mainbus0 not configured
"cdsp0-region" at mainbus0 not configured
"cdsp1-region" at mainbus0 not configured
"reserved-region" at mainbus0 not configured
"gpu-mem" at mainbus0 not configured
"linux,cma" at mainbus0 not configured
apm0 at mainbus0
"clocks" at mainbus0 not configured
"firmware" at mainbus0 not configured
"interconnect-aggre1-noc" at mainbus0 not configured
"interconnect-aggre2-noc" at mainbus0 not configured
"interconnect-clk-virt" at mainbus0 not configured
"interconnect-config-noc" at mainbus0 not configured
"interconnect-dc-noc" at mainbus0 not configured
"interconnect-gem-noc" at mainbus0 not configured
"interconnect-lpass-ag-noc" at mainbus0 not configured
"interconnect-mc-virt" at mainbus0 not configured
"interconnect-mmss-noc" at mainbus0 not configured
"interconnect-nspa-noc" at mainbus0 not configured
"interconnect-nspb-noc" at mainbus0 not configured
"interconnect-system-noc" at mainbus0 not configured
"opp-table-cpu0" at mainbus0 not configured
"opp-table-cpu4" at mainbus0 not configured
"opp-table-qup100mhz" at mainbus0 not configured
"pmu" at mainbus0 not configured
qcsmptp0 at mainbus0
qcsmptp1 at mainbus0
qcsmptp2 at mainbus0
simplebus0 at mainbus0: "soc"
qcmtx0 at simplebus0
syscon0 at simplebus0: "syscon"
qcgpio0 at simplebus0
agintc0 at simplebus0 shift 4:4 nirq 992 nredist 8 ipi: 0, 1, 2: "interrupt-controller"
agintcmsi0 at agintc0
"clock-controller" at simplebus0 not configured
qcipcc0 at simplebus0
"efuse" at simplebus0 not configured
simplebus1 at simplebus0: "geniqup"
qciic0 at simplebus1
iic0 at qciic0
ihidev0 at iic0 addr 0x15 irq, vendor 0x4f3 product 0x3193, hid-over-i2c
ihidev0: 92 report ids
imt0 at ihidev0: clickpad, 5 contacts
wsmouse0 at imt0 mux 0
ims0 at ihidev0 reportid 1: 2 buttons
wsmouse1 at ims0 mux 0
hid at ihidev0 reportid 5 not configured
hid at ihidev0 reportid 6 not configured
hid at ihidev0 reportid 7 not configured
hid at ihidev0 reportid 11 not configured
hid at ihidev0 reportid 12 not configured
hid at ihidev0 reportid 13 not configured
ims1 at ihidev0 reportid 14: 0 buttons
wsmouse2 at ims1 mux 0
hid at ihidev0 reportid 92 not configured
ihidev1 at iic0 addr 0x2c, failed fetching initial HID descriptor
ihidev2 at iic0 addr 0x68 irq, vendor 0x4f3 product 0xd, hid-over-i2c
ihidev2: 11 report ids
ims2 at ihidev2 reportid 1: 3 buttons
wsmouse3 at ims2 mux 0
ikbd0 at ihidev2 reportid 8: 8 variable keys, 6 key codes
wskbd0 at ikbd0: console keyboard
icc0 at ihidev2 reportid 9: 573 usages, 20 keys, array
wskbd1 at icc0 mux 1
hid at ihidev2 reportid 10 not configured
hid at ihidev2 reportid 11 not configured
simplebus2 at simplebus0: "geniqup"
"serial" at simplebus2 not configured
qciic1 at simplebus2
iic1 at qciic1
"elan,ekth5015m" at iic1 addr 0x10 not configured
simplebus3 at simplebus0: "geniqup"
qciic2 at simplebus3
iic2 at qciic2
"qcom,pm8008" at iic2 addr 0xc not configured
qcrng0 at simplebus0
dwpcie0 at simplebus0
"phy" at simplebus0 not configured
dwpcie1 at simplebus0
"phy" at simplebus0 not configured
"gpu" at simplebus0 not configured
"gmu" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
smmu0 at simplebus0: disabled
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
qcpas0 at simplebus0
"rxmacro" at simplebus0 not configured
"soundwire" at simplebus0 not configured
"txmacro" at simplebus0 not configured
"codec" at simplebus0 not configured
"soundwire" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
"soundwire" at simplebus0 not configured
"codec" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"phy" at simplebus0 not configured
"pmu" at simplebus0 not configured
"pmu" at simplebus0 not configured
"system-cache-controller" at simplebus0 not configured
qcdwusb0 at simplebus0: "usb"
xhci0 at qcdwusb0, xHCI 1.10
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
qcdwusb1 at simplebus0: "usb"
xhci1 at qcdwusb1, xHCI 1.10
usb1 at xhci1: USB revision 3.0
uhub1 at usb1 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
"cci" at simplebus0 not configured
"camss" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
"display-subsystem" at simplebus0 not configured
"phy" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
qcpdc0 at simplebus0
qctsens0 at simplebus0
qctsens1 at simplebus0
qctsens1: missing phandle on node
qctsens2 at simplebus0
"restart" at simplebus0 not configured
qctsens3 at simplebus0
qcaoss0 at simplebus0
"sram" at simplebus0 not configured
qcspmi0 at simplebus0
qcpmic0 at qcspmi0 sid 0x0
qcpon0 at qcpmic0
qcrtc0 at qcpmic0
qcsdam0 at qcpmic0
qcpmic1 at qcspmi0 sid 0x1
qcpmicgpio0 at qcpmic1
qcpmic2 at qcspmi0 sid 0x2
qcpmicgpio1 at qcpmic2
qcpwm0 at qcpmic2
qcpmic3 at qcspmi0 sid 0x3
qcpmicgpio2 at qcpmic3
qcpmic4 at qcspmi0 sid 0x4
qcpmicgpio3 at qcpmic4
smmu1 at simplebus0: disabled
"watchdog" at simplebus0 not configured
"timer" at simplebus0 not configured
"rsc" at simplebus0 not configured
"interconnect" at simplebus0 not configured
qccpu0 at simplebus0
"remoteproc" at simplebus0 not configured
pci0 at dwpcie0
ppb0 at pci0 dev 0 function 0 "Qualcomm SC8280XP PCIe" rev 0x00: msi
pci1 at ppb0 bus 1
qwx0 at pci1 dev 0 function 0 "Qualcomm QCNFA765" rev 0x01: msi
pci2 at dwpcie1
ppb1 at pci2 dev 0 function 0 "Qualcomm SC8280XP PCIe" rev 0x00: msi
pci3 at ppb1 bus 1
nvme0 at pci3 dev 0 function 0 "Union Memory AM630" rev 0x03: msix, NVMe 1.3
nvme0: UMIS RPJTJ512MGE1QDQ, firmware 1.5Q0630, serial SS0L25210X8RC25E22LF
scsibus0 at nvme0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <NVMe, UMIS RPJTJ512MGE, 1.5Q>
sd0: 488386MB, 512 bytes/sector, 1000215216 sectors
"sound" at mainbus0 not configured
agtimer0 at mainbus0: 19200 kHz
"audio-codec" at mainbus0 not configured
pwmbl0 at mainbus0
gpiokeys0 at mainbus0
gpioleds0 at mainbus0: "indicator"
"pmic-glink" at mainbus0 not configured
"regulator-edp-3p3" at mainbus0 not configured
"regulator-edp-bl" at mainbus0 not configured
"regulator-misc-3p3" at mainbus0 not configured
"regulator-nvme" at mainbus0 not configured
"regulator-vph-pwr" at mainbus0 not configured
"regulator-wlan" at mainbus0 not configured
"regulator-wwan" at mainbus0 not configured
"usb0-sbu-mux" at mainbus0 not configured
"usb1-sbu-mux" at mainbus0 not configured
"wcn6855-pmu" at mainbus0 not configured
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (daa1532ebc14b920.a) swap on sd0b dump on sd0b
qcpas0: all intents in use
qwx0: wcn6855 hw2.1 fw 0x11088c35 address 00:03:7f:12:7a:c1
simplefb0 at mainbus0: 1920x1200, 32bpp
wsdisplay0 at simplefb0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
uhub0 detached
uhub1 detached
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
uhub1 at usb1 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
qwx0: scan stop timeout
qwx0: failed to abort scan: 35
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: idle (0)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan completed event in an invalid scan state: idle (0)
qwx0: peer create command timeout
qwx0: Failed to add peer: 6c:71:d9:cd:39:76 for VDEV: 0
qwx0: scan stop timeout
qwx0: failed to abort scan: 35
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan foreign chan event in an invalid scan state: starting (1)
qwx0: received chan info event without a scan request, ignoring
qwx0: received scan completed event in an invalid scan state: starting (1)