Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5551039rwb; Tue, 22 Nov 2022 01:21:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7j81kj2zG8IxBfrJyw7cIBg9OdM7ogrH1owdYBPQ4H29mdzyWLPT/ZfdqfB5of3Q2TuxWK X-Received: by 2002:aa7:8487:0:b0:56c:3bb4:28a8 with SMTP id u7-20020aa78487000000b0056c3bb428a8mr3194048pfn.83.1669108912256; Tue, 22 Nov 2022 01:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669108912; cv=none; d=google.com; s=arc-20160816; b=0snabFPsk+hf50Wm/BjC4mC/dmpOSyqFqAGn97UFh67tNh12NzPGrIoZEBRcfum5l8 uYaZW+0BtoThkfXj3v1yfBr8lzEyZsCMWhb4VrTskLM2hSBrxsIck8JdfdkNCWbGAUXL DhTrwV8lLDNa8q2XTV1KlO6UIOPqhKh7BbVFOy0s+ZVA1Z2wprWwAfe/kVEHLh4kVWeC /WUkrcY6M/QnfeRRbwIjOJ0wx8yCo+SKtLQSahJ9w5Bv709g/nLqvdS4xLXG3I1Y4kf7 1BK1fQ1wOlXUANO6spKpJZ+VE2IjV6Jual7magSOgWW6JYS7kxtEiEVSz76/idM7jaoY kKmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=U7NY7k+Aa5N9DlhIquG0NmiQoRxU6GJ+N37ltBBWUU4=; b=0lDdQxHAc4TAQs/nIiEkrcJt7X/BBlQEVtvLnPGE4vgsWsq5y6zrL24Uxp2albTuGn W3/8lwzchSdZpZfY8om9AQziuhjVIHKhjXuPx5AWw6wjnP9IT0r6kyWv8G0keiyHAJQ7 YbeUp9fUHygradaD0CvPGo63fr4aBN/eth4HzaUKxhTP61adXQ6e6l3Uf0L/3qkW3Anj F7EiYodsAWuDdm+oraiINzXDR1ypkel1AxoiylKCG1AolI+S8wnrOosWNe5705W6RK0o o+SNN/0nIs+H8MGB6hGw+5LbTzMGEVwONbNaYFP4JyOjceknkCqDmPjNXwcfdb0nv6nh hWHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Py0vsaEj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a6557c5000000b004774a024588si10112888pgr.719.2022.11.22.01.21.40; Tue, 22 Nov 2022 01:21:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Py0vsaEj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232317AbiKVInF (ORCPT + 91 others); Tue, 22 Nov 2022 03:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbiKVImy (ORCPT ); Tue, 22 Nov 2022 03:42:54 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1230A1B8 for ; Tue, 22 Nov 2022 00:42:51 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id h12so17138009ljg.9 for ; Tue, 22 Nov 2022 00:42:51 -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=U7NY7k+Aa5N9DlhIquG0NmiQoRxU6GJ+N37ltBBWUU4=; b=Py0vsaEjCa1ebI9VbLXGCjZoKNk0awz8348fV82HhXMTl+0Up/DS1w2fXqTJo1Fu5h 7tlGWkQh/CldNpiEJXVVjJCywZCfY8CEhWuQ/rAlwxP3cxTvX8J7pCTaMCMWCkt284N6 pONkTaqGA1O2GdydkHB1NwZZpjO7wh8aCobZmOrCNSaNe09u+MiYuVk8mH7C+nXNol0T pwhslqdw7WYV9l7rEtfcjJ7hXMrc7RG1dauk24VmPBmt+ei9za3s17jwmUWIVAcGiv6X KEDDuQYof+4vrTWEX+NtDmwVyxRjLQfgG4y/cB/nNvjpu/nABfehARzgDuPI/qA/f1RO 6OCA== 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=U7NY7k+Aa5N9DlhIquG0NmiQoRxU6GJ+N37ltBBWUU4=; b=RGGO5f7b25z5nm17N5Q3NE6/24xXNk/yOyLPnbcGekaJMhFGmX5X7/mJx6ZJFR8BAg y16wU2ZxnaVu04lUavwCNQE3/m221rSA5kAHZhoy2Wswe6Mo3xO2OK0sgXds+3HDxtI7 NfZyCb4AwkE8OfFC9yVxu9ObBc5eP6jQrYFgAfsTpc5V8WzlRVY7daHsAIhfPqoVrgwL IjAmz86o3TwpY/qHpHislStGf3lSm6FL2RdUFIBOzvFdC0ybBY77Z2u/uRxCs7+LMqh+ mPaBvAi0MH+PuOf97g/zxJdSzTzmNwE18ME8Vs6zaz8ramoY73QCXaovFxduTt8FEZHo AMRA== X-Gm-Message-State: ANoB5pkDX5X5SNYNAMwagVf4I4mhhT2+xOM9HbQBJ+lEyDE2OkD8oP03 ucRsf1o/u5H96hc//TMVSpjNVw== X-Received: by 2002:a2e:aa9f:0:b0:277:710f:f973 with SMTP id bj31-20020a2eaa9f000000b00277710ff973mr7123921ljb.74.1669106570016; Tue, 22 Nov 2022 00:42:50 -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 t3-20020a2e8e63000000b0026fbac7468bsm1703702ljk.103.2022.11.22.00.42.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Nov 2022 00:42:49 -0800 (PST) Message-ID: <191a7f3e-0733-8058-5829-fe170a06dd5a@linaro.org> Date: Tue, 22 Nov 2022 09:42:48 +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> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 22/11/2022 09:25, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Nov 22, 2022 at 8:45 AM Krzysztof Kozlowski > wrote: >> On 21/11/2022 21:46, Geert Uytterhoeven wrote: >>>> This does not change anything. Herve wrote: >>>> >>>>> probe some devices (USB host and probably others) >>>> >>>> Why some can be probed earlier and some not, if there are no >>>> dependencies? If there are dependencies, it's the same case with sysctrl >>>> touching the register bit and the USB controller touching it (as well >>>> via syscon, but that's obvious, I assume). >>>> >>>> Where is the synchronization problem? >>> >>> 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? 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? Broken dependency. What if you want to use this in a different SoC, where the sysctrl does not provide clocks? Broken dependency. You have here in such case parent-child dependency, not provider-consumer. Just like for all serial-protocol engines (I2C/UART/SPI). Best regards, Krzysztof