Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2693322iog; Mon, 20 Jun 2022 02:36:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u26XsJIwqvgMP8bBxfRtso5OKVzt3Ao0HWxG7BHPClJaUlRMTt/TEG5UG+jvdM9J8govmv X-Received: by 2002:a05:6402:3608:b0:435:4a91:9ce2 with SMTP id el8-20020a056402360800b004354a919ce2mr23911526edb.342.1655717765387; Mon, 20 Jun 2022 02:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655717765; cv=none; d=google.com; s=arc-20160816; b=VfuRxjGKSJUzQVIc/GUFumbKdWmXhPrdR2Z9TILIKyUTXwCRxVafR0g2k6R74nUiZn L5jjJW4/Cr6ZpiDzGz9z/06tjdDYaV9PSLFP/tp93hIG7dW+LnNzlF92xyFDA4U03ELW JQH5CkGrGLXRb2nfqoOuMMlH/+wTZQpUPdnHxGnNGPMPMkwe7r5hUKmRpCs5RCIuM0nq /5yA6m6xthj5VT0e2MoKoUtEFyONyW17GNciAhvk0Dm2noIYpKT9w8xt8dsRn0INfhdu 7CWSLKJTTGM5agZXNCjmHhkDEuvPxVDUl0aG8B23Xuu0bkBqZ7pHJO9hhErp7GvR4ueP ttUA== 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=l921OzWrKWAkvgffalKJcegxOLa36ztSxqMp8PQLuKE=; b=ivpXWmEszMJ59qEK7xx1bkcusJv/Ctj3FlGQegudEjAnhrEFW7R4allRlubhNzs+bo D52UjHnFkO0oG2ByiGY9/ENTqkpKynzDmIIPrPvVw5YQt/zn3PzUCWQgQdPGvR9600G3 2fBwNbemXGnfzyRJNLyTIKes0PjzKdfMWUK/KmmINarZQDzfYtnKXXlw4jmBtmjKDw+6 iILkfD0lD0SyedthAl3IDnyU6PqJMbOCcI9TevdsL09exD3la+j8zX73ZqpFRrfME4Ws AAVAVCXlstXR9K896tzRUG2YKYkPLzKp7y5NNHzCaIPrrl9zgk7GFfmr2M79/BXboD9L zBsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K8YhUSw2; 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 g16-20020a170906c19000b006fefb80f6cfsi11909338ejz.413.2022.06.20.02.35.37; Mon, 20 Jun 2022 02:36:05 -0700 (PDT) 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=K8YhUSw2; 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 S240075AbiFTIvF (ORCPT + 99 others); Mon, 20 Jun 2022 04:51:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240065AbiFTIvD (ORCPT ); Mon, 20 Jun 2022 04:51:03 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F41612D05 for ; Mon, 20 Jun 2022 01:51:01 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id u12so19673041eja.8 for ; Mon, 20 Jun 2022 01:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=l921OzWrKWAkvgffalKJcegxOLa36ztSxqMp8PQLuKE=; b=K8YhUSw2j90oN35WVE7NTJrtHV0dTZB20ol4mTQLyuO94nvyW83AU6qr2lg51vXODD o9R3B4RVANHBRkwyy5TbfSI5mdDhNLzseI0fobTy4UBH7yf9wD34/VB0ukydEmAnDfEM r6RAuE4N+pbS9G/7F5TcxO3zeAPrHW3QK7tL8XYJ1N5qLb5Z4l5makzcW+3y4rT+aUMZ 5ZICp0zJ7tQCeNGS4S2hCy54OrzCp0unX7VKSKximXDZomJApbztoGxg0RIc7KDgsDsy m9yTbwwjbzu1OkI5yydxa1OjRCcqzZsnk2F0p2yKA+eyL3eUr1/iWAjbNiwlkdLcj0jT 6N1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=l921OzWrKWAkvgffalKJcegxOLa36ztSxqMp8PQLuKE=; b=1BbqbUxrFV7/5RCwAcs9nhOrZ1RpR65TK3Fd/oEUXl8ZPA/tZwPkII/vL9bkM7tnyt DMI29D22BFjB6NtrDZACl1gRsLcCSSy3ahbhXRvHKlxjXWHnfR97U+AuVcRriS7lnGE2 +yG18KufjDrwtA4F60KVUX6bpf9c2d/oY0Gi1v30gwxt0qsrnZ9pbPI/rvlqko2m0HbI ZPrljw/Lh4KvX3aR/1zeFCVRqyuKcIPVabN3+ME1fUjCgbBF38b5Jcsmr4tlwRFuGmCv oFVAvqQzXl7blPwOPQO/RLlOu8wwlYw2r23dvtOcmrEranchBlX0PI6PBDGdhsef0wio 2/HA== X-Gm-Message-State: AJIora+pHym7XHAKQ0Z5yPtHc/kSHaPY5mBx/N/wZcuzDe7KAnNp5/x8 0CqaTkbxKXQhmgS+dotNNfXeqw== X-Received: by 2002:a17:907:16a2:b0:711:d048:7d41 with SMTP id hc34-20020a17090716a200b00711d0487d41mr20355368ejc.126.1655715059676; Mon, 20 Jun 2022 01:50:59 -0700 (PDT) Received: from [192.168.0.207] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id ff10-20020a1709069c0a00b006fec69696a0sm5512140ejc.220.2022.06.20.01.50.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jun 2022 01:50:59 -0700 (PDT) Message-ID: Date: Mon, 20 Jun 2022 10:50:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Content-Language: en-US To: Chunfeng Yun , =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Greg Kroah-Hartman , Matthias Brugger Cc: AngeloGioacchino Del Regno , kernel@collabora.com, Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-usb@vger.kernel.org References: <20220617222916.2435618-1-nfraprado@collabora.com> <20220617222916.2435618-3-nfraprado@collabora.com> <8639e64d-c659-7090-2d0a-078fd96cfbd4@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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 20/06/2022 08:59, Chunfeng Yun wrote: > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: >> On 19/06/2022 09:46, Chunfeng Yun wrote: >>> On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: >>>> On 17/06/2022 15:29, NĂ­colas F. R. A. Prado wrote: >>>>> The current clock list in the binding doesn't allow for one of >>>>> the >>>>> optional clocks to be missing and a subsequent clock to be >>>>> present. >>>>> An >>>>> example where this is an issue is in mt8192.dtsi, which has >>>>> "sys_ck", >>>>> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. >>>>> >>>>> Change the clock list in a way that allows the middle optional >>>>> clocks to >>>>> be missing, while still guaranteeing a fixed order. The >>>>> "ref_ck" is >>>>> kept >>>>> as a const even though it is optional for simplicity, since it >>>>> is >>>>> present in all current dts files. >>>>> >>>>> Signed-off-by: NĂ­colas F. R. A. Prado >>>>> --- >>>>> >>>>> .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 >>>>> +++++++-- >>>>> 1 file changed, 7 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git >>>>> a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> index 63cbc2b62d18..99a1b233ec90 100644 >>>>> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> @@ -80,8 +80,13 @@ properties: >>>>> items: >>>>> - const: sys_ck # required, the following ones are >>>>> optional >>>>> - const: ref_ck >>>>> - - const: mcu_ck >>>>> - - const: dma_ck >>>>> + - enum: >>>>> + - mcu_ck >>>>> + - dma_ck >>>>> + - xhci_ck >>>>> + - enum: >>>>> + - dma_ck >>>>> + - xhci_ck >>>>> - const: xhci_ck >>>> >>>> You allow now almost any order here, including incorrect like >>>> sys,ref,xhci,xhci,xhci. >>>> >>>> The order of clocks has to be fixed and we cannot allow >>>> flexibility. >>>> Are >>>> you sure that these clocks are actually optional (not wired to >>>> the >>>> device)? >>> >>> In fact, these optional clocks are fixed, due to no gates are >>> provided, >>> SW can't control them by CCF; >>> In this case, I usually use a fixed clock, or ignore it. >> >> But in some versions these clocks are controllable or not? > Some SoCs are controllable, some ones are not (fixed clock). Thanks for confirming. Then I would prefer to make these clocks required (not optional) and always provide them - via common clock framework or fixed-clock. Best regards, Krzysztof