Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1618968rda; Mon, 23 Oct 2023 19:59:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFttH/egpSedtCBapEBJnZufz63ALCXjNmswA8CVzwu0HTMKA+VaRtoXaB31k3HlaKphNkG X-Received: by 2002:a05:6a00:1494:b0:6be:3c44:c18b with SMTP id v20-20020a056a00149400b006be3c44c18bmr10226978pfu.25.1698116357653; Mon, 23 Oct 2023 19:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698116357; cv=none; d=google.com; s=arc-20160816; b=kD9MsURA3KcvG3MsdBmP42pGd88gBuZMuZYLbTCa1XuM6bOkjYQ6MkrtaOwwiGgFrk 1aBcAbZwg6dBHOlhYuArnK8zcKZp/4iGlQUYKIhuAPMPW6hh7qzHiKBDOqqrwCgapYZo 5lSVwX5fLQolRB59nMLyg0WT7aptpOyBpjh0cfR12PU3dl/wt7s5AqqG0mFeZD2qY/cL bUV/V1kbMqBGxtgSsLoxCV2mrdgVdCAdxIslOwwsxgF2FcVqpojmxf6rkkrxLgAI7rMq Di5PHP8X4VkB+ekXJsRvylrPQi1YytRkFpeGurJhYhGoG02w56UzKc2AsoAAlWANFg+i Hcmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=q+zOUHNZpyyfySvjLWIAqk44DXAPWzP6dh5SDkzRPYI=; fh=0R2k9PjaeZwhfLcgxtuGfgqVK9TE6dvznS2ObdSdh2c=; b=lBge1pKxl5C1uAjU6TXOEkbZtKzuyKMtzi+sSafH9Z5iNNt0dk+/x6mdaizJ1AtjA+ FWF+EJD9KzHdzX74Bc0zgrNrAgL0hjFdAmw12KHG8DmwJazrAj9of175erqunQoc7jdq qUSjtfSeEiXgAvq4S7pAyEt3IDusrwpEUaspFYDKbMQFEEbJQh7pYE5xXWPanfKDnyJz XE0mxSw2HtCqvx9wMGi9dCy5H1H0B2Vy6jsqs+g6afwSbyBdlr5WXyEee4IbYHiuiOOV J9jQOHFfnEhI7EURsyBjSyQhvYnXg+IyPseV1+O+D3RO6D6kzlkiARxYPHEHkGCdTOMO e8Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=odmdHcyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h9-20020a056a00218900b00690fe0f6e0dsi7777087pfi.68.2023.10.23.19.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 19:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=odmdHcyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EF1FB80C65E0; Mon, 23 Oct 2023 19:59:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232452AbjJXC7N (ORCPT + 99 others); Mon, 23 Oct 2023 22:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbjJXC7M (ORCPT ); Mon, 23 Oct 2023 22:59:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28885120; Mon, 23 Oct 2023 19:59:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B237FC433C7; Tue, 24 Oct 2023 02:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698116344; bh=q+zOUHNZpyyfySvjLWIAqk44DXAPWzP6dh5SDkzRPYI=; h=In-Reply-To:References:Subject:From:To:Date:From; b=odmdHcyty6crbW0U+CjvVuCb+kmm2FHxS0OwOe2smlYNgqAsM2wH893MGTDvNZ6wJ nmt5SD6reBpgTJQ4lwloOChOZwURJ08xI2kVbLklHKq9HrujOORvRRNRnAF//Svu/P Mgq6bCl+jhHEOcsRaSA+fVqmfRzjJ2t2KZVjRGoHejyPVLvdH4z2VS2dhAj4xA5Zjd 2wa2OZCInGrR8Rc843syr1g/qwihWUQvR7nVdELEFOFqgArvKFaeGpU9YObOXQUCZv SbNPGQjOc1FaDis2b86Lo5grKlhwKiLn6R0dQ+eU96ulvuIFGrLfG4KmXarqpOhQKi kpBL2SNyNgouQ== Message-ID: <07937184481af74c65108bae26526605.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <0eebfc14-dbcd-4987-9e94-ea5630b6c268@linaro.org> References: <20231002170021.192740-1-trabarni@gmail.com> <0eebfc14-dbcd-4987-9e94-ea5630b6c268@linaro.org> Subject: Re: [PATCH] clk: qcom: gcc-msm8953: fix stuck gcc_usb30_master_clk From: Stephen Boyd To: Andy Gross , =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= , Bjorn Andersson , Konrad Dybcio , Michael Turquette , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 23 Oct 2023 19:59:02 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 19:59:17 -0700 (PDT) Quoting Konrad Dybcio (2023-10-06 16:50:18) > On 2.10.2023 19:00, Barnab=C3=A1s Cz=C3=A9m=C3=A1n wrote: > > According to downstream dwc3-msm source this clock has FSM dependency on > > gcc_pcnoc_usb30_clk so enabling it would fail if latter isn't enabled. > > This patch add works around this issue by changing parent of > > gcc_usb30_master_clk to gcc_pcnoc_usb30_clk. This is acceptable because > > both clocks have same parent and are branches/gates. > >=20 > > Signed-off-by: Barnab=C3=A1s Cz=C3=A9m=C3=A1n > > --- > "meh" >=20 > There are multiple cases, especially with qcom, where there are some > magic "dependencies" without parent-child relationship. The common > clock framework doesn't currently have any good way to handle this, > other than some mind gymnastics like you had to do here with matching > them against a common parent/ancestor.. >=20 > Stephen, what do you say? >=20 You can't change the parent to be not the actual parent. The consumer of the branch probably wants to call clk_set_rate() on the branch and have it propagate up to the parent to set the actual rate. Can the axi clk simply be left enabled all the time? That seems simpler. Otherwise we probably need to leave the axi clk control to the interconnect driver and make sure drivers enable interconnects before enabling this branch. When things start to get this tangled I tend to think that we need to remove control of the clk from the general drivers and put the logic to control interconnects and clks into some SoC glue driver and expose a single interface, like genpd power_on/power_off so that general drivers can't get the sequence of steps wrong. Instead all they can do is "power on" their device, and the SoC glue driver can do the proper sequence of framework calls to power up the device.