Article View: linux.kernel.netdev
Article #387Re: [net-next,PATCH] enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95
From: Jakub Kicinski
Date: Thu, 08 Oct 2026 00:22
Date: Thu, 08 Oct 2026 00:22
49 lines
7109 bytes
7109 bytes
On Mon, 05 Oct 2026 15:30:10 +0000 netdev-bot+sashiko@kernel.org wrote:
> > -#define ENETC_EMDIO_CFG \
> > +#define ENETC_EMDIO_CFG(mdc_div) \
> > (MDIO_CFG_HOLD(2) | \
> > - MDIO_CFG_CLKDIV(66) | \
> > + MDIO_CFG_CLKDIV(mdc_div) | \
> > MDIO_CFG_NEG)
>
> [Severity: High]
> What divider do the other users of these accessors get?
>
> The exported enetc_mdio_read_c22(), enetc_mdio_write_c22(),
> enetc_mdio_read_c45() and enetc_mdio_write_c45() are shared with several
> bus constructors. Only enetc_pci_mdio_probe() sets mdc_div.
>
> These constructors install the same accessors but set only hw and
> mdio_base:
>
> enetc_mdio_probe() in enetc_pf_common.c (PF external MDIO, LS1028A
> and ENETC4)
> enetc_imdio_create() in enetc_pf_common.c (internal Lynx PCS MDIO)
> netc_port_create_emdio_bus() in drivers/net/dsa/netc/netc_main.c
> vsc9959_mdio_bus_alloc() in drivers/net/dsa/ocelot/felix_vsc9959.c
>
> For example:
>
> enetc_pf_common.c:enetc_mdio_probe() {
> ...
> bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
> ...
> mdio_priv->hw = &pf->si->hw;
> if (is_enetc_rev1(pf->si))
> mdio_priv->mdio_base = ENETC_EMDIO_BASE;
> else
> mdio_priv->mdio_base = ENETC4_EMDIO_BASE;
> ...
> }
>
> mdiobus_alloc_size() allocates the priv area with kzalloc(), so mdc_div
> stays 0. MDIO_CFG_CLKDIV(x) is ((((x) >> 1) & 0xff) << 8).
>
> As a result, every C22/C45 transaction on these buses would write a zero
> clock divider into ENETC_MDIO_CFG. Before 587acb86d646 the value was 258,
> and after it the value was 66.
Looks legit.
--
pw-bot: cr
Technical Details
Message-ID:
<20261007172230.53347039@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342601-linux-kernel-netdev=dewy.ruReferences:
<20261001223947.60189-1-marex@nabladev.com> <179121421089.434549.4883192954268711704@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342601-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [net-next,PATCH] enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95 Date: Wed, 7 Oct 2026 17:22:30 -0700 Organization: Usenet Network Message-ID: <20261007172230.53347039@kernel.org> References: <20261001223947.60189-1-marex@nabladev.com> <179121421089.434549.4883192954268711704@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="768049"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ad3fyYOB8ovlzwLTWBpexUCchg0= sha256:XOoU2WZR9Prk/jWY108LDJ/ZpsMMr6KMsmVWVjBfQIw= sha1:VtSfX2/xkt4vemIX6YBxlMcVi3w= sha256:8F73uTB4gGZfPsXL82C/6cRtDyaqeIrfGGlYZwQ5zzQ= 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 741B810F28D; Thu, 8 Oct 2026 03:23:41 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.341 X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, 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 ijprpfkg0ciY; Thu, 8 Oct 2026 03:23:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342601-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 290B710F230; Thu, 8 Oct 2026 03:23:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 09A1C2764B; Thu, 8 Oct 2026 00:22:35 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A448215161; Thu, 8 Oct 2026 00:22:33 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WKocWaFI" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4150F1DF748; Thu, 8 Oct 2026 00:22:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791418953; cv=none; b=uWDEm2vTx/HXTE1ZEwlqIzjOLoerKDWM6UYbANhe455u8n3Jy1EZxFiAiArPHjBU+Nv/glft8XGd9b1rkuHbVKV+99drmFqWDxnFK8vXuj40zBb/hAqpxNiJ/RpasD+5HqyWYkogr77puigJYXCLTlJd5xSt/zKGm1KhwwVp38Y= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791418953; c=relaxed/simple; bh=/z6FyeObSyox00fvFAVa/G0dfkhRFZtmrIoFAREHD78=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sC5rrmNua8wzcpIBtmxgufLSc7s0DQHtbI2/z6IrN4jt0u3SGG3YxIhIC1aBjLx5Lvic+lxC6zBiMriz3GHai0fzZltpwsI9CPNkf9x7v8EAct84Ann2xqktnHcos8g25U5om9FuWhr6eDaMauzYZur3IR8oprrNGcczRtHtvYE= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WKocWaFI; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 754781F000FF; Thu, 8 Oct 2026 00:22:31 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791418951; bh=1PsUH/ABqcyvYmj6q4VB1BamtgWi2MZnSafY+eqOoWU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=WKocWaFItHceD2ATKPCK6L9xuFQlA/kc8soJN8CjGr9lehMTuYvUyTugbgsk/oebe ZLP4yaLTHgmCt7ySAWNAG8Y34/4OCAnsEC6PEOKd7efBRoVpzASDUexYAtvSpoNFJu 1RB3CGJYRu3DUT1q4qagwMEg6zjMJfLUzncEAgUBAIjCOyq5fnTT8jmvHPGBizftCc CgJsa5hilxkTuVrBHeKOklhtZsBNEuTMQesdkGXnBP4mDtZBZmYpCcBCbYNCZFX6Qs Ss/bv2vN3GFfxmhMvobZ/MSg+NTpvU9mWd/5bE0TG0I0qLJQo3muEIC4bN3L7zaE3a VlK3m0NTtkEmA== X-Cc: marex@nabladev.com, netdev@vger.kernel.org, davem@davemloft.net, andrew+netdev@lunn.ch, xiaoning.wang@nxp.com, claudiu.manoil@nxp.com, edumazet@google.com, pabeni@redhat.com, vladimir.oltean@nxp.com, wei.fang@nxp.com, imx@lists.linux.dev, linux-kernel@vger.kernel.org X-In-Reply-To: <179121421089.434549.4883192954268711704@kernel.org> X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>