[U-Boot] [PATCH v8 02/10] reset: add reset_assert_all()

Lothar Waßmann LW at KARO-electronics.de
Wed Jun 21 09:02:55 UTC 2017


Hi,

On Wed, 21 Jun 2017 09:50:16 +0200 patrice.chotard at st.com wrote:
> From: Patrice Chotard <patrice.chotard at st.com>
> 
> Add reset_assert_all() method which Request/Assert/Free an
> array of resets signal that has been previously successfully
> requested by reset_get_by_*()
> 
IMO this is a terrible API. The purpose of a request() function is to
mark a resource as in-use, so that it cannot be deallocated or
otherwise destroyed until it is explicitly freed by the user.

It doesn't make any sense to request a resource, perform an action on
it (enable/disable a clock, assert/deasser a reset line, ...) and
free it right away.

The caller of reset_assert_all() should make sure that all reset
resources are requested before calling this function and keep them
requested until after relinquish using them.
The same holds for the clk_disable_all() in your other patch.



Lothar Waßmann


More information about the U-Boot mailing list