From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A382381EA1 for ; Sun, 12 Jul 2026 22:32:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783895568; cv=none; b=uZCPZHGuo1SWS6DzyxfUvpo7QCukrjAbcVYLAwP8jH6eXpB7cFjzECD3rkFOXbupZUkSaUAuWDQPWq2/q6BT3zMF89XlCePiv0VPsd0mS9/c7qzY+rxJmnTqUjDQUr1ITAKsqiQe4x3mZd9KCZRx/qh8OXrkG2LoTeCZduEe+Wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783895568; c=relaxed/simple; bh=rMJRUga+qfOnoGx07qr045Ebx7qHtK4d/BCQpBlQpAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g7kdB72PE2X4g+DT2Fn05j/nQBROX0z204GNXBM7p9A9EfHkiTYtlVo0uocbKcD4Ulm3fhkLvn3EIiGGRFXq/3ehdS7Yvp3epS4DX5WINZnbOhY9T8+sfU9ElylHWBYg9sXGF5HgYoUrsZjwo+LFFedQTg/itOwawgb4DkeAYpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ssZS7k1m; arc=none smtp.client-ip=209.85.216.53 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.b="ssZS7k1m" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-383cb94f742so2127484a91.3 for ; Sun, 12 Jul 2026 15:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783895567; x=1784500367; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=2kQZPoHSijeo1tUSaMcbyM3cWe1NTKRtsDQpKGYRUEs=; b=ssZS7k1m1KmncA0QBAFIZtsk+gK4L2p/S0/NWYbwJUVdjSiyX03otEG7XnXNTwm8KA MgZDpmLheAtXwygPSC2TDdAy7zVMVQJu/Iy5Kyx0hgAugogG7l7/zzbxYt3OyBczNHT9 O745m0hpaqfQwBAwwBVTlmN17aoFPq41j2p4YO6NAxZIyEG0s1YXe7vPT0VQMQgc5WeI K+h8Ya6chDazUHhGPPga4gugnxiELe+iXbNRwt0kwKZqXFK1gavNqY28EMDXvOpCT1B1 0kUe+UYlcNyf9ZjYw+IIsVbGoCWxnT50EJ9APsQhUYV2X0VFnBihmT26Uo4gMr0eh1n8 OAnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783895567; x=1784500367; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2kQZPoHSijeo1tUSaMcbyM3cWe1NTKRtsDQpKGYRUEs=; b=AU/MREh91gbbFYhil8N+EEn2Phtg957LyqUnHLvk6DDD/91cRa/k9zRgDPqRDSQcUf hNnjzhdLDNUHeTLJPNrNLhwbAkJzPaFfkaSb4+QnBCQJLAeEJxOZIcOd2ppLKvXgN7HS lZ0ZGtSXR2uM/LWZfrSUPTqO/FkdR3BnAERRx0SyVGuRl+xBLdLEcpPtXsIhJwc+3Rft 9CMe0z380DzDN6gDeUWKG9rX13YwM/vQeNEGRScwhRdOYzmE9Y+nP15VkLy3cPKZouDx c0uNi74cF7xx6C+Tcin15zl46bg0eadnjKz1goifHa/yv/rCWuvCGlk+bz1yuKzXJC05 ms3g== X-Forwarded-Encrypted: i=1; AHgh+RpZ8wOyJ/+IYiYNy87djGSbX/XolnhRCqwpM2w8k05S4LN39djd5XGXAwg0Y6LQfWa3H+4D7OdNi+LybqY=@vger.kernel.org X-Gm-Message-State: AOJu0YyUO3Umuj+vJ185hctgttKjy+LuhOLOHOVxeKeN47HdfPTWHZ25 0I0/tkAayG8FM/ACqQ5zY4IJXQDnIhmvqufcJXk5+ChInuTDDjeFcoRk X-Gm-Gg: AfdE7clBJE1kavgKalAT5ayZQKg5PiK2tkrpP1w3w/wpHcPbZ71erRqbzmozlKVvh9k zisQfc0qiZUFzBZ8o+VfmEKfYuFP+EEi7O2QDBOeHu0pp0CaKzwlNbOAK6PdDdjGjCpMxSVn9up n4h0OYC9+Ey4uh3qcEMNWtkKgTKi3If+Fdsguoz9Iw8HzM5ZkA6g6kD6qOVtNfnUdIBvNFGnvyW 51f6YDf3kIjJpW8xVfYW4hOjl91sZerhapkW5m2lDSL7bxQu74jPVx43dcfTF/GZ0wvO8oqucF7 s1V0wG4a54FBEahfhRPVDvmG0KJJtDhxvWmR4QjNelIA4CGzz/qtq8buQPR8HNiMgIZZzh+fg9J ZSF5hSBGwgcjMNZQn8PFXOPrzAROFbPZLmNAqIBNDZSHTQWlIXvQgzihJhIiYSpHu X-Received: by 2002:a17:90a:da86:b0:387:e0bb:5800 with SMTP id 98e67ed59e1d1-38dc7ba7310mr5970904a91.39.1783895566751; Sun, 12 Jul 2026 15:32:46 -0700 (PDT) Received: from localhost ([2001:da8:7001:11::cb]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f7293sm61166210eec.3.2026.07.12.15.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 15:32:46 -0700 (PDT) Date: Mon, 13 Jul 2026 06:32:02 +0800 From: Inochi Amaoto To: Maxime Chevallier , Inochi Amaoto , Andrew Lunn , Eric Dumazet , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Yixun Lan , Maxime Coquelin , Alexandre Torgue Cc: netdev@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, E Shattow , Han Gao Subject: Re: Failed to reinit phy of spacemit-dwmac when reset-gpio is present Message-ID: References: <20260712045233.800748-1-inochiama@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Jul 12, 2026 at 10:55:51AM +0200, Maxime Chevallier wrote: > Hi Inochi, > > On 7/12/26 06:52, Inochi Amaoto wrote: > > TL;DR: > > > > The DWMAC on Spacemit K3 is failled to register phy after the reload > > the driver module (rmmod then insmod). Because the reset-gpio is > > asserted while unloading the driver and is not desserted before reading > > the c22 id, which leads to a fault. > > You're not the first one facing this type of issues, this is a long standing > source of issues. The problem is partially hidden by the fact that often times > the bootloader deals with the PHY reset (like the case you're facing) > > Take a look at these discussions : > > https://lore.kernel.org/netdev/cover.1761732347.git.buday.csaba@prolan.hu/ > > and maybe more intersting, Russell suggested an approach on how we could potentially > address this here : > > https://lore.kernel.org/all/aTBeVTlsElGXUCSN@shell.armlinux.org.uk/ > > Yeah, I have found these links, but it is something more than I want, so I think I should deal with this carefully. I will have a try if I have enough time, but currently I will send this workaround to dlan to solve the problem.... Regards, Inochi > > --- > > --- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts > > +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts > > @@ -196,7 +196,8 @@ ð0 { > > > > mdio { > > phy0: phy@1 { > > - compatible = "ethernet-phy-ieee802.3-c22"; > > + compatible = "ethernet-phy-id001c.c916", > > + "ethernet-phy-ieee802.3-c22"; > > Indeed that's merely a workaround :( > > Maxime