From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 4E8A338BF89 for ; Mon, 11 May 2026 20:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778532105; cv=none; b=t2gBf9ktjtVkpjgXWQ4rzE4pj4wUurfB6MxclPUXcIBsKeHen+BsyHIuE/Z7VUe3JS37EbpsVj+/1ZDXig1SqW2KUD+RDVGtszVMJTjvI98s5WHedSzJNNpV/xUvUE4U2so2JV8zoaXef4jr3oj5SykTFll5yhdjmJALOGA4UoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778532105; c=relaxed/simple; bh=71MReg26wB1uti72hY48us1SYlnbAwvBMD9vyF1L6VA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kFvV5QC7QUP/U7BJkimchlh92MIY0QKHhMGTnEdp7OF0FotJBOuB+xuc8zDVv5TfR+QwNvgYzd6QqsCd/+mDRcqMHMtFwdKf/uuDXBJFSSREE6Kr0YnLprI1RqxektASkCCQcVYwmDMbsedrLbZGf0ow5LMoDq0s4BGmdIng2oQ= 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=J5BjjX6B; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=T7H9r5mt; arc=none smtp.client-ip=170.10.133.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="J5BjjX6B"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="T7H9r5mt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778532101; 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=xDfLIv6tiWpmACcsMnlD5yn+pQeqBizpoJHnp+m+Mek=; b=J5BjjX6BWmkvVStnPPEJnJ0dpkln2l9LC7c7EkwUk9MiwKsoEFOCFOpOnr53maUczpjNPs omxafssGgLLGafekPODPMMr8GFx45GXlWDN3n8bvDTJ87G43mMbtIXG43vCYiKYilQHzON O8hijnVC8dd3dIq1Eckwlz3oW1xpXxE= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-66-O13yjcGkP9Kw9T-U2XKEFw-1; Mon, 11 May 2026 16:41:40 -0400 X-MC-Unique: O13yjcGkP9Kw9T-U2XKEFw-1 X-Mimecast-MFC-AGG-ID: O13yjcGkP9Kw9T-U2XKEFw_1778532099 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-8b3fe2f190bso128087636d6.2 for ; Mon, 11 May 2026 13:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778532099; x=1779136899; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xDfLIv6tiWpmACcsMnlD5yn+pQeqBizpoJHnp+m+Mek=; b=T7H9r5mt7ronuowycgz5mPuhHc043Mnx5pclao9ue3Ne1mu4DUZM0trJQkAkXJ3g5Z 7Fl8vwFtk2nyrCpG40H1HmORiLMZOkACsO+/dCMEREZ/bx7naZ+d3IVko4j51tUaualh 1uh9r9K3aVCljFAJl0lafxFDPxnprWGh5wImwcMQGQnRBdQ30EfoIy6nInnLW9tbp1gu GZDePyWsOfRkt1OL3MKPEmmabJW2gKKdTOEX3K+9B2JjYRW89w9FulfmecmKVGSUWhjj eDbFbBB5lhz7PWLZdmiEBSIQf0Wm3FngG8b7BOv++eFUg+n5P1kP7T80/jSNQViNRG6F seTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778532099; x=1779136899; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xDfLIv6tiWpmACcsMnlD5yn+pQeqBizpoJHnp+m+Mek=; b=brbsB0yARBYW6SbogOzn231GWpxkooW2+wDSew2u/C7r72pei7Gu6LmOyiBYbpu2es spEogggFfmGUyRjC7xeemDLh7mbtIOMienB//824i8j5QEcBHnO6FE1+7dlGNYILukid Y/49Czh06SBn/6RyrvIxVjH0naWT7YydkmaMipuwKlT8/sKI5nUTVoPwUiqSPoy04L2v +dCJUTsXY4LVrbxsMktE9IY83sO1SNSWOmVIolkecnC9mjHUxRVaIrnommw5X2m+ZRxt R5WHBpIEBmCGGF4hkc13Yoc9bXbTMXOSjy1GoShF6vduOGcL6SUu8Z87JaCBD+JENaJ9 sxKA== X-Forwarded-Encrypted: i=1; AFNElJ/wnxEdrZmnhmDNJrDo8hGF/CJAnlBbYTXWr6aF/QVxBBL5cwxeUzYrn8quaSe4kq9m/SrTJq+Ukk1dQlI=@vger.kernel.org X-Gm-Message-State: AOJu0YwcJ0MLuuvv+XkAqsHoWmRPF0NGPDUXwm8tACsg4ruWytPx8wpC 9KAXC4qoppwpoh0YY0+pTAkpd1V/2hMbj+8jSgdBmeWxnrnc23Q5N2wQFEhY2i2iqiv5LgjSg9T 9p/KrOkO3KSPhbw6t0skMC39C3wWllL8j1ZzHr3hbgV02lRNMi6g9/KoL+zk3vNUtMg== X-Gm-Gg: Acq92OH1D7R901Z2aAscLUQAjKZm3EbpRUVpz+u+quCNnmjCp8aPNgcN9adtbOg+w46 koUGS0G1OYPn5sEwXNkkwuqaMgRfuattqs1cFZZ0rUJoSBN2AwnQvMSinZDkD0HxQ+jR3wOyY+A qgOFFXzQSGISvHhE+WAzLV/K2Uf3iTG5Zas13KDXGEb87CQ3E2Dz4fGbgSBJpUXM+UMGfmWFOhY I/ForYgygx2ceNtBaiWavh2ErjkeBrdCkaJviH3ozOGx8GQIgnJhf4zw1K40LvSjqX77uwaSB5z 7AtTyYA24rbxgUcotp9W8WnWtBKxKA7TvmeyqhvmAYc5jL5xJggi/gs2e59aHwIZLooW2FjuA4M 0P+AHAj82YKrIRGHv5NM9527ebdk7oMe8wFmUQDIJjgsE+vJ1pNTSTl2z X-Received: by 2002:a05:6214:3c8c:b0:8ba:942:3e38 with SMTP id 6a1803df08f44-8c661e86acdmr4794356d6.19.1778532099550; Mon, 11 May 2026 13:41:39 -0700 (PDT) X-Received: by 2002:a05:6214:3c8c:b0:8ba:942:3e38 with SMTP id 6a1803df08f44-8c661e86acdmr4793766d6.19.1778532098935; Mon, 11 May 2026 13:41:38 -0700 (PDT) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8bf3b0c4c9dsm108806616d6.5.2026.05.11.13.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 13:41:38 -0700 (PDT) Date: Mon, 11 May 2026 16:41:36 -0400 From: Brian Masney To: Rosen Penev Cc: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Heiko Stuebner , "moderated list:ARM/Rockchip SoC support" , "open list:ARM/Rockchip SoC support" , open list , "Gustavo A. R. Silva" Subject: Re: [PATCH] clk: rockchip: Use flexible array for clock table Message-ID: References: <20260511032252.361906-1-rosenp@gmail.com> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.3.1 (2026-03-20) + Gustavo On Mon, May 11, 2026 at 12:08:56PM -0700, Rosen Penev wrote: > On Mon, May 11, 2026 at 9:06 AM Brian Masney wrote: > > > > Hi Rosen, > > > > On Sun, May 10, 2026 at 08:22:52PM -0700, Rosen Penev wrote: > > > Store the clock lookup table in the Rockchip clock provider > > > allocation instead of allocating it separately. > > > > > > This ties the table lifetime directly to the provider and removes a > > > separate allocation failure path while preserving the clk_onecell_data > > > lookup interface. > > > > > > Assisted-by: Codex:GPT-5.5 > > > Signed-off-by: Rosen Penev > > > --- > > > drivers/clk/rockchip/clk.c | 17 ++++------------- > > > drivers/clk/rockchip/clk.h | 2 ++ > > > 2 files changed, 6 insertions(+), 13 deletions(-) > > > > > > diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c > > > index ee8c79b938d3..dbb4b6f33abb 100644 > > > --- a/drivers/clk/rockchip/clk.c > > > +++ b/drivers/clk/rockchip/clk.c > > > @@ -359,26 +359,21 @@ static struct rockchip_clk_provider *rockchip_clk_init_base( > > > unsigned long nr_clks, bool has_late_clocks) > > > { > > > struct rockchip_clk_provider *ctx; > > > - struct clk **clk_table; > > > struct clk *default_clk_val; > > > int i; > > > > > > default_clk_val = ERR_PTR(has_late_clocks ? -EPROBE_DEFER : -ENOENT); > > > > > > - ctx = kzalloc_obj(struct rockchip_clk_provider); > > > + ctx = kzalloc_flex(*ctx, clk_table, nr_clks); > > > if (!ctx) > > > return ERR_PTR(-ENOMEM); > > > > > > - clk_table = kzalloc_objs(struct clk *, nr_clks); > > > - if (!clk_table) > > > - goto err_free; > > > - > > > for (i = 0; i < nr_clks; ++i) > > > - clk_table[i] = default_clk_val; > > > + ctx->clk_table[i] = default_clk_val; > > > > > > - ctx->reg_base = base; > > > - ctx->clk_data.clks = clk_table; > > > ctx->clk_data.clk_num = nr_clks; > > > + ctx->clk_data.clks = ctx->clk_table; > > > > Where's the __counted_by? Also struct clk_onecell_data is embedded > > inside struct rockchip_clk_provider, and I'm not sure offhand how > > that'll work. > Not present. __counted_by does not work with embedded struct members. > No need to add one IMO. I'll be honest that I'm not sure what's correct here. I added Gustavo since I saw comments from him before about these types of changes. Brian