lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFBinCBy7vPq0oX0PQ=yC5E3Mx3sv6qdVHsMh-NQQzAkbDuvRQ@mail.gmail.com>
Date: Sat, 8 Nov 2025 23:53:07 +0100
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: zhentao.guo@...ogic.com
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	Neil Armstrong <neil.armstrong@...aro.org>, Kevin Hilman <khilman@...libre.com>, 
	Jerome Brunet <jbrunet@...libre.com>, linux-media@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-amlogic@...ts.infradead.org
Subject: Re: [PATCH 3/3] decoder: Add V4L2 stateless H.264 decoder driver

Hello,

thank you for your work on this!

On Mon, Oct 27, 2025 at 6:42 AM Zhentao Guo via B4 Relay
<devnull+zhentao.guo.amlogic.com@...nel.org> wrote:
[...]
+/**
+ * enum aml_power_type_e - Type of decoder power.
+ */
+enum aml_power_type_e {
+       AML_PM_PD = 0,
+};
Are there any other power types that you are already aware of - or is
this added "just in case" an additional type is needed in future?

> +/**
> + * struct gate_switch_node - clock node definition
> + * @clk: Pointer to clk instance.
> + * @name: Clock name used.
> + * @mutex: Mutex lock for multi decoder instance.
> + * @ref_count: Curr clk instance ref count.
> + */
> +struct gate_switch_node {
> +       struct clk *clk;
> +       const char *name;
> +       struct mutex mutex;
> +       int ref_count;
> +};
Generally I'm not sure if the whole struct is needed as I think the
common clock framework has everything we need.
There's struct clk_bulk_data which allows mapping clocks from
device-tree to an array in the code.

drivers/staging/media/starfive/camss/stf-camss.h for defines an enum
(stf_clk) to access each of the clocks by it's index in the array.
You even seem to have an enum (clk_type_e) which you could use to
simplify the code.

My understanding is that one can call clk_prepare_enable() and
clk_disable_unprepare() as often as you'd like and these functions
will do the ref-counting internally.
So I think the ref_count is not explicitly needed, as that's managed
by the common clock framework.


Best regards,
Martin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ