From nobody Thu Apr 2 15:38:59 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3B2D2385526 for ; Fri, 27 Mar 2026 19:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774639958; cv=none; b=o1Ynac24vKmsiP+qG4sEwWIu2/Sbp6WeHwrL3jOFo63ojoBKiKsi1O8UyseuTvo5ZHH7P4RSGDmdL19oUPqo05cjXmosb793CMvzFpT8mpo8lPfKJ3zVDaqQ1KnrSC3HYm2w561inCGOGtHYV60UskcVRpabvDd1JZFCGdfs+dY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774639958; c=relaxed/simple; bh=jd//XrLlu9aP2VdC9ECV4WESWkR9R53GBlDDdRxDkag=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rRuSy8lFXqx8tMA4kYUcn1u6Zi7KofEkh/znzG8ceFCt2krYqmevQgD17XOyGc6w7hPf3/bTK6TunsxfM7ubxcZSvMDumQZKJeNMIUVN44ogMkaOrj8dqgjbtAtyLyCXIQBfTzisxp8aW6kfAR6aM3FpiRpiiQelFokWTSnaixU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=h+pOJ7sB; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=fU24gB68; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h+pOJ7sB"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="fU24gB68" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774639946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rLCeHqNBIDahC+z75v7xjiqfy4IF/oyQQXA2QmvbSSw=; b=h+pOJ7sBa00g8NXII6fSeONYJ00M3zj0hm3a3qDTxoFeIHk0GfHTtys4gYhtK+imQEGjvx ccV8uhxa7gRf9O53JbyDPNrlUOcPFJv91DBcKBjlVfz3zSYVttc6Nswvsufz1JEc8ptiv0 HDA+CVA/xCJKJSbZbYxbCccBUnueOvw= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-59-nbESLh_MPpGgGt4F2S3QyQ-1; Fri, 27 Mar 2026 15:32:25 -0400 X-MC-Unique: nbESLh_MPpGgGt4F2S3QyQ-1 X-Mimecast-MFC-AGG-ID: nbESLh_MPpGgGt4F2S3QyQ_1774639943 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-509044f54aaso75179871cf.1 for ; Fri, 27 Mar 2026 12:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774639943; x=1775244743; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rLCeHqNBIDahC+z75v7xjiqfy4IF/oyQQXA2QmvbSSw=; b=fU24gB68PZChojFexpERgpvb5GyN90N9zJmE2Ac26sSap1siklK7LKs8R6NGat3Ipf FjBi78A1D+RybxNWyWfO6C8zcahGhxFdeKU6ErqTL9ubpGhCJlZ1mHlRSf8oo9JUkngJ NG/+FQA1FD+EVirmxGXWvKzBBXg+hTnIL3MWJ2qmLMZBikLbtzmoM49zUVX3oYObN+jw XNyGN1ztX+vS2AIXS760SsGNm6dIBoEd9SmdHsevkXeJGNMNlPqnv5B6Ji7SQhSViTeb Q+iwjm4Ej2wuGcd/OEADbM9a7++jfzmNq8onxn0eX1wCg49rpW/c7arGGyaui/sUr/zB xBjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774639943; x=1775244743; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rLCeHqNBIDahC+z75v7xjiqfy4IF/oyQQXA2QmvbSSw=; b=LevFQGbq6T/tik4QFxPxNEJlXGf4NpW8Omj+IL5SOo9mZe5IOZTzKCEHDN1KvlXauu +ITf+mzZLBeQ9fvG7yf8NSCUyzj3X8YVvbce/YVHSlfRkSIO5c0xV7muS0vAi6vy76ic MqlR0BJ6TOmlNwHtHQ5sAhUlVxP0RoQbu4Y6Mdx4AzSb557cI1BHXzrnoTX5jDKFdNWl 3IvAvU45NciY4DzQQkxH+darK6IhWiRoE9hYDV2MqjQ8Si58IhGkZihXhgZplvuBT8vX 3DkOhvbZxveZC6uaWWH+EAdYzJ3s4Y0jXyOML6GuQ+4Ents3xGWozm/wb0K9u4Li4fGt dS9Q== X-Forwarded-Encrypted: i=1; AJvYcCULlCretdislZhB3R5pcwgylaNt6hAAvVYKzgGfbbJYwCKFS8UQtV1Iw5MBBg+Vh5l9Uq01BGz4jByJtlo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2vjO1VkkV9q4OyvTuvtsDPT5U2IivrSx599+y3e+EaFIHQeHr wqZPbWyjFOnQEkaEO08Tu7zG0xYCUZqnHf+eKi1Y8/P8spYZpJh4xu7R+KRbpsaffeaibgJuntL 3TS6eev9Oy2z0sgdZHz/AtfLI3kf+EeTzjUY7hFxA+zWwbtbOA8n6BKmpgLbFVh2VrA== X-Gm-Gg: ATEYQzwaWKkZAnuwG7AuiwpKIA4Y8KA7aD0Ip2afHGKYaVhwUIjkmT6T7VmAaD8/Xm5 LJGoqAF97DiAWKnOG386JOi7Vcrjm0yvbPpV7su0+maFsZMfz1Wn3AI051fdKneDh45gslHw5bo eFpcrBH5jGKLc8ND01JHcNL5m+/nfwySBqlXTIqA9AbPA5m+8SApSe+Kldvr2PSYR16eAmR8ZXb aSPsS3ni97ZV2W0i11lz3MG9Wkg3tkxa2UVtgcm0CtKwLrpF/I54bp77ZerO/sY1h3dAK/2oEu4 L0nM0MpNt0QuBFCmZ/c43nyqBk1SJI1AtKRMZAdH/oMda7zYGByqw/COp9o7AZPDzc9w5ksys2b SBsbY6r6149rVFd44OW0zs0xR82r81CjDcciWePeMKZ16OkPBmDCXTe8wGCyU X-Received: by 2002:a05:622a:5c8d:b0:4ee:13d0:d02b with SMTP id d75a77b69052e-50ba3935ea4mr53627151cf.50.1774639942857; Fri, 27 Mar 2026 12:32:22 -0700 (PDT) X-Received: by 2002:a05:622a:5c8d:b0:4ee:13d0:d02b with SMTP id d75a77b69052e-50ba3935ea4mr53626671cf.50.1774639942412; Fri, 27 Mar 2026 12:32:22 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-50bb2c678e9sm2037551cf.6.2026.03.27.12.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 12:32:21 -0700 (PDT) From: Brian Masney Date: Fri, 27 Mar 2026 15:31:56 -0400 Subject: [PATCH v8 1/8] clk: test: export clk_dummy_rate_ops and clk_dummy_context() for other tests 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-clk-scaling-v8-1-86cd0aba3c5f@redhat.com> References: <20260327-clk-scaling-v8-0-86cd0aba3c5f@redhat.com> In-Reply-To: <20260327-clk-scaling-v8-0-86cd0aba3c5f@redhat.com> To: Michael Turquette , Stephen Boyd , Maxime Ripard , Alberto Ruiz , Brendan Higgins , David Gow , Rae Moar Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Brian Masney X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2985; i=bmasney@redhat.com; s=20250903; h=from:subject:message-id; bh=jd//XrLlu9aP2VdC9ECV4WESWkR9R53GBlDDdRxDkag=; b=owGbwMvMwCW2/dJd9di6A+2Mp9WSGDKP3bblPL3zyScOR7epigcDNM00+RnvSLld+8K/ntl8d 3CltpN/RykLgxgXg6yYIsuSXKOCiNRVtvfuaLLAzGFlAhnCwMUpABOp/MDwP1HIbnpS576Sy2Uv 9jt+u/6qYN6iLRv9LiwyWcsuvv6SZyPDH75vE9Xv7Pr6vo13ncMbKaFTog9O2r4tEGVfe/eUyOs eVSYA X-Developer-Key: i=bmasney@redhat.com; a=openpgp; fpr=A46D32705865AA3DDEDC2904B7D2DD275D7EC087 Expose clk_dummy_rate_ops and struct clk_dummy_context so that they can be used for other clk kunit tests. This export will be used by the upcoming clk-divider test suite. For consistency with clk-fixed-rate_test.c and drivers/clk/clk-gate_test.c, the divider tests will be setup as it's own separate kernel module. The file kunit/clk.h now contains a struct clk_hw embedded by value. If kunit/clk.h is included before linux/clk-provider.h, then this will yield a compiler error since it won't know the size of struct clk_hw. Let's also go ahead and include clk-provider.h since it's a dependency here, and this lets us drop the 'struct clk' and 'struct clk_hw' at the top that are no longer needed. Link: https://lore.kernel.org/linux-clk/aUSWU7UymULCXOeF@redhat.com/ Link: https://lpc.events/event/19/contributions/2152/ Signed-off-by: Brian Masney --- drivers/clk/clk_test.c | 9 +++------ include/kunit/clk.h | 11 +++++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/clk/clk_test.c b/drivers/clk/clk_test.c index a268d7b5d4cb28ec1f029f828c31107f8e130556..b286297bb902a0c6c8a0469d0f7= 85009416ba9a5 100644 --- a/drivers/clk/clk_test.c +++ b/drivers/clk/clk_test.c @@ -15,6 +15,7 @@ #include #include #include +#include =20 #include "kunit_clk_assigned_rates.h" #include "clk_parent_data_test.h" @@ -25,11 +26,6 @@ static const struct clk_ops empty_clk_ops =3D { }; #define DUMMY_CLOCK_RATE_1 (142 * 1000 * 1000) #define DUMMY_CLOCK_RATE_2 (242 * 1000 * 1000) =20 -struct clk_dummy_context { - struct clk_hw hw; - unsigned long rate; -}; - static unsigned long clk_dummy_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { @@ -96,11 +92,12 @@ static u8 clk_dummy_single_get_parent(struct clk_hw *hw) return 0; } =20 -static const struct clk_ops clk_dummy_rate_ops =3D { +const struct clk_ops clk_dummy_rate_ops =3D { .recalc_rate =3D clk_dummy_recalc_rate, .determine_rate =3D clk_dummy_determine_rate, .set_rate =3D clk_dummy_set_rate, }; +EXPORT_SYMBOL_IF_KUNIT(clk_dummy_rate_ops); =20 static const struct clk_ops clk_dummy_maximize_rate_ops =3D { .recalc_rate =3D clk_dummy_recalc_rate, diff --git a/include/kunit/clk.h b/include/kunit/clk.h index f226044cc78d11564f7adb4cc2450934aab04ce6..02ba1f1d09c50b37ba1674017b1= 45792acf589cd 100644 --- a/include/kunit/clk.h +++ b/include/kunit/clk.h @@ -2,13 +2,20 @@ #ifndef _CLK_KUNIT_H #define _CLK_KUNIT_H =20 -struct clk; -struct clk_hw; +#include + struct device; struct device_node; struct of_phandle_args; struct kunit; =20 +struct clk_dummy_context { + struct clk_hw hw; + unsigned long rate; +}; + +extern const struct clk_ops clk_dummy_rate_ops; + struct clk * clk_get_kunit(struct kunit *test, struct device *dev, const char *con_id); struct clk * --=20 2.53.0