Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796251820; b=w1RuHmNk7mm6/LB3GL52yx/GrljZzZK/X7EcKk2oHLFMZ0AF6AeSlOm9RKBC+Nk51I8m P4dZogSeYAVgob2Nv1iiqgLnE/PxOl9PnVE7CX5S2AHQUzLXFQZgTivA44dTh8amvVEQU sgwR+DsGxel339pZTvAnz9L89j0DziWfqxGm6kaZAgzI60cv1yQnByv6JW4hhvWezWkj4 lkyuJlMvOMlxfo0/hTYi3dHAlTv8hOqy2xREOGCdC9D89ibLKg640mzYhRrgkc8g5TC3Y 7eslsayqU4nMN9rQ8ih1t9IEOOJS7L2OQ6xmNCABtBRIElwczkFrT4A20EDxs4bBong== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796251820; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=cs5lZ9I1zC2CwBKi1LsdbXy4tNHI/eN5Fq0QKXMdH6s=; b=w4T2Bely1rkpMYWGOOWbl121QfpjfutsTCXNV4lbMYaJZnlvNNZB8iuky9D2Z957tsad b5lKa3kw+i+D0p+h/irJVTkdzuYpMjKAZqiTYBRQ5ayHXODnZCBeZmDX7eiTJ3GOE6o+Z pZf+yVO4xmcobo2+Fy7WNXks+YBdYBdAXD7Kmn7mrhxC/WbDKBRBmFGvEvnQLKiFtHnmg 9Iocza2zNBchtow05E3+byDCXbgT/0sg2AzHI5qyWgixtke0wF19J2PBhQzXk0FXwb/wz N69W4ArPOru15ZrJ7uXOliBIdoMHLyR271JXRzbd2QXYTz9Lc9fOIK2w4XkoxY0HDxw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=J30r0pJt; arc=none smtp.remote-ip=74.125.82.51 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19EB460A382B for ; Wed, 2 Dec 2026 22:50:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 19EB460A382B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=J30r0pJt Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-1b5b93bdc2dso5560919c88.0 for ; Wed, 02 Dec 2026 14:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796251818; x=1796856618; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cs5lZ9I1zC2CwBKi1LsdbXy4tNHI/eN5Fq0QKXMdH6s=; b=J30r0pJt0aZljDyt2TnpINlo8eW+Sxjx5r6EC3le8j3a5mwYnPDna3tXT36dRrMl3b SEeDvLMeBCodYhlfDuRcmGD/qPbvE94dPiYZBPbvoJovToBCPCd8JGaN8mBPpA95SnJt Q351BkJaMr4tSF68jNxL6VBssSaRdwxOVXH6wlzxgNavi9AG7IaAxg/m5OY4a8GSHXZp fejPLf0KzqnBbvZG8ihFzLv7LQJ0MYOYsm68Io9ypZzhNDOWMxMfvcO/QV3UM7oop32L mm5VmPVU7UUtPozDQL24FN+vAwysNCARU1zxPHhnsV3DVcrNBp8H1W3XuYYrzcnqBaBa ydZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796251818; x=1796856618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=cs5lZ9I1zC2CwBKi1LsdbXy4tNHI/eN5Fq0QKXMdH6s=; b=OsoFVYPOa1hxThS7jiU+vncnenbQMzoSy3xbgNHQbONpbw0KqHBHXAjbpz4vkR/9HP m1VohtKjkLXDFvG4mrGQWxaK/uGIjs5ya938WRSOTSvvwKD9QBKRRhuBU5QYxpQBZcvG 5z3teLC6wo7O6/UOpNa9lVelOhuH5qSThuHZn0lb0cRg+WZ8Y/ElucgSD1vFBbUsezLd 6pao3Vd3gKYgCDwI8YrpbrrHiaw+QVLnTqNkhBdLDQ8IoWBOWHhYrlrs7lWD1lI22Weq 3XAzNdVhPd1dP1E82bozuy/O6xL0aHXEnq1xS6UWjzJX+rsjf0rs41KQToQoavfZSBt0 ynRQ== X-Forwarded-Encrypted: i=1; AL+hErFEjzgnozoy3NJ2GPRNanX4BsqDtJL8t05lvl9Y2qD7WF09oRDYIiP3XdVw1Y/8xyUrDxjeimJLoJ/oV0o=@vger.kernel.org X-Gm-Message-State: APuU4Z82GFStWrUWs32w6N0hjCF/V0KNdX/LjDbNzzTS1DnNna4X3v10 XOn2SRI2/38xRFOr6skygB1KrZRYOj2ZJjeuXrdez71NhhyIx38tiXcg X-Gm-Gg: AZFdTZeDJ0Mhls3JNhDVVAVM6g4Bqi7X6BbtXRbt068IBK0nA5lo8smPlSStCjHWW37 aGA2ma0LDudM6kocjNyz+SVUgrFhilURzpkecl8YWdO7ZfsxbDShsSjUrfeKFnklebxpoDCh5cC gBNmBmGJixU32g6GXKpEfPhMeaQ4ywOFPKwb7x/B3P5kjf4WHwN1LaC2fmyDNc8zkjfSxc/hdYb 3fgsnxcHDfa4Zj9piaV/4H1z9WHGuNdhI6lGqYDxCGImCN/ZD7chKmB6BahK3s03TeR4xltPMFS WZypWz7y6Dyq7PAEBFo6zD9u7ZSb7igTXW3dPPuxi9YWUopo8gl6WKyz28YzJbpjG9gwli4+sGC AAHyv0JxPRdfh5u4Ql+LENEyB+/ZMR0C7BbOOVv+q6ZfLfmMsUpZJ92RiQ+csvlFAUyVpLPUeAD yXs1gRWi7Tny9nW3BgImmQGxUv/T5QQVQjq4KN4MiI1NQdmej4d7uPIC9yt1QQCs1SH38x8eA1c og1JjMhXJTG/HvLU+1EWZRjFSSYHysrm9yrTu+EDSgyfVAfKtw+kyJTNfhJDT+FO0Ho2BQLaSHB 2orI3XZpUn6q1H2yhwsMaGyEov65 X-Received: by 2002:a05:701b:21cd:b0:1b2:4871:b1f7 with SMTP id a92af1059eb24-1b5568fbfcbmr35649115c88.39.1796251818237; Wed, 02 Dec 2026 14:50:18 -0800 (PST) Received: from eldorado ([2600:8802:b00:1f88:d294:66ff:fe95:a98e]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55684c85fsm151770048c88.14.2026.12.02.14.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 14:50:17 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Simon Horman , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Jijie Shao , Runyu Xiao , David Yang , Herbert Valerio Riedel , Danny Kukawka , Mugunthan V N , Sebastian Hesselbarth , linux-kernel@vger.kernel.org (open list), Manuel Lauss Subject: [PATCH net v5 08/10] net: phy: smsc: wait for LAN83C183 power-down recovery Date: Wed, 2 Dec 2026 14:49:55 -0800 Message-ID: <20261202224957.3043478-9-f.fainelli@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261202224957.3043478-1-f.fainelli@gmail.com> References: <20261202224957.3043478-1-f.fainelli@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The LAN83C183 uses the generic PHY driver, which returns immediately after clearing BMCR_PDOWN. Section 1.11 of the datasheet allows 500 ms before normal operation is restored. Starting the Au1000 MAC before the MII clocks recover can hang the MTX-1 when reopening its interface. Add a LAN83C183 driver entry and resume callback. Wait for recovery only when BMCR_PDOWN was actually cleared, and propagate MDIO errors without waiting. Resuming an already awake PHY does not incur the delay. This supplies the PHY recovery delay; it does not by itself fix the Au1000 MAC/PHY ordering on reopen. The companion patch, "net: au1000: keep the MAC stopped until the PHY link is ready", resumes the PHY synchronously before MAC initialization and stops the MAC before PHY suspend. Both changes are needed to address the MTX-1 reopen hang. Keep this PHY change first so the recovery delay is available when the MAC sequencing fix is applied. The specific PHY driver must be bound before the MAC attaches the PHY. For a built-in au1000 MAC used during early boot, enable CONFIG_SMSC_PHY=y. Module configurations must arrange for smsc.ko to be loaded before PHY attachment. If attachment falls back to genphy, loading smsc.ko later does not replace that binding and the recovery delay will not run. MTX-1 validation used CONFIG_MIPS_AU1X00_ENET=y and CONFIG_SMSC_PHY=y; the boot logs confirmed attachment to the SMSC LAN83C183 driver. The LAN83C183 and LSI L80227 document the same LSI/SEEQ OUI and model 4, so this ID match also binds the L80227 and applies the same conservative 500 ms delay when clearing power-down. The entry otherwise uses generic PHY helpers and does not program SMSC-specific registers. Hardware validation is limited to the LAN83C183; the L80227 was not tested. Sashiko AI review identified the dependency, binding prerequisite and shared PHY ID; OpenAI Codex assisted source and datasheet verification and revision. Fixes: be9dad1f9f26 ("net: phy: suspend phydev when going to HALTED") Link: https://pdf.dzsc.com/LAN/LAN83C183.pdf#page=44 Link: https://datasheet.octopart.com/L80223-LSI-datasheet-11757091.pdf#page=73 Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman --- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/smsc.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 30e9d22c8d1a..10466b2574eb 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -421,7 +421,7 @@ config SMSC_PHY tristate "SMSC PHYs" select CRC16 help - Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs + Currently supports the LAN83C183, LAN83C185, LAN8187 and LAN8700 PHYs config STE10XP tristate "STMicroelectronics STe10Xp PHYs" diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 48487149c225..c0713017e54b 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include @@ -684,8 +685,33 @@ int smsc_phy_probe(struct phy_device *phydev) } EXPORT_SYMBOL_GPL(smsc_phy_probe); +static int lan83c183_resume(struct phy_device *phydev) +{ + int ret; + + ret = phy_modify_changed(phydev, MII_BMCR, BMCR_PDOWN, 0); + if (ret < 0) + return ret; + + /* The PHY needs up to 500 ms to restore operation after power-down. */ + if (ret) + msleep(500); + + return 0; +} + static struct phy_driver smsc_phy_driver[] = { { + /* LSI/SEEQ OUI 00:a0:7d, model 4; shared with L80227. */ + .phy_id = 0x0016f840, + .phy_id_mask = 0xfffffff0, + .name = "SMSC LAN83C183", + + .get_features = genphy_read_abilities, + .suspend = genphy_suspend, + .resume = lan83c183_resume, + .set_loopback = genphy_loopback, +}, { .phy_id = 0x0007c0a0, /* OUI=0x00800f, Model#=0x0a */ .phy_id_mask = 0xfffffff0, .name = "SMSC LAN83C185", @@ -887,6 +913,7 @@ MODULE_AUTHOR("Herbert Valerio Riedel"); MODULE_LICENSE("GPL"); static const struct mdio_device_id __maybe_unused smsc_tbl[] = { + { 0x0016f840, 0xfffffff0 }, { 0x0007c0a0, 0xfffffff0 }, { 0x0007c0b0, 0xfffffff0 }, { 0x0007c0c0, 0xfffffff0 }, -- 2.53.0