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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73312EB64DD for ; Tue, 11 Jul 2023 14:28:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EC648683A; Tue, 11 Jul 2023 16:28:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HNWy/ajW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B806286868; Tue, 11 Jul 2023 16:28:47 +0200 (CEST) Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 37AEE8681B for ; Tue, 11 Jul 2023 16:28:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-635de022557so39503256d6.0 for ; Tue, 11 Jul 2023 07:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689085724; x=1691677724; 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=DD/IisU95YlqrO/F2ZRslG1ebDb1KS+ob6koIXPevEs=; b=HNWy/ajWp4JbE1LVGbj9N45tQiZ34CEHUn1SWoTr4vO/E23lYGCQp5baUouiuiXy3a VUbhTjw3TxuDcg71s4GsDjMlNJPaNlwtZ0czU2/jihf/OF2TabOxVRUM6xcSl6Vf7mVM JFXmSPcsq2NPkuoVTiMOMmRsGFx0F3VS+kmr2Ruwu60PYp8+m8jj7vXh8e3f6mVL9O3D EePPcBIL8zPoPIYaozkeDK9BcxW0MkwrTT6bK7i9/40wczSRCKjnrg4OL5lo1f1tdlvQ eNJidINtbworqLlgn6TPl+wz0KYNQeCt8H1VFpgyDlgE1rPFQfBApE+/PGR2VYAWHeaf JONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689085724; x=1691677724; 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=DD/IisU95YlqrO/F2ZRslG1ebDb1KS+ob6koIXPevEs=; b=MGJ9Nw9PxtafErK+X1F6MLhGZxX82/ZF263CheAvY4KpVFUOV73OGJkiEKShLVnAwq T2PpNdBrO7PqnNMsPy8gRmFHDCxnyRxzzCKH8cQKr+Run5LAMfCeE5WSID6Prg4ezBmh 4f2WRWwGzq+UU0nUY61DX8/6mEV/IAPf1CS49VL0jSjbFhrRTcxoWR+duzkXCKY7FK4+ pTEpP4vLTxhycYiTy0SdBj/s16/kvzHfBW5mvtlOl7R1Fe6YPJTmOfg38GE9pf3HrYqa 74P6be2F4HOc3+TudlCGkfK5A8NvjvTJvLbSpSiLaTaTd+qGSHl8brL2scqg3jvhMPum 9BDA== X-Gm-Message-State: ABy/qLafCkO2TtKCaXr9NpyaiMEjjfCMlwschfMTi2GzGB2+i2bMfEuo lemK7wZIVwgEkwGRdFTPI/U= X-Google-Smtp-Source: APBJJlGD8v2C5Dajg3teb/x4CGvhTURy8NEgw965BAJNclcDDwm/vQgaw1vKvHF+GNM2MiVYdNqBzg== X-Received: by 2002:a0c:b34b:0:b0:635:ec47:bfa0 with SMTP id a11-20020a0cb34b000000b00635ec47bfa0mr14746318qvf.49.1689085723911; Tue, 11 Jul 2023 07:28:43 -0700 (PDT) Received: from [192.168.1.201] (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with ESMTPSA id t15-20020a0cde0f000000b00636d2482dd4sm1130279qvk.17.2023.07.11.07.28.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jul 2023 07:28:43 -0700 (PDT) Message-ID: <0ee32e50-5131-c3ad-d324-b5063e7d153e@gmail.com> Date: Tue, 11 Jul 2023 10:28:42 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] clk: Dont return error when assigned-clocks is empty or missing Content-Language: en-US To: Michal Simek , Ashok Reddy Soma , u-boot@lists.denx.de Cc: lukma@denx.de, git@amd.com References: <20230711095128.19086-1-ashok.reddy.soma@amd.com> <3c24bf9d-9e29-7315-1e35-00849b4b8a56@gmail.com> <6a8fd4ac-8c5e-91b4-b80f-8e75c0be82f1@amd.com> From: Sean Anderson In-Reply-To: <6a8fd4ac-8c5e-91b4-b80f-8e75c0be82f1@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 7/11/23 10:20, Michal Simek wrote: > Hi Sean, > > On 7/11/23 15:40, Sean Anderson wrote: >> On 7/11/23 05:51, Ashok Reddy Soma wrote: >>> There is a chance that assigned-clock-rates is given and assigned-clocks >>> could be empty. Dont return error in that case, because the probe of the >>> corresponding driver will not be called at all if this fails. >>> Better to continue to look for it and return 0. >> >> No, this is an error in the device tree. assigned-clock-rates depends on >> assigned-clocks, so you must provide the latter if the former is present. > > We were also checking it and in the Linux kernel it is handle like this. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/clk-conf.c#n95 > > It means you can have rate assigned but not assigned-clocks property. > > And yes in working case both should be present to work properly. What is the use-case for this? It will not pass schema checking [1] anyway. --Sean [1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/clock/clock.yaml