From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796287255; b=3f7jt9PI59RZCdSIWQZbgYdbxCx+jAc6ey03/RAwhQy1VSyeQiA74RmoptUp99Z2y1oK F+c5VF15ZzRuoAfCgoLhCb/kFsC7IRUHibv1tWy62qxs0baTmqMZQk2E/iAFwSI2d6jhT PaFwEYi+Rm7MFjFZowaNoIb4LJzulx4kJze8PmU7Fyu/62Yt6HzGeI463uumG6K0QrHxM slbPxNS50je+gtu2Vf+fjkf87n3Vean9h8rbmZbSCQX4V86jTWCJcqRYWSNQrgIhkWnWj flkZhLFTKx+D59hvNJlHYT4MX7XJQqNpKIn5HwCziO/fy31jrg7YE8ECCSV1DLJN/tA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796287255; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NNgicm8Ys9mgiQF5TtisULvhYKJjNROvwIdttUPNp6M=; b=PscfzEX85Q5i7TTo18NM0rB5ufx0nxtq+QRgPrrXaKp74r3nvhL7XZHxoPH2FelYTNo7 x/OyapKvz0EcBHpZSNbLbof3lHLGO0FG54YPcuzVtkOoPYlwvxXXsgKN4MrpCkgNrRzd5 Ul19XNIDiGOOW7w2oeoj0pKUkYGVElbWE1Sf8Y6J/XEHqS5c7tZg3X/bH34bsBdJM5chL m3zjaI3Rph6dSv+5kqWDYsryXFGUOZyglT3RFmt2/f2JcvN6/0ZHeLMD3uqWA3Js7enDU tKa2MuYmxqXqXDPHN0GgY8J6oG2yu8JR35yB5CnxEhW6BdDy5Mz5bo5Oa1vnfIk3HXQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GJtEnEvT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C3BA606A32C for ; Thu, 3 Dec 2026 08:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GJtEnEvT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BA0B1F000C1; Thu, 3 Dec 2026 08:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796287255; bh=NNgicm8Ys9mgiQF5TtisULvhYKJjNROvwIdttUPNp6M=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=GJtEnEvTsojDLkqpLDFlAjxSJ4Mx1ktXV1NSPDnQ1d8lee8tnv6C4Ko/P5T8LLRWF INJmX3qCLOvttXfnRMDizO7YJHynvV7ZeiHwoj+RxKgvtM4YCq0/HoTr/csxPE6sun PIjk8h7h3pqnIL+qh6WCcG9WHvxHWeFBoL1Ut1O+brkY8jzJNXaKGAheYLpTFxZ5wg W3EBaZPHwd8FweIQrkyUSHMGsCqONk3U/9OWYGRXmzcPCyeF5MjPKZLhzy9wuf1fsJ BuRLLyxy8YGoRQg3FCMxjg5O6nVMHg5i4f3/SsWZs1Rdwh81G9XjMNC09309CqY47q SZelzGGypjwIA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v18 1/6] net: dsa: motorcomm: initialize dsa_switch based on chipid Reply-To: sashiko-reviews@lists.linux.dev To: "Kyle Switch" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261202084022.3716891-2-kyle.switch@motor-comm.com> References: <20261202084022.3716891-1-kyle.switch@motor-comm.com> <20261202084022.3716891-2-kyle.switch@motor-comm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 08:40:54 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] net: dsa: motorcomm: chip ID read before SMI reset in yt92xx_register_switch() -- commit 4dd56147d8289334bbc07f03f99e9d097c16b21b Author: Kyle Switch net: dsa: motorcomm: initialize dsa_switch based on chipid This commit replaces the hardcoded dsa_switch initialization in yt921x_mdio_probe() with a lookup table indexed by the chip's major ID read from YT921X_CHIP_ID. > diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm= /chip.c > index 82f364986aebd..197dadb1046a4 100644 > --- a/drivers/net/dsa/motorcomm/chip.c > +++ b/drivers/net/dsa/motorcomm/chip.c > @@ -2699,6 +2699,68 @@ static const struct dsa_switch_ops yt921x_dsa_swit= ch_ops =3D { [ ... ] > +static int yt92xx_register_switch(struct dsa_switch *ds) > +{ > + struct yt921x_priv *priv =3D dsa_to_yt921x_priv(ds); > + struct device *dev =3D yt921x_priv_to_device(priv); > + const struct yt92xx_series *series; > + u32 chipid; > + u32 major; > + int res; > + > + mutex_lock(&priv->reg_lock); > + res =3D yt921x_reg_read(priv, YT921X_CHIP_ID, &chipid); > + mutex_unlock(&priv->reg_lock); > + if (res) { > + dev_err(dev, "Failed to read Chip ID with errcode: %d\n", res); > + return res; > + } > + > + major =3D FIELD_GET(YT921X_CHIP_ID_MAJOR, chipid); > + series =3D yt92xx_series_lookup(major); > + if (!series) { > + dev_err(dev, "Unknown Chip ID: 0x%x, or unknown Major: 0x%x\n", > + chipid, major); > + return -ENODEV; > + } [Severity: Medium] Does reading YT921X_CHIP_ID here before yt921x_reg_mdio_reset() break recovery when the 4-frame SMI slave state machine is out of phase at probe time? Previously, the first register access happened in yt921x_dsa_setup() -> yt921x_chip_reset(), right after yt921x_reg_mdio_reset() realigned the SMI state machine (added in bc686737f555 ("net: dsa: motorcomm: Resync SMI slave before register access")). With yt92xx_register_switch() running in yt921x_mdio_probe() before dsa_register_switch(), a misaligned SMI bus causes yt921x_reg_read() to return the 0xdeaddead sentinel (or a stale address), so yt92xx_series_lookup() fails with -ENODEV before yt921x_chip_reset() is ever reached. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202084022.3716= 891-1-kyle.switch@motor-comm.com?part=3D1