From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C08BC4321E for ; Tue, 22 Nov 2022 10:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233580AbiKVK0n (ORCPT ); Tue, 22 Nov 2022 05:26:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbiKVK0C (ORCPT ); Tue, 22 Nov 2022 05:26:02 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CFD5A6C5 for ; Tue, 22 Nov 2022 02:23:27 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id c1so22888914lfi.7 for ; Tue, 22 Nov 2022 02:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0Yj0M1bMmbdKFFTTckTCvLOTvIkEcWiR3kfqmSgD6y8=; b=wAZWXtrJYq1AenjRU4kv0MsmrW2tSVFiT1n+v9ooRLoo0kJtrcR8RuK6TZClhUa6D9 u+NtLawrfXsV1u2C37WdIfa27+hzDXBv8NRDYybaxi/w3BHJX/eQSPYpKR/uzx8ZIOdv 0ChGx1jjHC82HW72XfwLrq2mlQWntB8UmEyrwU0dXd+VRtIZD2uE75w6NEfYS3sDk6T/ zuEvfaoHOcacuUxwqZNC4rR/kltP4xe/KBF+8qxPd4BPhDdHL9amhspCUaeD+JDX+K4B 9awLFmU5hiYNucDapSabsshzkDPURMmgdJhbKrjabfDq9upQ1Bn5jmqiD3u/wJERjHBA AyPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0Yj0M1bMmbdKFFTTckTCvLOTvIkEcWiR3kfqmSgD6y8=; b=OcfJUHAJkMIk5kD1nlB1qm/YyCoKK0GFjRvT/kQOqPE8j6j3HAyFDNJ18D9+lf0ZYR hBegxkMTCi40u4YgvEJiq1t+lji574pd+D5PgUoprmza+veDAHkA99eb2r+2fBe7Cs+I esG4ti5t/GwVNDZ+2z4luhkZl+uC3694t0Fbpyk4Wl/YzOaxqeXBht+M/DQFfWltEp8E ie+W46JElkKXQpRa0lX64InqAtwVBvI84P0tIvoo1UpKd33zBfhCDn3Es3tWwaVtqFcw 2mz5rk3dyszBaiIPAq1NfOonQz3zQB+pPu/QISdkB8WSaPWnPNQWkUcvTtPDEeSCZyjf XMSA== X-Gm-Message-State: ANoB5pk/dQkVEB7NuDnD8kdMSAFuvdh52hc4JXIlcI02/oKzNoJ31Db4 bQvcbDAnF973S+r9CgjwNgycAg== X-Google-Smtp-Source: AA0mqf5pd8PVIs8/Ql6U/zFqZV1tfqOoykt04iqd21gEWRtqayriGev9ZhmOeMT5nGB6uP9ivuQ9Sw== X-Received: by 2002:a19:6406:0:b0:4b4:e438:e753 with SMTP id y6-20020a196406000000b004b4e438e753mr241230lfb.460.1669112605677; Tue, 22 Nov 2022 02:23:25 -0800 (PST) Received: from [192.168.0.20] (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id o15-20020ac24bcf000000b004b1907d85e9sm2440982lfq.161.2022.11.22.02.23.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Nov 2022 02:23:25 -0800 (PST) Message-ID: <978fb5a1-64f3-7ee6-3e98-1e31b8b6a88b@linaro.org> Date: Tue, 22 Nov 2022 11:23:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 2/7] dt-bindings: clock: renesas,r9a06g032-sysctrl: Add h2mode property Content-Language: en-US To: Geert Uytterhoeven Cc: Herve Codina , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Greg Kroah-Hartman , Magnus Damm , Gareth Williams , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Thomas Petazzoni , Miquel Raynal References: <20221114111513.1436165-1-herve.codina@bootlin.com> <20221114111513.1436165-3-herve.codina@bootlin.com> <20221115150417.513955a7@bootlin.com> <20221118112349.7f09eefb@bootlin.com> <20221121165921.559d6538@bootlin.com> <4e54bfb4-bb67-73b8-f58f-56797c5925d3@linaro.org> <1f12883b-1e37-7f2b-f9e9-c8bad290a133@linaro.org> <191a7f3e-0733-8058-5829-fe170a06dd5a@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 22/11/2022 10:01, Geert Uytterhoeven wrote: >>>>> The h2mode bit (and probably a few other controls we haven't figured out >>>>> yet) in the sysctrl must be set before any of the USB devices is active. >>>>> Hence it's safest for the sysctrl to do this before any of the USB drivers >>>>> probes. >>>> >>>> Again, this does not differ from many, many of other devices. All of >>>> them must set something in system controller block, before they start >>>> operating (or at specific time). It's exactly the same everywhere. >>> >>> The issue here is that there are two _different drivers_ (USB host >>> and device). When both are modular, and the driver that depends on the >>> sysctrl setting is loaded second, you have a problem: the sysctrl change >>> must not be done when the first driver is already using the hardware. >>> >>> Hence the sysctrl driver should take care of it itself during early >>> initialization (it's the main clock controller, so it's a dependency >>> for all other I/O device drivers). >> >> I assumed you have there bit for the first device (which can switch >> between USB host and USB device) to choose appropriate mode. The >> bindings also expressed this - "the USBs are". Never said anything about >> dependency between these USBs. >> >> Are you saying that the mode for first device cannot be changed once the >> second device (which is only host) is started? IOW, the mode setup must >> happen before any of these devices are started? > > Exactly. > >> Anyway with sysctrl approach you will have dependency and you cannot >> rely on clock provider-consumer relationship to order that dependency. >> What if you make all clocks on and do not take any clocks in USB device? > > Enabling the clocks does not have anything to do with this ordering. That was the argument from Herve, that ordering is guaranteed by clocks. > Clock consumers that are part of the clock domain are probed after > clock providers. If the clock is missing, that would be an incorrect > description in DTS. If not clocks, what else is guaranteeing the ordering? You did not express it in DT. Best regards, Krzysztof