From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796251819; b=vQeS4gr5yW+6jN+aORdYPNwEZOKRcBxlQHheCXbJvgXO4XfQ84XnOvZ9OWTM4O8uPp72 LCQanKitXuu0nnHB6dw4lJ0sEcyr4vDsiCKoXTdfdbgz9mP6YDNdDOM50kb1jE0OyrFi0 hXHGr7CHFUlf7RJs7H9HGlNi1E/hcQO/44+XwrOduEj3uV5RHGW1oD3764grQY6QcwJQQ RNjFfq2rPwvM6bEOVfayIxF//Z5OfVdRiACjr8BdYGpdB7p6LYd+P8S4SIHvCT5g0Y3z2 AnTufHRU7EEwWnwXj/F+6myuu37o2hH+25JUetckP6vy6YsDxZAWAPJvv5V+KLCzeMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796251819; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: 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=e55f9FbFOwstczBMTtAvZjJAjVM6bewV04HIz7G+JXEysc+Ya0xm+Odw+HzC6szGkjyb f2NIfMwXY3IX+TYDJXOAD1ERPXDnZK7jZd6HyFWzT8ib0IIpZn6LJVS2IWOpu7kRYzx99 L+/mC84SvQ/Zc18zXdmJ/ITn6d9t9hfKbaakddgqrE+0UUxoS1CHXKtpYm3eshytjeUpC Oo/UKLCHfuF6MfRCgDxQkNTIG9R3oskXsmb7PZMvEwvTQz8IYmy3T8CHlZeaaZAKn6F7h rTZUZ/JsLC6orDoRxsQ5Rf2po2FV/rWlhXjqsUXrRVEoRvsZ9rPt1o8Z2kF58p4ZRRA== 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.52 Received: from mail-dl1-f52.google.com (mail-dl1-f52.google.com [74.125.82.52]) (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 1C01C606A6AB for ; Wed, 2 Dec 2026 22:50:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1C01C606A6AB 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-f52.google.com with SMTP id a92af1059eb24-1b5b93bdc2dso5560922c88.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=xvlyZJhvHjMlLQkN6Onirh0Xr06pkp76saexQ2zLBY87E7qfukjnXR3byFhik+MJOI oQgq95AGfX8S3JTkfg1Wzzomx0TWt9sS0WMH4dHTG8RV1pEz/IRbcU5xHhXByChJDSP1 40YH1FBDF4AYhbsVv7fhg43olwDTUJkOfbQT4+4aL7XDOP8fRYhVsfQUomaw32v70KvP hLNsST49KYud9901y01gR1rqKlflC5JHzUkQA6OSX+HwkvlNWEVnRWx9aFwTvvVp0/Zf OiMF0FrsWWcvN4Hwg09NJHRjuF2bom/JCH7dbuQcMa13zftX3c755BxfxhQYXpaNEkZN pt9w== X-Gm-Message-State: APuU4Z+ySrbeyCuYDerDwouCfrDJoMi4FmbqYjQxFweQdEJ7VXTKFZUf KKqJKKxQnGDtv9IJ5s0oXQfOU/qGJhl462gE/1tnnLgWrzFjPwg4rN34f/TT3A== X-Gm-Gg: AZFdTZdRrHbbzj8TFceZ3jZ9NaAMKRIEAaE7BCm88YE2Woc5pMrLqpQTtU4CVtwFPhb +K2BI6ZDye6Mahc7OGHhoKEWv1eY1Ju0OidsbN03DcMIBBC32k7AgvVk7zMimBXkFZKjvorT7sA 6Y4ex18UTvsxj4/4grOasGd3VKoCSGVyMt97sJSo918wmrfcg9vfKwQ7hF6KkDx3FwHdxJKCyCg lCHRV1/h9T69iCGOAVgKl3NAQtSabf6AG2XaVnVIZMKDZItfW/S5bzX7J3fi1pec9zzB9OFJqGf HMKEAp2yI6icp6I72gofaJwfhndMHE8CUz8H4Mb/02jfSf9gXtxS2Z5TbaZJ/kgfwZ7RARtYf2C kU0NCOcKIut9x222+WB2yT7ApyF3s6yAmUqx8sNFJAv9X03QRUsIOAjeKtkVS7Ib2e7fchS17hB SaN5n4GVhEy8dMRBjBnoJN1eOkoSw9hkl7QRNQTZ5acoSX4VAT+AQ5Y3zzeT+MhJqWtvGdeSiAj IazjU0pxVTpfoxKGAH+kVDwWbxgXVIyvSNFJJ3tWiVw/uIXrmFd9SGL3Fvw2eiXxyIdnkKsqFV1 nDOHAQNLdZOtpmrRn/kdKFlgMuga 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: netdev@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