From: Patrice CHOTARD Date: Wed, 21 Jun 2017 11:18:09 +0000 Subject: [U-Boot] [PATCH v8 02/10] reset: add reset_assert_all() In-Reply-To: <20170621110255.6fa5ea04@karo-electronics.de> References: <1498031424-15931-1-git-send-email-patrice.chotard@st.com> <1498031424-15931-3-git-send-email-patrice.chotard@st.com> <20170621110255.6fa5ea04@karo-electronics.de> Message-ID: <9dc8d910-3af3-87f1-e7f3-a6b2a1c2a3ee@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi On 06/21/2017 11:02 AM, Lothar Waßmann wrote: > Hi, > > On Wed, 21 Jun 2017 09:50:16 +0200 patrice.chotard at st.com wrote: >> From: Patrice Chotard >> >> 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 >