Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2D68C19F2A for ; Thu, 11 Aug 2022 16:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zjV6Qd1l1piSauPVFO3x2IbiJGS1/8iACxoO1e58/mE=; b=1VvZkCJCyxewJB xFDbd+qOZ9BUz9ghONZsA3ngIX8M9N3lfuV71RU1HTFzt9HlwRKjSYHH33pzTU7HkaBCvet1NX/nS oreQkHhAizaXRTqAPHKuspZxHYc+XBB68q4BuCm3YL3ALc+nE5CS8se82NwK/qgqmMMdAqs/EUZvS u3SQ5nievhK0wY1iOr9ZmUdpyVNSVFHwZZE8iHnoLBbq1MkRbjf/gbbhlvcHCE3BjxH7Iqb8Mq5fl YvOa7H5UgkkZqY+LLoEwF+DdqviqpjmeArUlDbO/ZBrareEtEkm7Or0n8ePH2WlvBenfS3VxQCy4g m3GJ8JU/ZDBs9lIxbH6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMBCy-00FBoW-Pk; Thu, 11 Aug 2022 16:38:56 +0000 Received: from phobos.denx.de ([2a01:238:438b:c500:173d:9f52:ddab:ee01]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMBCu-00FBjz-Mc for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 16:38:54 +0000 Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 3D66F84A0B; Thu, 11 Aug 2022 18:38:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1660235931; bh=p4mM/BKe1QN2ts+Wny9BSbIpYIGA/uyyXIwk1shGQn4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bnWcL57HUg78o3thC1nLShJ+IoNy5PAgj8RYXemKSVM+YzJPTuKPm3P6Zm0LrePCf J2UEPBIMqr7DxNu+fv1QDu3u1TIhdqeu7WAwBcShFihubJsA5XR3Z8aX987HgSo2df omM+guuURHXA4rym5zPemM5adKYp42QE4kN+q7EYBjbuXiuqM9TpttAbmRS3ptIJ1y FpIYmO7P13whHGEBrrk2DsFsv9mm/XAO2nKTUTrsB4KUE0U/ezQT/ZJx8sMVQEAJRy v/DFJAB0N4inBxmGIBXlcX1XAY//ndjYk9jjhYYA3uCPY4sw0R/Vi+4pNgoSFcSovn UmOoercV7Uy4Q== Message-ID: <9e56dc70-e489-7288-784c-289da9325ed1@denx.de> Date: Thu, 11 Aug 2022 18:38:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3 3/6] clk: imx: imx8mp: Add audiomix block control Content-Language: en-US To: Abel Vesa Cc: Peng Fan , Lucas Stach , "linux-clk@vger.kernel.org" , Abel Vesa , Fabio Estevam , Jacky Bai , Laurent Pinchart , Michael Turquette , Shawn Guo , Stephen Boyd , "linux-arm-kernel@lists.infradead.org" , dl-linux-imx References: <20220625013235.710346-1-marex@denx.de> <20220625013235.710346-3-marex@denx.de> <66f689d9-a691-8bf6-62a2-48fac6eb3938@denx.de> <8d3fcbd9-2fd0-bf90-afa0-a21a79c81dbb@denx.de> <0255ea59-fb70-4dc6-6477-5531981366e1@denx.de> From: Marek Vasut In-Reply-To: X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220811_093853_150319_237E1239 X-CRM114-Status: GOOD ( 19.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/11/22 17:03, Abel Vesa wrote: > On 22-08-11 16:30:20, Marek Vasut wrote: >> On 8/11/22 16:20, Abel Vesa wrote: >>> On 22-08-04 11:31:33, Marek Vasut wrote: >>>> On 8/4/22 11:13, Peng Fan wrote: >>>>>> Subject: Re: [PATCH v3 3/6] clk: imx: imx8mp: Add audiomix block control >>>>>> >>>>>> On 6/28/22 09:44, Abel Vesa wrote: >>>>>>> On 22-06-27 18:23:33, Marek Vasut wrote: >>>>>>>> On 6/27/22 17:35, Abel Vesa wrote: >>>>>>>>> On 22-06-25 03:32:32, Marek Vasut wrote: >>>>>>>>>> Unlike the other block control IPs in i.MX8M, the audiomix is >>>>>>>>>> mostly a series of clock gates and muxes. Model it as a large >>>>>>>>>> static table of gates and muxes with one exception, which is the >>>>>>>>>> PLL14xx . The PLL14xx SAI PLL has to be registered separately. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Again, there is a chance that the blk-ctrl driver might disable the >>>>>>>>> PD from under this. >>>>>>>> >>>>>>>> Can you elaborate a bit more on this ? How/why do you think so ? >>>>>>> >>>>>>> At some point, the PDs from the Audiomix IP block will be added to the >>>>>>> drivers/soc/imx/imx8mp-blk-ctrl.c. Then, you'll have 2 drivers with >>>>>>> the same address range and the imx8mp-blk-ctrl also has runtime PM >>>>>> enabled. >>>>>> >>>>>> Why would the PDs be added into the block control driver? >>>>>> >>>>>> The audiomix is purely a clock mux driver, not really a block control driver >>>>>> providing PDs of its own. >>>>> >>>>> I recalled that with with blk-ctrl working as clock provider, there is dead lock >>>>> issue, if the blk-ctrl node has a power-domain entry. Not very sure. >>>> >>>> How can I verify that ? Lockdep ? >>>> >>>> I run this series for months and haven't seen a lock up or splat. >>> >>> Audiomix (and every mix actually) has a PD. Once you add the PD, you'll >>> end up with an ABBA deadlock between genpd lock and clock prepare lock. >> >> Unlike the other mix drivers, this is a pure clock driver, not a power >> domain driver. The PD is already available to this clock driver, see: >> [PATCH v3 5/6] arm64: dts: imx8mp: Add SAI, SDMA, AudioMIX > > When you will enable the runtime PM for this driver, the deadlock is > going to happen and it will be in some scenario like: > clk_disable_unused_subtree > -> clk_prepare (takes prepare lock) (for a clock from your driver) > -> runtime pm (takes genpd lock) > -> clk_prepare (tries to take prepare lock again) (for the clock of the PD) Since you seem to have a test case, can you share the test case, verbatim, so I can reproduce it locally ? I seem to be asking for that repeatedly and I am not getting any clear answer. >> Can you please elaborate on the deadlock problem ? >> Because really, I just don't see it. >> >> Were you able to reproduce the deadlock with this driver ? [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel