Repository navigation
Conversation
Sync patches with kkit-linux-6.18.y, adding a fix for a "scheduling while atomic" BUG on LAN969x when a multicast address is added to or removed from an unbridged switch port. Seen on Tactical 1000 when IPv6 DAD re-ran after a link flap. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Refreshing the patch series for the current kernel version removed the patches it had just regenerated, since the script always ran the upgrade steps: kernel-refresh.sh -k ~/src/linux -t v6.18.55 -o 6.18.55 With -o equal to the new version, the rm of the old patch directory hit the new one. Without -o it was worse, patches/linux/ itself went. Skip the directory removal, defconfig bump and tarball checksum when no old version is given or it matches the new one. A plain refresh also no longer downloads the kernel tarball. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
RAUC cannot read the boot state on a Tactical 1000 laid out with provision-tactical: rauc: Failed to get boot state of 'rootfs.0': uboot backend: fw_printenv failed with exit code: 1 # fw_printenv Cannot open /mnt/aux/uboot.env: No such file or directory The script creates the aux filesystem but never writes uboot.env, which the stock image gets from image-itb-aux and a regular install from prod/provision. Write it the same way, with the default BOOT_ORDER and one boot attempt per slot. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The minimal builds drop bash, and BusyBox ash does not read /etc/bash.bashrc even when started as /bin/bash, so the log and follow helpers were gone from the shell there. Move them to /etc/profile.d/log.sh as plain sh functions, read by both ash and bash login shells, including the CLI shell command. The bash completions for them stay in bash.bashrc. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Sync patches with kkit-linux-6.18.y, adding Microchip's symreg debugfs driver from their BSP kernel. It exposes /sys/kernel/debug/symreg/mem, through which the symreg tool reads and writes LAN969x switch registers by name. Needed to debug the management port lockups on Tactical 1000. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The management port on Tactical 1000 locks up now and then, and the only way to see what the switch is doing is to read its registers. Add Microchip's symreg tool, which reads and writes LAN969x registers by symbolic name and dumps the MAC, VLAN, VCAP and stream tables, via the symreg debugfs driver added with patch 0080. The package enables the driver in the kernel, and each Laguna board selects the package and carries the device tree node in its Infix overlay. Builds without a Laguna board never see it. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The shared Laguna directory had no README. Describe what it holds, what a new Laguna board needs for the symreg tool, and how to use the tool to chase a port fault, with the management port as the example. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Sync patches with kkit-linux-6.18.y. On LAN969x, taking any standalone port down, or adding it to a bridge, removed the multicast MAC table entries it shared with every other standalone port. The management port then dropped IPv6 all-nodes and mDNS traffic until cycled, which is how it disappeared from ixll and the test rig. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The IP address of a bridge is unreachable from the bridge ports on the LAN969x boards, while forwarding between the ports works. Every bridge test on the Tactical 1000 rig fails on this. The sparx5 driver stands in hardware VLAN 1 for a VLAN-unaware bridge, and confd creates bridges with vlan_default_pvid 0, which adds VLAN 1 at creation and removes it right after. That forgets the VLAN 1 broadcast entry, so ARP from the ports never reaches the CPU, and the bridge MAC entry, so unicast to the bridge is flooded to the ports. Taking a bridged port down also forgets its MAC on the bridge VLAN, which cuts the bridge off whenever its first port, whose MAC the bridge uses, is disabled. Three kernel patches, 0082 to 0084, synced from kkit-linux-6.18.y. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
PTP ports on the EV23X71A copper ports drop to the faulty state a few seconds after reaching master or slave: ptp4l: timed out while polling for tx timestamp ptp4l: port 1 (e20): send sync failed ptp4l: port 1 (e20): MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) The LAN8814 PHYs on the board do the timestamping, and the kernel picks them over the switch core as timestamp provider. The PHY returns the transmit timestamp from its interrupt handler over MDIO, a bus shared by 25 PHYs and polled by phylib, so it sometimes takes longer than the 10 ms ptp4l waits by default. Set tx_timestamp_timeout to 100 ms in the generated ptp4l configuration whenever hardware timestamping is used. On the EV23X71A, 20 ms already clears every fault, and a MAC timestamper answers within microseconds, so the extra headroom costs nothing. This covers any port that ends up timestamping in a PHY. The Laguna ports move to the switch clock in the next commit, which the Tactical 1000 needs since its PHY timestamps never arrive at all.
PTP ports on the Tactical 1000 drop to the faulty state within half a second of becoming master, with the 100 ms transmit timestamp allowance in place, so every PTP test on the rig still fails: ptp4l: port 1 (e5): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l: port 1 (e5): MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) The LAN8814 PHYs ask to be the default time stamp provider, and the kernel grants it, so each copper port time stamps with its quad PHY's clock, /dev/ptp1 to /dev/ptp6, instead of the switch core's. On the EV23X71A those timestamps arrive late; on the Tactical 1000 they do not arrive at all. Beyond that, a boundary or transparent clock spanning two quads runs on two clocks, and the TSN schedules of the switch core follow its own clock, which PTP then never disciplines. Select the PTP hardware clock of the interface's own device for every port of an instance, when one exists, before writing the ptp4l configuration. The kernel keeps that selection across link down and up. With the switch clock, e5 on the Tactical 1000 stays master and the switch's PTP interrupt starts delivering the transmit timestamps. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes and debug aids for the Laguna (LAN969x) boards, found while bringing the Tactical 1000 into the new test system.
Kernel, synced from kkit-linux-6.18.y:
vlan_default_pvid 0, which adds VLAN 1 at creation and removes it right after. That forgot the VID 1 broadcast entry, so ARP from the ports never reached the CPU, and the bridge MAC entry, so unicast to the bridge was flooded to the ports. A third fix stops the driver from forgetting a bridged port's MAC on link down, which cut the bridge off whenever its first port, whose MAC the bridge uses, was disabled. Traced withsymregon the EV23X71A.ixlland the test rig until the port was cycled. Fixed by reference counting the shared entries.ndo_set_rx_moderuns undernetif_addr_lock_bh, and the MAC table access took a mutex. Now a spinlock with an atomic poll, as lan966x does. Upstream fixed it via the newndo_set_rx_mode_async, which 6.18 does not have.Infix side:
alphain the rig: no faults, switch PTP interrupts delivering the timestamps.symregpackage, selected by the Laguna boards, with the device tree node in each board's Infix overlay. Usage notes, including how to chase a port fault, inboard/aarch64/microchip-lan969x/README.md.aarch64_minimal_defconfiglacked the Tactical 1000, EV23X71A and Vero W6m board packages, so PR CI images had no DTB for them and hung afterStarting kernel ....provision-tacticaldid not seeduboot.env, so RAUC could not read any boot state on provisioned units.kernel-refresh.shdeleted the patch directory it had just regenerated when run for the current kernel version.logandfollowmoved to/etc/profile.d/, so they work in BusyBox ash on minimal builds too.Risk analysis
Bridge fixes (0082–0084): the VID 1 broadcast entry is now permanent, like the VID 0 one for standalone ports. Standalone ports never classify to VID 1 and
PGID_BCASTholds only bridged ports, so it is inert without a bridge. The shared-entry count only covers entries the driver installed itself (locked); auto-learned entries behave as before. Skipping learn and forget on up/down for bridged ports leaves those entries to the bridge FDB notifications the driver already handles; join still forgets the standalone entry and leave still restores it. Upstream has the same three bugs, hidden by the defaultvlan_default_pvid 1.Lock conversion (0079): nothing sleeps or takes another lock under
sparx5->lock, it nests inside the mutexes and never the reverse, and every caller is process context; the atomic switchdev notifier defers FDB work and never touches the MAC table. A softirq caller would already have been taking a mutex from softirq, so the spinlock tolerates exactly the contexts the mutex had to. Same fix lan966x took in 77bdaf39f3c8. Only behaviour change: a wedged MAC table command busy-waits up to 100 ms instead of sleeping.Multicast fix (0081): list touched only on group join and leave, held across the hardware learn/forget so two ports cannot race on the same entry. Lock order is always
mc_cpu_lockthensparx5->lock. Unicast addresses learned per port have the same shape if two standalone ports share a MAC; left for a follow-up, and not a configuration Infix produces.symreg: debugfs only, root only; the driver never probes without its device tree node, so it is inert on non-Laguna boards. The tool bypasses the driver when writing, documented in the README.
Checklist
Tick relevant boxes, this PR is-a or has-a:
🤖 Generated with Claude Code