Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp239973imm; Mon, 9 Jul 2018 00:28:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJJIBklgNoLt/plaeFKY1GU6DBpYjYRwBhF7SeBI7hHZtjo6S8fnGEcQJYjquEXaWHzI5q X-Received: by 2002:a63:5758:: with SMTP id h24-v6mr17782261pgm.432.1531121312250; Mon, 09 Jul 2018 00:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531121312; cv=none; d=google.com; s=arc-20160816; b=n1Jv3PvWnhqK9JAZigeU7/B8WeWIpfJDuJwUJrY7KLAAJ10+BlQv7bcWeofBEO+Vq7 EEb6rk77sRaQkrDEsb4XcPgICX1JOJJav5A7aioV5SYtDfYi85hIK03Q5pp/kTDfiWth 0G03HKgRUOJfNHMM0ZgTqUvHfnlpEmPIrDad6w355nFEcEFQLOtbE+TBW8ZzL/dK6CBd kZnUEqgbmZJOdcxRt5MDGyP7eA4zUwzA1undtazVGQ2fgIkszhN/RmlV5KAxfI4ff2Rx EhdZb6ekAF5q3L/Zyke2h/krBQW6B6ULvrUmv/3icGRXyDaFHHJ7Mk/mZyHa5BLAcTTU RsdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=hg+BmS52k986d7JagtwTDxMfQDUipcIH+h9+QaAaNDo=; b=qFpDnGN2/n7RFDsdsf7OSDOIZeEodduMIy7J4XfeBdukL7Wr8ntgdkva9qo3OB4qmx sX3lUz3mTEYf1lCMtjsLH2+bNwLkS/+tN3fiKBmdv481h5x0BLzIsGRwzxzy+l1fscms x48pNKinjmUwreUQVBkl+HqDhyIWRSFlkbU34sLVGNU8qnIE+iHoOdszZdj8D5hO0gDF q3QwnChOswhkL7hw3r0cBVAGFtMuReHVlkQtgITJmcc5x8pklHGBcsDWr4M1amMvJKhz 6goXsAiT9zwWCclG47dNF+QRE0OqlQsH0UvBbTq7w+q9xKVsnMF2WGJzSD0TT0eZ+vyr 4VPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CvtB/kkH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d185-v6si14479846pfc.176.2018.07.09.00.28.17; Mon, 09 Jul 2018 00:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CvtB/kkH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S932564AbeGIH0Q (ORCPT + 99 others); Mon, 9 Jul 2018 03:26:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:34178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbeGIH0O (ORCPT ); Mon, 9 Jul 2018 03:26:14 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5242D2089D; Mon, 9 Jul 2018 07:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531121174; bh=gGT61pFC9SsfmJUuGHXlN2T2WHr4ZL3gEXz1uXa9Jeg=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=CvtB/kkHKBpu1KO/dV8EKltB3E+IiH0K7Yx2cRBsvSHz6FmNFSOSty0Je2IuseCOd nLaXzcJoGQ9Ei/7lJacF3pBi0707RaPEVuw056jojwoKS4NoVlmg2dn7XkTDfWUElP xSe5fHK7UuqIS4vat/vr2V6EosG9+YdlocdErTsM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Rajan Vaja From: Stephen Boyd In-Reply-To: Cc: "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jolly Shah , Michal Simek , "mturquette@baylibre.com" References: <1520518500-5500-1-git-send-email-rajanv@xilinx.com> <152061989141.26240.15533446439693285034@swboyd.mtv.corp.google.com> <152113963269.111154.10395846178696174140@swboyd.mtv.corp.google.com> <152792163637.225090.8916381060805852261@swboyd.mtv.corp.google.com> Message-ID: <153112117357.143105.12822043691712705626@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: RE: [PATCH] clk: clk-fixed-factor: Use new macro CLK_OF_DECLARE_DRIVER Date: Mon, 09 Jul 2018 00:26:13 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Rajan Vaja (2018-06-03 20:41:27) > > > > > > On the other hand, even if registration failed, that node will = be > > > > > > marked as OF_POPULATED, so probe of clk-fixed-factor.c will als= o not > > > > > > be called and that DT fixed-factor clock would never be registe= red. > > > > > > > > > > > > Same thing is discussed at https://lkml.org/lkml/2017/6/5/681 . > > > > > > > > > > Ok. I believe the answer is to fix the DT to describe the parent = chain > > > > > properly with clock-output-names. Otherwise, we have no good way = of > > > > > figuring out what the name should be. > > > > [Rajan] clock DT binding doc says that clock-output-names property > > > > is optional and sometimes not recommended. > > > > I think this patch fixes the issue we have which mandates to add cl= ock- > > output- > > > > names > > > > property (for this particular case). Also, IIUC platform driver pro= be in clk- > > fixed- > > > > factor.c > > > > will never be called unless we use CLK_OF_DECLARE_DRIVER. > > > > I completely agree that proper solution would be to stop using stri= ngs to > > > > describe clock topology. > > > [Rajan] Any comments on this? > > > Unless we have proper solution ready, we need to have some mechanism = to > > handle this scenario. > > > clock-output-names is optional and without this, it mandates to use c= lock- > > output-names. > > > > > = > > I couldn't read your outlook sent email and I was too busy to go > > translate it. Some bug in my MUA it seems. > > = > > Can you add the output-names property? In this case it's practically > > mandatory, so if you can't do it I'd like to hear why not. > [Rajan] In our case, we are firmware maintains clock database and driver = query clocks > from firmware and registers clock based on information received from firm= ware. So > output clock names are not fixed. = > https://patchwork.kernel.org/patch/10439893/ - dt-bindings: clock: Add bi= ndings for ZynqMP clock driver > https://patchwork.kernel.org/patch/10439891/ - drivers: clk: Add ZynqMP c= lock driver output-names are fixed by the time firmware is made. Is the DT also fixed by the time firmware is made? Why can't the DT be made to match what the firmware is describing by having the firmware update the DT to describe it's output names? And what is this fixed factor clk in DT for? I'm beginning to think that maybe we should make the fixed factor setup a little worse by having it unmark itself as OF_POPULATED if it finds that the DT node has a clocks property that it can't find a name for. Hopefully we can get by with it registering later on because it isn't critical for the system to bootstrap interrupts and timers. I take it you understand that changing the code to be CLK_OF_DECLARE_DRIVER will be actively bad and cause the clk to be registered potentially twice so we really need to fix the real issue which is that the parent name can't be figured out until later on, so the CLK_OF_DECLARE path needs to fail when it can't find the parent it needs and then manually mark itself as not populated in that case so that it probes later on with the platform device driver. Unmarking the node can actually be used to flag a failure in the init function so that we don't keep trying to do things with the node until driver time too.