Repository navigation
Conversation
troglobit
force-pushed
the
laguna-bug
branch
2 times, most recently
from
October 9, 2026 08:58
012a6e4 to
ddcf690
Compare
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
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.
Every IEEE 802.1AS test on the Tactical 1000 rig fails: the ports stay in the listening state and never exchange Announce, while the same units synchronize fine with the IEEE 1588 profile. ptp4l reports a mean link delay of 1.5 us on these ports. Port statistics show the peer delay exchange running in both directions, but the generated configuration sets neighborPropDelayThresh to the 800 ns of the automotive profile, so neither port becomes asCapable and neither sends Announce. The switch core time stamps behind the PHY, so the delay it measures includes the PHY latency, 1.5 us on a LAN8814 at 1 Gbit/s and more at 100 Mbit/s. Default the threshold to 10 us with hardware time stamping, keep ptp4l's own 20 ms default with software time stamping, and honor mean-link-delay-thresh from the gPTP port data set when set. With 10 us on both ends of the link, the receiver on the rig reaches the time-receiver state within seconds, offset within a few ns. Signed-off-by: Joachim Wiberg <[email protected]>
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 <[email protected]>
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, 0088 to 0090, synced from kkit-linux-6.18.y. Signed-off-by: Joachim Wiberg <[email protected]>
The Link Aggregation test fails on the Tactical 1000 rig at the failure mode check, and every test that uses the aggregate ports after it fails too, until the units are rebooted: tunnels, NTP, PTP, static routing and DHCP between the two units all time out. The bond gives both member ports the address of the first one, and the sparx5 driver keeps one CPU entry per address. Taking one member down forgets the entry the other member still needs, and deleting the aggregate restores the members' own addresses in an order that forgets the first member's entry for good. That port then drops all unicast sent to it until it is disabled and enabled again, which the later tests never do. One kernel patch, 0091, synced from kkit-linux-6.18.y. Same fix as the standalone multicast entries got in 0087: the port addresses share a reference counted list, so an entry is forgotten with its last user. Signed-off-by: Joachim Wiberg <[email protected]>
The LAN969x boards have no MAC address in OTP, so the switch boots with a random base MAC and every port, bridge and link-local address changes on each boot. The Banana Pi BPI-R3 had the same problem and got a product script that hands out base + 1, base + 2 and so on from the VPD base MAC to every port without a hardware address. Move that script to the common rootfs and run it on the Tactical 1000 and the EV23X71A as well. Names are sorted as numbers so e2 comes before e10, and with an interface name as argument the script prints the address that port gets instead of setting it, for confd to restore a port's default address. Signed-off-by: Joachim Wiberg <[email protected]>
A board without a VPD EEPROM can carry its identity in a partition labelled factory, which the Banana Pi BPI-R3 image provides. The Tactical 1000 and the EV23X71A have no such partition, but an aux partition like every Infix disk. Read the ONIE TLV from vpd.onie on the aux partition when neither the device tree nor a factory partition provides a product VPD. Same format, same trust: identity only, never the factory password. Signed-off-by: Joachim Wiberg <[email protected]>
…ent one Removing custom-phys-address from a port on the Tactical 1000 leaves the custom address in place: not ok 5 - Verify target:data MAC address is reset to default The default address is taken from the port's permanent address, which these boards do not have, so the generated ip batch sets none. Fall back to the chassis-derived address the port got at boot, from the macaddr script, when the kernel reports no permanent address. Signed-off-by: Joachim Wiberg <[email protected]>
provision-tactical lays out the aux partition and seeds uboot.env on it, the natural place to also give the unit its identity. Ask for a base MAC address and a serial number and write them as an ONIE TLV to vpd.onie there, which the probe reads as the product VPD. The README documents the file and how to write it on a provisioned unit. Signed-off-by: Joachim Wiberg <[email protected]>
troglobit
marked this pull request as draft
October 12, 2026 13:30
PTP never works on the copper ports of the Tactical 1000. A port
drops to the faulty state on its first Sync:
ptp4l: timed out while polling for tx timestamp
ptp4l: port 1 (e5): MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED)
The PHYs read 0x8804 from the LAN8814 SKU register: they are LAN8804s,
the variant without the 1588 unit, with the same chip ID as a LAN8814.
The 6.18 driver takes them for full LAN8814s, creates a PTP clock per
quad and tells the kernel the PHY can time stamp, so ptp4l waits for a
transmit timestamp the silicon never produces.
Backport mainline 61b7ade9ba8c ("net: phy: micrel: Add support for non
PTP SKUs for lan8814"), patch 0092. It checks the SKU register and
creates no PTP device on these parts, and the kernel then time stamps
them in the switch core on its own. Boards with real LAN8814s, like
the EV23X71A, keep stamping at the PHY.
Signed-off-by: Joachim Wiberg <[email protected]>
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.symregontact1in the rig.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:
0x8804, the LAN8804: a LAN8814 without the 1588 unit and with the same chip ID. 6.18 takes them for full LAN8814s, creates PHY clocks and advertises PHY timestamping that never produces a timestamp, so every PTP port faulted on the first Sync. Backport of mainline 61b7ade9ba8c, which checks the SKU register and creates no PTP device on these parts; the kernel then uses the switch core timestamper for them on its own. Boards with real LAN8814s, the EV23X71A, keep stamping at the PHY. On the EV23X71A those PHY timestamps arrive over MDIO later than the 10 ms ptp4l allows, so confd now allows 100 ms with hardware timestamps.mean-link-delay-threshfrom the gPTP port data set is honored per port. The default matters on the Tactical, where the switch core stamps behind the PHY and the measured link delay is 1.5 µs; on the EV23X71A the PHY stamps at the wire and the delay is a few hundred ns.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 (0088–0090): 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.Shared CPU entries (0087, 0091): list touched only on group join and leave, port up and down, bridge join and leave, and address change, held across the hardware learn/forget so two ports cannot race on the same entry. Lock order is always
mc_cpu_lockthensparx5->lock.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