Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp786836iob; Thu, 28 Apr 2022 11:12:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZKdYhkM5SbVMomYZudc0OeNyPceTG/XbFXYDidFXhTOvrgoVtGVLsfPW76oj7OobWfMEG X-Received: by 2002:a62:33c2:0:b0:50d:a588:daab with SMTP id z185-20020a6233c2000000b0050da588daabmr1745258pfz.31.1651169550734; Thu, 28 Apr 2022 11:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651169550; cv=none; d=google.com; s=arc-20160816; b=KkaDPBEJeCCiz1mV4KXfmWNk0U46KpPc0ZoTXL3+CAlqJ/PP1Vve1bKNkkw1eOW5Ps YYqpD9ZjRLKKuxtZojyzQDOPmEsSyFrd+4VpH6+97aGhAcFd+RWL2+Yo5oZkpAIKx6od m7EDdxdJmC62w060e2ST7LacFq68hzIgP9QPCGFBQdiEQoaWEPm+hBlrazuWbFzpFDPt mF/2+0WGhwhnx5Um3gTJVLvnJZUyCGcI4psjJdLXntuHCER4Z0swYXO3ORtlsEb4ihiX ng5bGaR3oGaK0uRkhKD60TWrJuJK50tvk8uTEsHXgRkLAGT9S3RsDVDw1rVyuN01ZOkW Q6QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ITTbcKtdFY7WuACtSkBA9utvbuAaKdDqpb9H1W8PiI4=; b=ZggnWU4Ci2auW6so/nNZtKjl40+ccabaoEasBfFfFmHxlQQOoHaqp+x2Wlqdg226Z5 fN5P4jxaZLumMhi3ljUT7TdvRJ0KTYsZZLQLsM8mkHuwgG3uBeH/d/JcyU9EgoYmfhUu wkt7WJ6QQ06w2mklNWIKBa6GB0Fdtr8aA4Q0vA1s4sXdx5JjGn6Dp2HTe6sLs+VSJfM9 zXnD6VFyW0+PQnSQjt6/vG308YvxAlchaw/aPbMGwOOk47lwwK+2ctE0MUp1KDmKg35y 2sGuMwobsIO/Xu9AVc1m0nFc/y+E/q2+uTFlsM7uT+wTp17V8ajRsXaDRmiQiWnEatHx mC0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gydywKUF; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a170902d18b00b00158d6dbbfc2si4415092plb.145.2022.04.28.11.12.14; Thu, 28 Apr 2022 11:12:30 -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=@kernel.org header.s=k20201202 header.b=gydywKUF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349838AbiD1QSh (ORCPT + 99 others); Thu, 28 Apr 2022 12:18:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349842AbiD1QSf (ORCPT ); Thu, 28 Apr 2022 12:18:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 469C327B3F; Thu, 28 Apr 2022 09:15:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D1095CE2C22; Thu, 28 Apr 2022 16:15:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EA33C385A9; Thu, 28 Apr 2022 16:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651162514; bh=ITjlQ9g4B0gG723l683GuIOlpyn+saWXawbyT3upTSg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gydywKUF2PJ/Z+XCGdoURVO8Xu7MmunrcWN9ck3aC2UWj3xv/rAFHrMc4EA/Rb3/g dpRe75K6y46Jm5gEMux0dZl+qGHCu6SgDVHxR+6OeoY/VH6vWGB61e3ooREjaRPoDF b6eNMdhrK8W0V27HcoUtdk7zEVgndcfj+zezhqU9zGS1ZJY/ORJ0RvQcYBjATn2U/0 IWLRejijOuO0bm5NVM0tvkj8USH6xGeqbiCQvpIz66SCo4YhlchLlGs/fWJ1TyITAE YFBhzjpF20pQe0PViDJD6TjSha4laT9JglwvI1kJJTrUH2Pm2c2KBmtmc5YE+n5U8L X2GQCoMzYH5vg== Received: by mail-pf1-f171.google.com with SMTP id i24so4653790pfa.7; Thu, 28 Apr 2022 09:15:14 -0700 (PDT) X-Gm-Message-State: AOAM532HxKbiX8wR6Znr2RE2zqlankTqkY+dFV3AnTHHAe/wcJ+vhNDu 9hcEZr2hygWada0EXvOSAEnZ3Kq5LgakA2x+uw== X-Received: by 2002:a63:ff4b:0:b0:3aa:3083:5131 with SMTP id s11-20020a63ff4b000000b003aa30835131mr29087326pgk.148.1651162513664; Thu, 28 Apr 2022 09:15:13 -0700 (PDT) MIME-Version: 1.0 References: <20220421102041.17345-1-johan+linaro@kernel.org> <20220421102041.17345-2-johan+linaro@kernel.org> In-Reply-To: From: Rob Herring Date: Thu, 28 Apr 2022 11:15:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 1/5] phy: qcom-qmp: add support for pipe clock muxing To: Dmitry Baryshkov Cc: Johan Hovold , Johan Hovold , Andy Gross , Bjorn Andersson , Lorenzo Pieralisi , Kishon Vijay Abraham I , Vinod Koul , Stephen Boyd , Krzysztof Kozlowski , Stanimir Varbanov , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Prasad Malisetty , linux-arm-msm , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , PCI , "open list:GENERIC PHY FRAMEWORK" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, Apr 22, 2022 at 5:35 AM Dmitry Baryshkov wrote: > > On Fri, 22 Apr 2022 at 13:20, Johan Hovold wrote: > > > > On Thu, Apr 21, 2022 at 02:08:27PM +0300, Dmitry Baryshkov wrote: > > > On 21/04/2022 13:20, Johan Hovold wrote: > > > > Some QMP PHYs need to remux to their pipe clock input to the pipe clock > > > > output generated by the PHY before powering on the PHY and restore the > > > > default source during power down. > > > > > > > > Add support for an optional pipe clock mux which will be reparented to > > > > the generated pipe clock before powering on the PHY and restored to the > > > > default reference source on power off. > > > > > > > > Signed-off-by: Johan Hovold [...] > > > > + } else { > > > > + qphy->piperef_clk = of_clk_get_by_name(np, "ref"); > > > > + if (IS_ERR(qphy->piperef_clk)) { > > > > + ret = PTR_ERR(qphy->piperef_clk); > > > > + return dev_err_probe(dev, ret, > > > > + "failed to get lane%d piperef_clk\n", > > > > + id); > > > > + } > > > > + } > > > > + > > > > > > As a second thought. > > > This needs to be more explicit. If the chipset requires the pipe clock > > > remuxing, we must fail if the clocks were not provided. So depending on > > > the qmp instance/property the driver should either use devm_clk_get() > > > (instead of _optional) or skip this block completely. > > > > No, the kernel is not a DT validator (and we have the YAML bindings for > > that now). > > It is not about DT validation. It is about passing a correct DT. The > file can come up from the kernel. It can come from the older kernel. > OR it can come from the vendor. Or it even might be being a part of > firmware flashed into the device. As of dtschema 2022.03, validation of dtb's from firmware (or anywhere else) is supported. Of course, as the old saying goes, if it's not upstream, it doesn't exist. We can't control what vendors do in their DTs. > So we can not assume that the DT is correct just because the in-kernel > DT passes YAML validation. I agree with Johan on this. In terms of ensuring correctness, the kernel does a horrible job. It never will be as long as it is done in ad hoc code. > So, as I wrote, the whole patchset needs much more care about compatibility. > > > > But this will not work with earlier DTS files. > > > > So this is not a problem (but if we really wanted to have the driver > > validate the DT it can be done by updating the compatible strings). > > We should not update compatible strings just because the driver > changes. Compat strings describe the hardware, not the Linux point of > view on it. Yes and no. It is the OS/client view of the h/w. If a binding is deemed horribly broken we could do a new compatible string and binding. That's not something we want to be doing frequently though. Rob