From nobody Thu Apr 2 15:43:36 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E836D392C51; Fri, 27 Mar 2026 20:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774642267; cv=none; b=NSdDNsbp8BXXde6ELwyFeVfyy59fbV/7Yn1lo9Id3CdSnfnE9+dq4d6Z/iIaOHzWldyi5f7GBnOVLDYqnFuc6BBqQFftiuq1aMYpA82zVdz4SONhgiRuDAeL1Ls+cxa+2BRMKi/sMj6kdTp+UscILYE4vMzQ5FTnOYlwEWJ6puA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774642267; c=relaxed/simple; bh=Nf9fpJIFLTTMH1rqOO6JktpjV7GwoTEpWSNjp1wHe10=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HnuFS3J6II4HSlP/mtx30ouj/D5FCuX3K3yWTQtjrHC1jEsn8oat7XqkefQwSsGD5ANq8/im2gyoWUuX589WCL6mx+C68517ha5uMwRyrNgaMYl3OU22OY89EQaPDiWCP4fEZbiapJP6J7a0Se1CclcfX8/Ete+zVtTvvu1lxmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=lAZZSD+a; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="lAZZSD+a" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id A2B8F4E42831; Fri, 27 Mar 2026 20:11:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7748660268; Fri, 27 Mar 2026 20:11:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5862610451AD3; Fri, 27 Mar 2026 21:10:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1774642260; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=BKAN+LocEYluLXRUx1tcZNSjXU8bGN4GDJ0xBETLZYU=; b=lAZZSD+aUQ6+1kWQY2aytAygS/CmcZVLMi1w0xa/kWoGH1zqv9MjUDpInFse7Z/y6tCS0p pjbaS0qWWaf9sN2VcP0poZKbZDQZ//zEwDzDuPBB0xnWu5MrKoUQP5RD7iPzn/zqSyMof7 9xa3I1dm1Y242bhTu8dqo9uqLQ9Wy11YgXIiTAWGQquAxDLqqbwXBi3bgcuMShz1RIyaXv jF2wgHchNBynoPGGstX9/7PHL7mcg9+JsBvX9MAeXosZmf9aUy38Wa7kKmqYUr3mBBetSU S+DTJLsBRuJAsNua48F/wFk1RjkB41x3n/xIV/T4kEsJXZjcxH/rvUUKjt4eLA== From: "Miquel Raynal (Schneider Electric)" Date: Fri, 27 Mar 2026 21:09:33 +0100 Subject: [PATCH 11/16] clk: tests: Add Kunit testing for nexus nodes 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260327-schneider-v7-0-rc1-crypto-v1-11-5e6ff7853994@bootlin.com> References: <20260327-schneider-v7-0-rc1-crypto-v1-0-5e6ff7853994@bootlin.com> In-Reply-To: <20260327-schneider-v7-0-rc1-crypto-v1-0-5e6ff7853994@bootlin.com> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Gleixner , Olivia Mackall , Herbert Xu , Jayesh Choudhary , "David S. Miller" , Christian Marangi , Antoine Tenart , Geert Uytterhoeven , Magnus Damm Cc: Thomas Petazzoni , Pascal EBERHARD , Wolfram Sang , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-renesas-soc@vger.kernel.org, "Miquel Raynal (Schneider Electric)" X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add a nexus node with a child requesting a mapped clock in the fake DT overlay to verify that the parsing is also correctly working. Suggested-by: Stephen Boyd Signed-off-by: Miquel Raynal (Schneider Electric) --- drivers/clk/clk_test.c | 20 ++++++++++++++++++++ drivers/clk/kunit_clk_parse_clkspec.dtso | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/clk/clk_test.c b/drivers/clk/clk_test.c index 8a17ad0d185f..cb0071955146 100644 --- a/drivers/clk/clk_test.c +++ b/drivers/clk/clk_test.c @@ -3660,10 +3660,30 @@ static void clk_parse_and_get_parent_name(struct ku= nit *test) clk_parse_clkspec_1_init_data.name); } =20 +static void clk_parse_and_get_nexus(struct kunit *test) +{ + struct clk_parse_clkspec_ctx *ctx =3D test->priv; + struct clk_hw *hw1, *hw2; + struct device_node *np; + + /* Get clocks by index */ + np =3D of_find_node_by_name(NULL, "kunit-clock-nexus-child"); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np); + hw1 =3D of_clk_get_hw(np, 0, NULL); + KUNIT_EXPECT_NOT_ERR_OR_NULL(test, hw1); + + hw2 =3D of_clk_get_hw(ctx->cons_np, 1, NULL); + KUNIT_EXPECT_NOT_ERR_OR_NULL(test, hw2); + KUNIT_EXPECT_PTR_EQ(test, hw1, hw2); + + of_node_put(np); +} + static struct kunit_case clk_parse_clkspec_test_cases[] =3D { KUNIT_CASE(clk_parse_clkspec_with_correct_index_and_name), KUNIT_CASE(clk_parse_clkspec_with_incorrect_index_and_name), KUNIT_CASE(clk_parse_and_get_parent_name), + KUNIT_CASE(clk_parse_and_get_nexus), {} }; =20 diff --git a/drivers/clk/kunit_clk_parse_clkspec.dtso b/drivers/clk/kunit_c= lk_parse_clkspec.dtso index c93feb93e101..a4115216d2aa 100644 --- a/drivers/clk/kunit_clk_parse_clkspec.dtso +++ b/drivers/clk/kunit_clk_parse_clkspec.dtso @@ -18,4 +18,14 @@ kunit-clock-consumer { clocks =3D <&kunit_clock_provider1 0>, <&kunit_clock_provider2 0>; clock-names =3D "first_clock", "second_clock"; }; + + kunit_clock_nexus: kunit-clock-nexus { + clocks =3D <&kunit_clock_provider2 0>; + clock-map =3D <&kunit_clock_provider2 0>; + #clock-cells =3D <0>; + + kunit-clock-nexus-child { + clocks =3D <&kunit_clock_nexus>; + }; + }; }; --=20 2.51.1