🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27404

[PATCH net-next v6 0/3] Add Cortina Systems CS7542 MDIO controller support

#27404
From: Fil Dunsky via B4 Relay
Date: Sat, 05 Dec 2026 14:36
90 lines
15017 bytes
Add the CS7542 Clause 22 MDIO controller with bounded, sleepable polling.
The driver is independent of the pending platform series and COMPILE_TEST.
It retains the firmware MDC prescaler while enabling software-initiated
transactions.

Since v4, the driver acquires and enables the APB input required by the binding
before the first register access. The managed clock remains enabled until
the managed MDIO bus is unregistered. Clock lookup or enable failures,
including probe deferral, return before touching registers. No clock-rate
or MDC-divisor programming is added.

The APB source was established previously on Almond+ by changing APB from
150 to 100 MHz while AXI stayed at 150 MHz and comparing MDIO transaction
timing. The binding describes that source. This version excludes the generic
clock-frequency property because the driver retains the firmware divisor.
The exact prescaler encoding remains unestablished.

Validation for v4:
- The actual probe passes 10 allocation, map, clock, registration and
  cleanup-order cases with GCC/Clang ASan/UBSan. The pre-fix probe reproduces
  an MMIO access without an enabled clock under the same helpers.
- Native ARM driver=y object and exact Linux 6.18 driver=m module compile
  with W=1 and KCFLAGS=-Werror; existing configurations are unchanged.
- A read-only consumer probe on the running Almond+ obtained and enabled
  cs7542-apb at 150 MHz. MDIO CFG stayed 00200001; all references were dropped,
  the same OpenWrt boot continued and its watchdog/settings were preserved.
  This exercises the consumer/provider path, not a full live bus reprobe.

Earlier v2/v3 full independent builds, binding checks and RAM PHY read/write
results remain recorded. The transaction logic and firmware prescaler are
unchanged here; the old hardware matrix was not repeated.

Changes in v6:
- Give the scheduler a 6 to 20 us delay window between MDIO polls.
  Keep the initial register read and the 10 ms timeout.
- Verify immediate completion, normal completion and timeout using the
  Linux polling macros. Build the ARM driver built-in and for OpenWrt
  as a module.
- Link to the report: https://lore.kernel.org/all/sashiko-outbox-251027@kernel.org/
- Reject clock-frequency in the binding while keeping firmware-set MDC.
  Validate the Almond+ DTB and reject one with clock-frequency added.
- Link to the binding review: https://lore.kernel.org/all/179644615714.3146.7992850630581806957@kernel.org/
- Link to v5: https://patch.msgid.link/20261204-b4-cs7542-mdio-v5-0-c9b9b51bf58d@gmail.com

Changes in v5:
- Rebase onto current net-next after the HiSilicon FEMAC MDIO driver
  was removed (Willem de Bruijn).
- Pick up Rob Herring's Reviewed-by on the unchanged binding.
- Link to v4: https://patch.msgid.link/20261127-b4-cs7542-mdio-v4-0-0e37fc0c47d5@gmail.com

Changes in v4:
- Enable the required APB input before accessing MDIO registers and keep it
  enabled through bus teardown.
- Clarify MANUAL transaction selection and preservation of the firmware
  MDC prescaler.
- Link to v3: https://lore.kernel.org/all/20261126-b4-cs7542-mdio-v3-0-35739a0f3225@gmail.com/

Changes in v3:
- Use sleepable polling in the MDIO bus callbacks.
- Describe the experimentally established APB input and allow the inherited
  optional clock-frequency property.
- Remove the unused private mii_bus pointer.
- Link to v2: https://lore.kernel.org/all/20261123-b4-cs7542-mdio-v2-0-30465e831853@gmail.com/

Changes in v2:
- Drop pending-frame state after Andrew Lunn's review.
- Sort Kconfig/Makefile entries and retain Andrew's Reviewed-by on the
  MAINTAINERS patch only.
- Link to v1: https://lore.kernel.org/all/20261123-b4-cs7542-mdio-v1-0-626d0a0e3b4d@gmail.com/

---
Fil Dunsky (3):
      dt-bindings: net: Add Cortina CS7542 MDIO controller
      net: mdio: Add Cortina CS7542 bus controller
      MAINTAINERS: Add Cortina CS7542 MDIO controller entry

 .../bindings/net/cortina,cs7542-mdio.yaml          |  55 +++++++++
 MAINTAINERS                                        |   7 ++
 drivers/net/mdio/Kconfig                           |  12 ++
 drivers/net/mdio/Makefile                          |   1 +
 drivers/net/mdio/mdio-cs75xx.c                     | 128 +++++++++++++++++++++
 5 files changed, 203 insertions(+)
---
base-commit: aea6deaf6b3c8a204242a4ca1fdb26e8e74de5fc
change-id: 20261123-b4-cs7542-mdio-ec44e757e824

Best regards,
--  
Fil Dunsky <filipp.dunsky@gmail.com>
Technical Details
Message-ID: <20261205-b4-cs7542-mdio-v6-0-228e312ff14b@gmail.com>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378016-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378016-linux-kernel-netdev=dewy.ru
From: devnull+filipp.dunsky.gmail.com@kernel.org (Fil Dunsky via B4 Relay)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v6 0/3] Add Cortina Systems CS7542 MDIO controller support
Date: Sat, 05 Dec 2026 17:36:59 +0300
Organization: Usenet Network
Message-ID: <20261205-b4-cs7542-mdio-v6-0-228e312ff14b@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network; logging-data="3047047"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7rd/oL1EAsVjQrHLV+l+kXKxkuI= sha256:83M7gll/gXJ1y5HY2hPNVuYl3g8DcYAE1LFFIUVZXzM= sha1:Jyu7SiJU2T1SIL5iIOTvJxsAUNU= sha256:75HnpZwhNoxHPchqjdDbpm5FoqSRyKVWyCopc+RQlqc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 017C8117E3D; Sat,  5 Dec 2026 17:37:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.54
X-Spam-Status: No, score=-3.54 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U_i80enOaF_0; Sat,  5 Dec 2026 17:37:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378016-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B9F8E117E39; Sat,  5 Dec 2026 17:37:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3224836063; Sat,  5 Dec 2026 14:37:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796481431; b=2vCNGeSsjr1w1PxCKy7ZPrw5JkbWAjNmTK2GVHkY5qN9taFGhYVTSp1EMiqDeIsoPtRp foUvDnbSfYgeyxhH72lr9rFPMCylZUjOQkxCnfu1oWqrhsMnFzz38c2Z1wpGlO2BM4xDq dlVhPHquaUlsu0qRBy8ZT18UCcN9GlncxMkZbDMdT09QFllqyNApfkawckihPs0ybHtXI mn0qvas2cnQwnS5sQNA7bSkMHedyfl5+E82UmYROV0ztXepRPIHIQdUlcLQEn10hrKzut x6igM+/KnUZLF21L8q51UG9qmGEryEqJfxqsZr81I/U70J0MZAFMk+kLBe/a24h1hdQ==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481431; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Subject: Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=rawIlp2fdE5kAI5T6PBOkyaVvUB4EshsVEDXYIAOC1Q=; b=p9dpRWUFvUeMGKyqFM9siC6uXqjLhFZb3p9eivUKctbXbYTfv6tRCa/ppMpq9yKO2MjG OuXG6pSU3bCCEBPqa/bQ+B0/5w3ZxwXJHZOks1ysYZxlXg40AMHjplcl1KqDlTa9ixuUf OShjQDjRkQmAOOuhmAUeVbiafMdUEp/pVKeEjFiwRgyY9D+l2QBvJgivS5AUX8MhLTU3H WanrBzy2jzKs5dv+CqmNvM/dlMSo0DeLhSUMGo35SDQv7HrSnxdkRNCPBDz9INLFD240W /aQpheDS3WZwsI8cGCbPtwJ2auC1eYiyYgo/jlO8QHOLwPMBcmpCc/BdqeNHjSxTIdQ==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kqnz0r1v; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54E47606A6A8; Sat,  5 Dec 2026 14:37:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kqnz0r1v
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796481425; b=GQUBPL6kXamFN/62VKaauPwZmX3d/nFEh/h9+9Gk86XXrycktLXjGTi4wBQ7KlsIno07 ph9iqRlkS55qOwmyfGI3b3ykPhU/5eex6R7mhAFFRXblqlfp+WaPqTPaYVDfYZgCz3KgK KPYA2mf3rLZvyUvX9XDgNdj/9MilDcg7NG3buTINz9pDrbpIk+zZMZjuJyUTE83FtcIvM 4F0zcp7Qh0VQMs1Qnh5MMgits0SDQih8z289u3tftLT1dlmMGO8izau2kJShJg1JiqXX3 rBxfoinPTVWVs/+e8sgGCWG/oiUmeoqfLpZA7raHmuZISOlo1WC+Vir09KR8fjhgZ1g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481425; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=rawIlp2fdE5kAI5T6PBOkyaVvUB4EshsVEDXYIAOC1Q=; b=pyAGE3hEAgAzI9denK5e3um0Li9OIrIqsA/w/GiPn7Wy3lMc5EXogSwZXZQG85mrD636 mQ5vDwGeypqL1HgNVqY1568OujlrqlfVcViaRpn9nf24zJc3Cindds8MJJ22x3TXXWUGJ ZdBKyM0DNEqBoeivbEyp5emkrkxz1Hn/6kTUJcJv7whAIHex23EuO+1sCM4SgpHxYIoyJ ediGUbuWg7DYNcbw0Ej1DDVN2jOGCsVlHtTAW7P4N+db6/a2/PAsJ9QL6KF3qCKUhJd7y a97LvLpdWYm/vsa+FXCE0mZTyBCMQImF8Dyy2WSnRVTF7HjXC2biokcPreugZAxtQ2Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kqnz0r1v; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7250E606A68D; Sat,  5 Dec 2026 14:37:05 +0000 (UTC)
X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796481425; b=00FZHcJsIto4Bs4tIebQFR7iyDTzKRox/ngYcA87Lzsamaib/dbs1rAxRsjTw6ffynCo G1vO/t4pVAvPDV6w8FXgF4TSnxqRjSNhap8Qp1Z5UApx2uuFRHYf6aIcKYzWzOvd0NvTR WbtmIEvUDtqQsJkp3cdQT5Piz4+DWArpXSH4PbD3PFo7XDGhiH3ZWzrIO7CGFOemxnmR4 emze6GVst8yutYgFRn2+yVdZS439JaYm2jW3gqxOL5QOyhfDm6wPnQ/fr6WbVjvLT7LNt amOVnLco6apT3PVK5YxZWv1HguBOVCwsI6vQRPSu12YmV9VXFGXtk6Vws9ztRQTNi2Q==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796481425; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=rawIlp2fdE5kAI5T6PBOkyaVvUB4EshsVEDXYIAOC1Q=; b=JvguTtxCEu9cCTAAEKM+b3L8x6PaQ+fQGDAewlzyhhMf/mHyIg5ahLLeyQoh9EjNewv7 jyoBobzrvTRIbn0IvdGgsc5pgln0xcnj4KDITMQp4d0SRsMM4oxwmVg1ATSm1VB7qf1X4 m+rufRC6E8CcCqQ6GO+Y/IBK8qQWo+FoBe16J0rWk8NdI4ss+zc1DDamVBKtiADUOPphd zodOmAtmAOSis1t21GE4cgSPi+SnWluTYVCbhtJPwLXSy/zqAMnPSF0AmKMYOS2fPZNWo IjPlRaPq5JBKog2iFWCo0QvqNJYpiOoxrRRs3dmp3x36bGHgKU8VWD7k2qKj8KBfE7A==
X-ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 72B581F00936; Sat,  5 Dec 2026 14:37:03 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796481425; bh=rawIlp2fdE5kAI5T6PBOkyaVvUB4EshsVEDXYIAOC1Q=; h=From:Subject:Date:To:Cc:Reply-To; b=kqnz0r1vHXzi+mniOmQae76dNA3IpkT0Gpyl/SXa07wCupJkNhlOm4QzyPpJClk0V dcEb3qN+xmJ3zLR8vK6ALOb7p663aGLPvVzSaKkoaRsPRjZycbo0yY//gBd6n+9XJ3 LtaPYKiADELJKuhf21+Lf60OSZRiE3T6qjTfBCz7n7+P0qQ7tK4Qp4ZuUcS3FonQ0U HgABQ8wbiEsbkUrzXfubjdrFZcQgBuBj6Phvm6wKO7JwPN2k7YxBk73HxsvYl2dSeZ tKwfWFG9vx+QN0MXsaEPZ9N8fVcq9vIdX2lQOQqb5kfw/pBqEPEykbPWfV+VbOOmus ooLq08ewELY4g==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id C406050371; Sat,  5 Dec 2026 14:37:02 +0000 (UTC)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33PwU7DMAwG4FeZciYoceyk3Yn3QByaxN2CaIuaU g1NfXfScmCsgqNlf7/tq8g8Js7ieLiKkeeU09CXwj4cRDg3/YlliqUWoMBqDUZ6lCE7QpBdTIP kgMiOHFeAoqD3kdt02QKfRc+T7PkyiZfvTv7wrxymNW+dPac8DePntnvWm/hrzaylkhZsVI1i4 zE+nbomvT2GodvCZ/ifQ+FGoSWujK7I3HNzy+2Om5WTM3WjWgNA9xxvudtxLLyc7dqgArq44/T DQeGOU+Gh9rUn7Vuqfv2+LMsX9cLOX8QBAAA=
X-Change-ID: 20261123-b4-cs7542-mdio-ec44e757e824
X-Cc: Willem de Bruijn <willemb@google.com>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=ed25519-sha256; t=1796481420; l=4509; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=E6kCLnU9lVZNZqKS8cfE0qprFfGcXDq0l15oi2+hlrc=; b=FgnkJ8WLATMS5S8Pi/5cLFuE3GTHHpwnysvULaq9bruujVsgGAPKOiDmIPLWq/0jcqBc4ykWc Va7L4ykbAjMCr5u8knLoj3NZp8Rt4AmWTvpkEAJo4fy06K/blhgOwjw
X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g=
X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085
X-Original-From: Fil Dunsky <filipp.dunsky@gmail.com>
X-Reply-To: filipp.dunsky@gmail.com
X-Received-Bytes: 14820