Article View: linux.kernel.netdev
Article #16457Re: [PATCH net-next] net: dsa: motorcomm: Resync SMI slave after interrupted MDIO access
From: Andrew Lunn
Date: Sat, 14 Nov 2026 21:27
Date: Sat, 14 Nov 2026 21:27
27 lines
9331 bytes
9331 bytes
> > > @@ -136,6 +230,9 @@ static int yt921x_reg_mdio_read(void *context, u32 reg, u32 *valp) > > > > > > end: > > > mutex_unlock(&bus->mdio_lock); > > > + > > > + if (res) > > > + mdio->synced = false; > > > > Why defer the recovery to the next transaction? Why not do it now. And > > if the recovery fails, you can report the transaction which actually > > killed it, which might be useful for debugging. > > > > Andrew > > If the recovery fails, you have to, anyway, try to resync in the next > transaction, so recovery here does not help other than adding more > code. I don't know why it adds more code. You don't need mdio->synced. You just call the recovery function. If it fails, it fails, and you assume the switch is dead, but report the error and keep going. The next transaction is also likely to fail, probably causing another sync attempt, which might work, but by then, you have to assume the switch is wrongly configured, even if the transaction works. Andrew
Technical Details
Message-ID:
<d03e27a4-4777-4477-b827-0fda7a112ec9@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363466-linux-kernel-netdev=dewy.ruReferences:
<20261111163954.1132921-1-mmyangfl@gmail.com> <54eced73-d0ee-41da-9ff4-63aa88667d23@lunn.ch> <CAAXyoMOokp1yJYKo-r9MFehrVTLcL9+eQQ386Ycwmw0ut-KVYg@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363466-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next] net: dsa: motorcomm: Resync SMI slave after interrupted MDIO access Date: Sat, 14 Nov 2026 22:27:45 +0100 Organization: Usenet Network Message-ID: <d03e27a4-4777-4477-b827-0fda7a112ec9@lunn.ch> References: <20261111163954.1132921-1-mmyangfl@gmail.com> <54eced73-d0ee-41da-9ff4-63aa88667d23@lunn.ch> <CAAXyoMOokp1yJYKo-r9MFehrVTLcL9+eQQ386Ycwmw0ut-KVYg@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1667325"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:+FnkV+rF2BKhrnehx80MEzgdhN4= sha256:47NGF0spogMtRtDmmLl5dtabMHVjP/S3X1l2r96Lv04= sha1:qJbFTPT2FM9cwk3acOwM2QBQmDM= sha256:s3v5M9FIDoUb6EKeqKtifwDaqzF/2JetpSH9RBmezCg= Content-Disposition: inline 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 837EA1148E5; Sun, 15 Nov 2026 00:28:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch 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 0gNhPF3dD79K; Sun, 15 Nov 2026 00:28:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-363466-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 90C0A112024; Sun, 15 Nov 2026 00:28:25 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 3903132E60; Sat, 14 Nov 2026 21:28:07 +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=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794691683; b=PeqAmyGHOmcSXAL+i+cwGiE8V1PE5e+lzXWombMeiIxq6iP5zQ4wE7Lk2OGfk3SNWk/L WEvLTYWQjpcgho2sV+zi3nzfkHu+CboaC+M6qvlvTNT8/KgQpjcAfvuVJbjMICfGeXeLJ fG/dG1rScgurTHWQFdVuz8JAN9v7DB0f7BfkdgzZDMFau/qauDTDhA0OF/JVEa7o+Y7Cy qZu+ZGGrcjJknEbxm5CFl5ioNHjkU8i9rQGqzm5WbzA4jZI1ClMDtrBMD19Evv8PsVpWt X1oPu2Djbd9w+VfZLtYn/2DbWbf5zEkYCGYBpRdYZPbOkPFD72u3do5rmvWmxDmuKIA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794691683; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=aVQSe+ztLuuVQxQ0MYdkDhLji+45l67wuJIEeQLK6Nc=; b=R3RRLObBabHLUWzsnnp6NvilkCtZi68pxeqRM3cOXokzIQrXsO9AOOHqZeTpuLplO1Xl f1VOYdiTRmXH2b+BfsjLV+KGcSyR2gAxkSCj1etNKJUihLE8TZGNhpSqAw1qhdS9k9wmo DbGiGtdjdz1oXtmfcEdSkStNo+ZkS5Jz7AdTaLRnE7pHrIffpvF+xe6FoAAEiH3QHQ2Ml KnZy5VON5SzOwiiLSyGQsjFT2UKmdMPUoSFC/SB/w83ogExHOj2UqY5w0yCk2PqpcEqgf 3C3tEAhSApSq0k0mq36llXhhIQ0EwKQb6TYatyU5XJdITnqmZblJEajhDzF17raUfNQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=DgnE4Ee7; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; 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 16519606A338; Sat, 14 Nov 2026 21:28:03 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=DgnE4Ee7 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794691682; b=Mn/xSmRV5FLQU/wzou2bBKdrKC4U6jsOxTPiF+ItWuh41jrvr4U0QN7u6mY+n1czH1a/ WSppVgtymG+XIDaovgI2qc0T+q/YR9JU2pRnhVqt0EN/seXrYNKcMPryw1L3WQ2djigWF 2hiOSgHUk1ZyWbhw8pfsj8NlVoM6piBKhhJV/U1OwGqwAtW7z270WbYqV8LgvCITfWVMf hJEl+q9O872HX06Qbqzfo4c8OWhpb4j/L1Q2Z5gLWx6MbaiZVGzJfkePz8Fytd3SFZVVS I3XDiKLaomLzQKg8VXytHGvUxNh1Cu0EWWm126d++hoM5Fl5gGqW7dLyW7Xz0SPU/pQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794691682; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=aVQSe+ztLuuVQxQ0MYdkDhLji+45l67wuJIEeQLK6Nc=; b=UNoWVNJvmXPneGUXc52bJU5g+OAHK/quLkCrfwYDVrfmwsx72ayABMwFfnhZ0MDaiwUj fBKNS+1zL7SruL25qNX+JAWWz/6eLf4npdG1g5zm29GoFLa95XBK3Ildf6Fy6n12Q+3+H t2bf9HI7Oq3hXD/nazVxP3CFwM7GXBdglonzgDUWkxSrBrtVOp55rl+M8UmLvF359Xngb UR/KFtJegY5MokbAq7/Sx3uv0sPKX1hXM1U+rPJ+mJCNJ9dImwoSVvJnQDexwtJWNnUT2 QF48AOpHweEmMAkwOftjoM6yTVba4WMVk3qK1t9JKGs/JYZhDLxy1soPBE+MEpLROTA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=DgnE4Ee7; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6D37606A327; Sat, 14 Nov 2026 21:28:01 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C6D37606A327 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=aVQSe+ztLuuVQxQ0MYdkDhLji+45l67wuJIEeQLK6Nc=; b=DgnE4Ee7uhkBmka8KpKaXwmbBi 48+4IBQBLw/PLaqJSL7yTQ1Pqos8ame8T9jU5Uyjgga2oYy3sX7LQMzeACdd5HwYHHIk+b6BejUOR r4gciBxT90LdmXOrpxpOzNx8cH0MDh/rkXJ3TDxksEG6mk2U+U5l/yuK+DHNb/c4dGZY=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xSLHl-00GXQr-37; Sat, 14 Nov 2026 22:27:45 +0100 X-Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org 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-In-Reply-To: <CAAXyoMOokp1yJYKo-r9MFehrVTLcL9+eQQ386Ycwmw0ut-KVYg@mail.gmail.com>