Re: [PATCH net-next v1 1/3] r8169: make PHY OCP access safe in atomic context
From: Andrew Lunn
Date: Mon Nov 09 2026 - 15:50:07 EST
On Mon, Nov 09, 2026 at 10:30:20AM +0800, javen wrote:
> From: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
>
> r8168_phy_ocp_read() and r8168_phy_ocp_write() wait for the GPHY_OCP
> handshake with rtl_loop_wait(), which may sleep (fsleep(25)). Upcoming
> PTP support for RTL8127A accesses the PTP block through the same PHY
> OCP interface from atomic context (spinlock held, NAPI RX path), and
> concurrently with phylib MDIO accesses.
>
> Busy-wait for the handshake with readl_poll_timeout_atomic() instead,
> keeping the previous maximum wait time of 250us, and serialize the
> GPHY_OCP register accesses with a new spinlock.
There are many drivers which need to access PHY registers via blocking
MDIO accesses. Why is this driver different?
Andrew