
Hi
On 06/21/2017 11:02 AM, Lothar Waßmann wrote:
Hi,
On Wed, 21 Jun 2017 09:50:16 +0200 patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@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.
Following your remark in patch 7, i have started to rework this API as you described here by removing the request in reset_assert_all() and in clock_disable_all(). I agree it makes no sense.
It will be fixed in the v9
Thanks
Patrice
Lothar Waßmann