From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<hkallweit1@gmail.com>, <linux@armlinux.org.uk>
Cc: <netdev@vger.kernel.org>, <UNGLinuxDriver@microchip.com>,
<linux-kernel@vger.kernel.org>,
Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Subject: [PATCH net-next 0/3] net: microchip_t1s: fix collision detection on PLCA status change
Date: Tue, 1 Sep 2026 18:39:45 +0530 [thread overview]
Message-ID: <20260901130948.212914-1-parthiban.veerasooran@microchip.com> (raw)
In a 10BASE-T1S multidrop network, when PLCA mode is configured, the PHY
autonomously transitions between PLCA mode and CSMA/CD mode based on
BEACON availability, without any further user action. The existing
collision detection logic only adjusted on explicit ethtool PLCA
configuration changes, leaving it in the wrong state across these
autonomous mode transitions.
This series fixes that gap, wires up the complete interrupt path, and
improves collision detection handling for LAN867X Rev.D0.
Patch 1 fixes the collision detection handling in the PHY driver. It adds
the PLCA Status Changed (PSTC) interrupt handler for LAN86XX PHYs. On
each PSTC interrupt, the PLCA operational status is checked and collision
detection is adjusted accordingly: disabled when PLCA is online,
re-enabled when PLCA goes offline to restore correct CSMA/CD operation.
The interrupt handler uses a conditional assignment pattern without early
returns for better extensibility. The existing static CDEN write in
lan86xx_plca_set_cfg() is retained as a baseline for PHYs running with
phydev->irq == PHY_POLL on boards where the PHY interrupt is not routed
to the host. PHYs with routed interrupts (including LAN865X and LAN867X
with interrupt support) skip the static write since the interrupt handler
handles CDEN dynamically.
Patch 2 delivers the in-band PHY interrupt to phylib from the 10BASE-T1S
MAC-PHY SPI driver. The integrated PHY has no dedicated interrupt line;
its interrupt arrives as the PHYINT bit in the MAC-PHY STATUS0 register.
A nested virtual IRQ is created and assigned to phydev->irq so phylib
enters interrupt mode and drives the PHY driver's
config_intr/handle_interrupt callbacks.
Patch 3 fixes collision detection for LAN867X Rev.D0 by configuring the
hardware Collision Counting and MAC Forwarding Control field (CCMFC) in
the Collision Detector Control 0 register to the OA default value. The
hardware automatically gates collision forwarding to the MAC based on the
live PLCA_Status: collisions are neither counted nor forwarded when
PLCA_Status is OK, and are counted and forwarded when PLCA_Status is not
OK. This eliminates the inherent delay between a PLCA status change and
the software interrupt handler toggling CDEN, which was a limitation on
older revisions that had no hardware alternative. A dedicated
lan867x_revd0_handle_interrupt() is added to handle two separate interrupt
events: link status change events trigger the phylib state machine for
link re-evaluation; PLCA status change events update the link status
selection. The handler uses the same conditional assignment pattern for
extensibility. Collision detection gating is handled autonomously by
CCMFC in hardware. The .config_intr/.handle_interrupt handlers are wired
up for Rev.D0 using the shared lan86xx_config_intr() and the new handler
to unmask both link status change and PLCA status change interrupts.
Note: Patch 1 carries a Fixes: tag but requires patch 2 to be applied
together -- the interrupt handler in patch 1 cannot fire without the
virtual IRQ wiring in patch 2. This dependency applies to 10BASE-T1S
MAC-PHYs (e.g. LAN8650/1) where the PHY has no dedicated interrupt line
and relies on the MAC-PHY SPI driver to deliver the interrupt.
Parthiban Veerasooran (3):
net: phy: microchip_t1s: fix collision detection on PLCA status change
net: ethernet: oa_tc6: deliver the PHY interrupt to phylib
net: phy: microchip_t1s: fix collision detection for LAN867X Rev.D0
drivers/net/ethernet/oa_tc6.c | 69 +++++++++++++-
drivers/net/phy/microchip_t1s.c | 159 ++++++++++++++++++++++++++++++++
include/linux/oa_tc6.h | 2 +
3 files changed, 227 insertions(+), 3 deletions(-)
base-commit: 25c1f6111034aef7fc06cfbdcf1e4f0d6e5ee74b
--
2.43.0
next reply other threads:[~2026-09-01 13:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 13:09 Parthiban Veerasooran [this message]
2026-09-01 13:09 ` [PATCH net-next 1/3] net: phy: microchip_t1s: fix collision detection on PLCA status change Parthiban Veerasooran
2026-09-01 13:09 ` [PATCH net-next 2/3] net: ethernet: oa_tc6: deliver the PHY interrupt to phylib Parthiban Veerasooran
2026-09-02 0:30 ` Andrew Lunn
2026-09-03 13:23 ` Parthiban Veerasooran
2026-09-03 14:14 ` Andrew Lunn
2026-09-02 0:43 ` Andrew Lunn
2026-09-03 13:02 ` Parthiban Veerasooran
2026-09-03 13:54 ` Andrew Lunn
2026-09-01 13:09 ` [PATCH net-next 3/3] net: phy: microchip_t1s: fix collision detection for LAN867X Rev.D0 Parthiban Veerasooran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901130948.212914-1-parthiban.veerasooran@microchip.com \
--to=parthiban.veerasooran@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox