Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2851323rwi; Tue, 1 Nov 2022 12:33:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5/pQ2apb4D9wsJeWTdKD3+xrMzQaT5Ic9Dop92W76FbTmFpTdzTfGBk5gBT5uQ0rCM3krv X-Received: by 2002:a63:f452:0:b0:46f:6d7b:3fc9 with SMTP id p18-20020a63f452000000b0046f6d7b3fc9mr18549354pgk.472.1667331231109; Tue, 01 Nov 2022 12:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667331231; cv=none; d=google.com; s=arc-20160816; b=sxlKCd82FL1wok00qeH+EEUjhdgZ1VeeoxU67yajUIF7YalqzslwiQaDrj/3dDs+FK +/w0qQ7/ABhwZ6fIB3cg/YGzt6MDEydhxfKURhKd+P/9BVG2SrFR+BScamiNqFyE8FG6 doIHgH1fkmNn5Tw/qaqm6v2s9ynxosV/Rx17QUKxY9mEPR4LP42hjPWmJqE3o9JgG7h3 oN9RCWOS3V6E1MLbmfeFIx2tA3fR0+Mv65EItccD6Sjr6ldIV+xxdXt78U8eTQ8dHSqi HJvI5SgpLtTk4SoHATRZV1tFmYl6BUEFv6yVgLCOrztQs1QgbEqA/K4VgEtOTuAC8Od4 P56A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=RXNz3aWeIRXYRcjlU6iE3zZHKo5erqeD5FLP62PB+wc=; b=UA89ZaioNHSKcFTsdKxpkPs4QahBO1sj5OQWk+RGaHJO+qZlH7Hyl/OghTwtLNhFap byhLNVjsZrT78UylCGd4UQTVf16uSCfZNdprDt8jC85b17H4rPs5r/QbN85rtEq1vb/J m4eo5EIJQHRRBOpMlvwuQ2rDxv8TET3R7qFY9EluoQIOkHyVPHcgF9zvj0ShfTnPY/PI /cL6ytJh7CLfQaoy89oHOrzQ32jzpcJ/wxwcV558bE1fpESsb/SZu00Z3sUeoNP7h301 iKIZS50pOaXHibYTaM7K+EhsXOek9Szk9AwQM0y3SFjXxvHlkYFYXoJaZ7QCK6Vx1lz7 6OCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I28UVGph; 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 b19-20020a170902ed1300b0017808c0aa8bsi11641973pld.115.2022.11.01.12.33.38; Tue, 01 Nov 2022 12:33:51 -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=I28UVGph; 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 S230184AbiKASfT (ORCPT + 96 others); Tue, 1 Nov 2022 14:35:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbiKASfR (ORCPT ); Tue, 1 Nov 2022 14:35:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761BB1C93D; Tue, 1 Nov 2022 11:35:16 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2CCAEB81EB7; Tue, 1 Nov 2022 18:35:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C63E4C433C1; Tue, 1 Nov 2022 18:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667327713; bh=tP9v1fJaDtSk4ggL7MfdFf2595PWE1zeGgz3m0lWxww=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=I28UVGphwA58whsoZYhoyBnIgNW8RRUJXjw27JWh04PkOCXwK6mf812iENfpja8zQ S25YivMSryWjlZBhUJhUF34zYQXf+pbxA1omOrite234ioSgm6be0n7noCz/DlilFE L0M7XFDWlttv+O4t+UzoRNI+aTGOk50hSuwAS0pDrN0IXUdGZIKLkARB0+QeNY0VKh 1xBmtj0NvU88rkBe34FPlCBNNtDYF05FhjHjFGJEAKCgaP1BmzkdHwAO6RSQF8zhyh /6HWrZn4c1/FkAglvUhe5c0OtFuzvgbZbsuDiBrjCSoghR3X/Jr/O1VWtXQfbrSFQz b9nx8JGWcOjKw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20221018160352.1591428-1-dario.binacchi@amarulasolutions.com> <20221028002710.89A81C43470@smtp.kernel.org> Subject: Re: [PATCH v2] clk: ti: dra7-atl: don't allocate `parent_names' variable From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, Amarula patchwork , michael@amarulasolutions.com, kernel test robot , Allison Randal , Miaoqian Lin , Michael Turquette , Tero Kristo , Thomas Gleixner , Tony Lindgren , linux-clk@vger.kernel.org, linux-omap@vger.kernel.org To: Dario Binacchi Date: Tue, 01 Nov 2022 11:35:11 -0700 User-Agent: alot/0.10 Message-Id: <20221101183513.C63E4C433C1@smtp.kernel.org> X-Spam-Status: No, score=-8.2 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 Quoting Dario Binacchi (2022-10-30 06:00:46) >=20 > I tried to test your suggestions on another platform (I don't have the > hw to test the driver change) but if I > don't add pdata.name =3D of_clk_get_parent_name () the board boot up fail= s. >=20 > As far I can see from the clk_core_populate_parent_map() >=20 > .... > /* Copy everything over because it might be __initdata */ > for (i =3D 0, parent =3D parents; i < num_parents; i++, parent++) { > parent->index =3D -1; > if (parent_names) { > /* throw a WARN if any entries are NULL */ > WARN(!parent_names[i], > "%s: invalid NULL in %s's .parent_names\n", > __func__, core->name); > ret =3D clk_cpy_name(&parent->name, parent_names[i], > true); > } else if (parent_data) { > parent->hw =3D parent_data[i].hw; > parent->index =3D parent_data[i].index; > ret =3D clk_cpy_name(&parent->fw_name, > parent_data[i].fw_name, false); > if (!ret) > ret =3D clk_cpy_name(&parent->name, > parent_data[i].name, > false); > ... >=20 >=20 > The function clk_cpy_name() is called with the parameter "mus_exist" > to true in the path "parent_names" and false > in the path "parent_data". Therefore, in the path "parent_data" it is > allowed that parent-> name is not set. > In doing so, therefore, the change would not even be backward compatible. >=20 > So, IMHO, there are 2 possible options: > 1 okay to use parent_data, but we keep using of_clk_get_parent_name > () to set parent_data::name. > 2 okay to use the version v2 of the patch. >=20 > What do you think? I am confused. The struct clk_parent_data::name being used is whatever string is returned by of_clk_get_parent_name(node, 0). That is the same as setting struct clk_parent_data::index to 0, and not assigning the 'name' or 'fw_name' field of the parent data structure. This is a compatible change because of_clk_get_parent_name() is getting the name of the clk in 'clocks' for 'node' at index 0. Using the index 0 in clk_parent_data tells clk framework that the parent of the clk being registered is the clk in 'clocks' for the 'dev->node' that is passed in during clk_register(). If you don't have a device pointer, use of_clk_hw_register() to pass 'node' directly. It looks like you will have to do that in this case to get the node pointer registered with this clk.