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=1796095329; b=wCNkXbvK5SVvOce2/XgbWh1H1h/ijvW/TxBk36+o7otfXrsC2AvsciQY6EZ8thdsRoxq ewTFR7ZHRHpiFs+XOFs2CjAxBkhKVP9C100DZBndjq3PqcJRGjAM1UoBgyMfGrVJp7PsL SHy7alhhWHjfrDZVv92plOLGhRN2Fddawr8/nbODsjVyxHEsOBqOkG++TBjX9cjA56f90 QVYSN3jyjfwZ4z6iW7rX98UdPJZ4rFDoUamLkPR3rzLDd+E+If5mQnbUBEZYbzXU4iBrg TcV4Q4Uor+8zvSKGOTuIQnnf37AwIhN/a9FfY60cBiK8fCvcbi98kKyyo6XkTmp9chQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796095329; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=acbGL0xgxSHXq+WThcXchl0PtXgRmDzrNwbHilZmLx4=; b=EzCAkClZ5mT7CXRwYaA2N5Re6x5E8QfoU1BmYXzRDzTCHyEN1vKsCmMzZPOkkhNmfT+O zREuVxszPoomLZeROtHrNzCdJ0tG/aCGk+pbiquU2AswFQwt7KYLB/38AwaRMIVGrjFkW rm8eW4wHTGItj1xcE6JLn5c1GD6gfusffANRz150ZZ9RtPE5TEB3pGGodKKCPvgOOtfQ+ kjr33j4eWAkSywaMSnyab0ogEW/c7jnkGOHCtpJbK1P8BDWCwUphBH8qeOdFDGWuxXsoe yxtMssDcgx4k4rN0tdZy+b2wTVuFXgPc8tBKSgkL9YENIKF4qaDeO2ccYyw1ZuVZh2Q== 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=YlmnztcA; 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 D5B47606A31A; Tue, 1 Dec 2026 03:22:09 +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=YlmnztcA Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE0661F00898; Tue, 1 Dec 2026 03:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796095329; bh=acbGL0xgxSHXq+WThcXchl0PtXgRmDzrNwbHilZmLx4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YlmnztcA1wgj+nvsbN+csp5YbXlC1q8PUrqkaidysHjImsupEFjls725qw+xKDQgt g6ZgEZpy+NtSuTY2qTAL1LTlHz4yol7nj9/U+cmx2q4q8Xdxb583KXnl/76XFJwrgD RbXvE/cDoozS++Z892MlHEJckDSjinTuAPFj9qAK2l6r+Jez/7m8OGAvocmNF9+aif PgdZBqUQojz5iSly9nP3MTLrhQygoxNYh+hMJORC8OtVMHlpdAdwCmTkDlAQIinLrM BS426Se3sHaPswJQ4oNcGv2KY0vba1sWwiYmuT0VMDkj/9JbmbPSzSEZ0vDH44xRJm CA9uHG5VZcpYw== Subject: Re: [PATCH v1] riscv: dts: spacemit: k1: describe the CAN0 controller From: netdev-bot+sashiko@kernel.org To: liucj1228@outlook.com Cc: dlan@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, troy.mitchell@linux.spacemit.com, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, kuba@kernel.org Date: Tue, 01 Dec 2026 03:22:08 +0000 Message-ID: <179609532835.3142.17955646471377248461@kernel.org> In-Reply-To: References: X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-can@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The `can0` node in arch/riscv/boot/dts/spacemit/k1.dtsi selects CTRL[CLK_SRC]=0 with `fsl,clk-source = /bits/ 8 <0>`. - [Low] In arch/riscv/boot/dts/spacemit/k1.dtsi, the new node `can0: can@d4028000` (lines 1081-1093) uses `compatible =… -- riscv: dts: spacemit: k1: describe the CAN0 controller This commit adds a disabled CAN0 FlexCAN node to the SpacemiT K1 dtsi, along with a pinctrl group for GPIO75/GPIO76. It selects protocol clock source 0 and sets the per clock to 80 MHz for CAN FD. > diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi > index 5d5f7f8a393d3..64f554aa9aab5 100644 > --- a/arch/riscv/boot/dts/spacemit/k1.dtsi > +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi > @@ -1078,6 +1078,20 @@ uart9: serial@d4017800 { > status = "disabled"; > }; > > + can0: can@d4028000 { > + compatible = "spacemit,k1-flexcan"; [Severity: Low] Does anything in the tree handle this compatible yet? It only appears in this dtsi. It is missing from the compatible list in Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml, and the OF match table in drivers/net/can/flexcan/flexcan-core.c does not have it either. That binding also sets additionalProperties: false and does not define a resets property. Would make dtbs_check then reject both the compatible and this line further down? resets = <&syscon_apbc RESET_CAN0>; flexcan_probe() also has no reset_control handling. It reads only clock-frequency, fsl,clk-source, the ipg/per clocks, the regulator and the phy. RESET_CAN0 is a real reset line in drivers/reset/spacemit/reset-spacemit-k1.c: [RESET_CAN0] = RESET_DATA(APBC_CAN0_CLK_RST, BIT(2), 0), so nothing in the in-tree driver would deassert it. The notes after the commit message say the binding is patch 1/3 of a separate CAN driver series that has not been merged. Does that series also add resets to the binding and a reset deassert to flexcan_probe()? If it does not, this node would still fail validation once the binding is merged, and a board that enables it would leave the controller in reset. In either case, this patch has to be applied after that series. > + reg = <0x0 0xd4028000 0x0 0x4000>; > + interrupts = <16>; > + clocks = <&syscon_apbc CLK_CAN0_BUS>, > + <&syscon_apbc CLK_CAN0>; > + clock-names = "ipg", "per"; > + assigned-clocks = <&syscon_apbc CLK_CAN0>; > + assigned-clock-rates = <80000000>; > + resets = <&syscon_apbc RESET_CAN0>; > + fsl,clk-source = /bits/ 8 <0>; [Severity: Medium] With this setting, does the protocol engine clock end up faster than the bus clock? With fsl,clk-source = 0, flexcan_chip_start() clears CTRL[CLK_SRC]: if (priv->clk_src) reg |= FLEXCAN_CTRL_CLK_SRC; else reg &= ~FLEXCAN_CTRL_CLK_SRC; flexcan_probe() then takes the CAN clock from clk_get_rate(clk_per), and assigned-clock-rates above sets that clock to 80 MHz. The ipg clock, CLK_CAN0_BUS, is modelled as the 24 MHz crystal in drivers/clk/spacemit/ccu-k1.c: CCU_GATE_DEFINE(can0_bus_clk, CCU_PARENT_NAME(vctcxo_24m), APBC_CAN0_CLK_RST, BIT(0), 0); The other APBC bus gates nearby use apb_clk as their parent, and so do the K3 CAN bus gates in ccu-k3.c. The NXP FlexCAN reference manuals say that with CLKSRC=0 the oscillator (protocol engine) clock must be slower than the bus clock. Every in-tree user of fsl,clk-source = 0 (imx8mp, imx8qm, imx93, imx94, imx95, imx952) pairs a 40/80 MHz per clock with a much faster ipg clock. Suppose the SpacemiT IP keeps that rule and the bus clock really is 24 MHz. Could register and message buffer access, and bit timing, then be unreliable on any board that enables can0? Of the 20/40/80 MHz rates on offer, only 20 MHz would meet that rule. Is the vctcxo_24m parent in ccu-k1.c only an approximation that should be fixed, or does the SpacemiT IP not have this restriction? Could the commit message say which one applies? > + status = "disabled"; > + }; > + -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/CH5PR19MB9971565990F421482921CF595DAC4F2%40CH5PR19MB997156.namprd19.prod.outlook.com