From: Mark Brown <broonie@kernel.org>
To: Brian Masney <bmasney@redhat.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>,
Brian Masney <masneyb@kernel.org>, Kees Cook <kees@kernel.org>,
Kees Cook <kees+treewide@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the clk tree with the origin tree
Date: Fri, 13 Nov 2026 14:42:25 +0000 [thread overview]
Message-ID: <avch0WAFqmKQHd_1@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 4438 bytes --]
Hi all,
Today's linux-next merge of the clk tree got a conflict in:
drivers/clk/socfpga/clk-s10.c
between commit:
4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
from the origin tree and commit:
51805c5218c7e ("clk: socfpga: stratix10: register the SP timer clocks early")
from the clk tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/clk/socfpga/clk-s10.c
index aad66f8d069d2,1976789b5166a..0000000000000
--- a/drivers/clk/socfpga/clk-s10.c
+++ b/drivers/clk/socfpga/clk-s10.c
@@@ -382,33 -397,112 +397,111 @@@ static int s10_clk_register_pll(const s
return 0;
}
- static int s10_clkmgr_init(struct platform_device *pdev)
+ static struct stratix10_clock_data *s10_clk_data;
+
+ static struct stratix10_clock_data *s10_clk_data_alloc(void __iomem *base)
{
- struct device_node *np = pdev->dev.of_node;
- struct device *dev = &pdev->dev;
struct stratix10_clock_data *clk_data;
- void __iomem *base;
- int i, num_clks;
+ int i;
- base = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(base)) {
- pr_err("%s: failed to map clock registers\n", __func__);
- return PTR_ERR(base);
- }
-
- num_clks = STRATIX10_NUM_CLKS;
- clk_data = devm_kzalloc_flex(dev, *clk_data, clk_data.hws, num_clks);
- clk_data = kzalloc(struct_size(clk_data, clk_data.hws, STRATIX10_NUM_CLKS),
- GFP_KERNEL);
++ clk_data = kzalloc_flex(*clk_data, clk_data.hws, STRATIX10_NUM_CLKS);
if (!clk_data)
- return -ENOMEM;
+ return NULL;
clk_data->base = base;
- clk_data->clk_data.num = num_clks;
+ clk_data->clk_data.num = STRATIX10_NUM_CLKS;
- for (i = 0; i < num_clks; i++)
- clk_data->clk_data.hws[i] = ERR_PTR(-ENOENT);
+ for (i = 0; i < STRATIX10_NUM_CLKS; i++)
+ clk_data->clk_data.hws[i] = ERR_PTR(-EPROBE_DEFER);
+ return clk_data;
+ }
+
+ static void s10_clk_register_early(struct stratix10_clock_data *clk_data)
+ {
s10_clk_register_pll(s10_pll_clks, ARRAY_SIZE(s10_pll_clks), clk_data);
+ s10_clk_register_c_perip(s10_early_perip_c_clks,
+ ARRAY_SIZE(s10_early_perip_c_clks), clk_data);
+
+ s10_clk_register_cnt_perip(s10_early_perip_cnt_clks,
+ ARRAY_SIZE(s10_early_perip_cnt_clks),
+ clk_data);
+
+ s10_clk_register_gate(s10_early_gate_clks,
+ ARRAY_SIZE(s10_early_gate_clks), clk_data);
+ }
+
+ /*
+ * The registered clocks keep using the mapping and clk_data, so neither is
+ * released once the early clocks have been registered.
+ */
+ static int s10_clkmgr_setup(struct device_node *np)
+ {
+ struct stratix10_clock_data *clk_data;
+ void __iomem *base;
+
+ base = of_iomap(np, 0);
+ if (!base) {
+ pr_err("%s: failed to map clock registers\n", __func__);
+ return -ENOMEM;
+ }
+
+ clk_data = s10_clk_data_alloc(base);
+ if (!clk_data) {
+ iounmap(base);
+ return -ENOMEM;
+ }
+
+ s10_clk_register_early(clk_data);
+ s10_clk_data = clk_data;
+
+ return 0;
+ }
+
+ static int s10_clkmgr_add_provider(struct device_node *np)
+ {
+ static bool added;
+ int ret;
+
+ if (added)
+ return 0;
+
+ ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
+ &s10_clk_data->clk_data);
+ if (ret)
+ return ret;
+
+ added = true;
+
+ return 0;
+ }
+
+ static void __init s10_clkmgr_early_init(struct device_node *np)
+ {
+ if (s10_clkmgr_setup(np))
+ return;
+
+ if (s10_clkmgr_add_provider(np))
+ pr_err("%s: failed to add clock provider\n", __func__);
+ }
+
+ CLK_OF_DECLARE_DRIVER(stratix10_clkmgr, "intel,stratix10-clkmgr",
+ s10_clkmgr_early_init);
+
+ static int s10_clkmgr_init(struct platform_device *pdev)
+ {
+ struct stratix10_clock_data *clk_data;
+ int i, ret;
+
+ if (!s10_clk_data) {
+ ret = s10_clkmgr_setup(pdev->dev.of_node);
+ if (ret)
+ return ret;
+ }
+
+ clk_data = s10_clk_data;
+
s10_clk_register_c_perip(s10_main_perip_c_clks,
ARRAY_SIZE(s10_main_perip_c_clks), clk_data);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2026-11-13 14:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 14:42 Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-11-13 14:38 Mark Brown
2026-11-13 14:38 Mark Brown
2026-11-10 17:02 Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avch0WAFqmKQHd_1@sirena.org.uk \
--to=broonie@kernel.org \
--cc=adrian.ho.yin.ng@altera.com \
--cc=bmasney@redhat.com \
--cc=jbrunet@baylibre.com \
--cc=kees+treewide@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=masneyb@kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®