From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5877DC05027 for ; Fri, 20 Jan 2023 21:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjATV72 (ORCPT ); Fri, 20 Jan 2023 16:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjATV71 (ORCPT ); Fri, 20 Jan 2023 16:59:27 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC79480BB0 for ; Fri, 20 Jan 2023 13:59:25 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id ud5so17331029ejc.4 for ; Fri, 20 Jan 2023 13:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=Pgs07PyvKGpksByKsjTcCowCL5vvFmT3PIciH90Z4pw=; b=eCe81CaotE8487LI7h3iOTTOKUpUcN9XtqW0R8o/FODQE7Vtjzho8V2Smabu7KZsK5 zGak5XpliKLCQLiGjO/MjdJ/G6SA7YaFAvb78Q/t2KYXAbahWabv58FleHHpSwCyY8f8 flo7845GTH3md4yWcpVbDz6c4ufGOZ7K1O+ZqOXobq7hoy2He/o/LcqdZUe/w4e7KNPt mbwy0OKJN2v/TTXip1EdzRC0dB8ZMGIKk+QbJqZYXeRUKP3O0Cd1Ub0mzBL57X6udEqS fzGqre/RAntbnKiCiGoVj1t4rUsvSk/Lmv94Lh7+6Y6Ds6X6mknYjnf6NPRCDYJsCQOQ /VcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Pgs07PyvKGpksByKsjTcCowCL5vvFmT3PIciH90Z4pw=; b=R6dmpXxif8Z8oRUS5UAxjN/6mVIOYhViEO07jM4rAaUtIAzYHhltTL5fo0/230pgfh 7pGjAhXFUy43cEOJnCMRQAiqfr533B5UZuqAyJaw7kqZCEIB29oZuE0MVmCG8wkt9kIh MYcBg5YfW3KKjFoTSgahdoWlBcfTqYgjCsciftfz/I5KcHBDtJ2NjdSlGWQ1BmKipBPs j6Nd+dhUUqqEAghiPSrxuZrNZ3S2mliAKLfwpLapAEnTVVc9JHeFjEXQFoCxGc6BOrf5 oVX6DcAdxF1JDtNns6r2k/Qoyjayuzi2t02vdMH7tF5KhS6l/syLNgIQ2y6uJpKovHNK YIbw== X-Gm-Message-State: AFqh2krCUZEmO/SJpHspkdP8tw7gTUKj931wiYDlsHEWSp0ZggZ1ffPa 9VjoOFI6+Knjl0sJSsvD1pDJag== X-Google-Smtp-Source: AMrXdXujuKX9GQSph4XmO5ic2WuK/rHBTeeAl+cwTJR3B0pg8Uv+i3g+jYyo+jTzU4z5DLTg15lZXQ== X-Received: by 2002:a17:907:94ce:b0:870:ab89:3dd3 with SMTP id dn14-20020a17090794ce00b00870ab893dd3mr16676134ejc.70.1674251964209; Fri, 20 Jan 2023 13:59:24 -0800 (PST) Received: from [192.168.1.101] (abyk37.neoplus.adsl.tpnet.pl. [83.9.30.37]) by smtp.gmail.com with ESMTPSA id la19-20020a170907781300b007aee7ca1199sm18666132ejc.10.2023.01.20.13.59.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jan 2023 13:59:23 -0800 (PST) Message-ID: Date: Fri, 20 Jan 2023 22:59:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RESEND PATCH] of: property: do not create clocks device link for clock controllers Content-Language: en-US To: Dmitry Baryshkov , Rob Herring , Frank Rowand Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Stephen Boyd , Saravana Kannan , Abel Vesa References: <20230118091122.2205452-1-dmitry.baryshkov@linaro.org> From: Konrad Dybcio In-Reply-To: <20230118091122.2205452-1-dmitry.baryshkov@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 18.01.2023 10:11, Dmitry Baryshkov wrote: > Do not create device link for clock controllers. Some of the clocks > provided to the device via OF can be the clocks that are just parents to > the clocks provided by this clock controller. Clock subsystem already > has support for handling missing clock parents correctly (clock > orphans). Later when the parent clock is registered, clocks get > populated properly. > > An example of the system where this matters is the SDM8450 MTP board > (see arch/arm64/boot/dts/qcom/sdm845-mtp.dts). Here the dispcc uses > clocks provided by dsi0_phy and dsi1_phy device tree nodes. However the > dispcc itself provides clocks to both PHYs, to the PHY parent device, > etc. With just dsi0_phy in place devlink is able to break the > dependency, but with two PHYs, dispcc doesn't get probed at all, thus > breaking display support. > > Cc: Bjorn Andersson > Cc: Stephen Boyd > Cc: Saravana Kannan > Cc: Abel Vesa > Signed-off-by: Dmitry Baryshkov > --- Tested-by: Konrad Dybcio # SM8350 PDX215 Konrad > > This patch has been posted a year ago in January 2022 ([1]). Since that time > Saravana failed to produce patches to assist in debugging the issue > ([2]) or to fix the issue ([3]). The issue we observe has been described > by Abel at ([4]). As we work on adding support for Dual DSI > configurations, the issue becomes more and more important, since binding > the whole display subsystem fails. > > Currently the qcom/sdm845-mtp board is already broken and I've just > posted a patch adding Dual DSI variant for the qcom/sdm845-db845c board > ([5]). > > [1] https://lore.kernel.org/lkml/20211125183622.597177-1-dmitry.baryshkov@linaro.org/ > [2] https://lore.kernel.org/lkml/CAA8EJpqELXvRMPWJdTLCURjwkcMxyPDPj1tVZPkdOT_JVQb4-w@mail.gmail.com/ > [3] https://lore.kernel.org/all/CAGETcx8F0wP+RA0KpjOJeZfc=DVG-MbM_=SkRHD4UhD2ReL7Kw@mail.gmail.com/ > [4] https://lore.kernel.org/all/YrsdLQrOtg1qdaoE@linaro.org/ > [5] https://lore.kernel.org/all/20230118082048.2198715-1-dmitry.baryshkov@linaro.org/ > > --- > drivers/of/property.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/property.c b/drivers/of/property.c > index 134cfc980b70..d323bf26a613 100644 > --- a/drivers/of/property.c > +++ b/drivers/of/property.c > @@ -1297,7 +1297,6 @@ struct supplier_bindings { > bool node_not_dev; > }; > > -DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") > DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells") > DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells") > DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells") > @@ -1327,6 +1326,21 @@ DEFINE_SIMPLE_PROP(backlight, "backlight", NULL) > DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) > DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") > > +static struct device_node *parse_clocks(struct device_node *np, > + const char *prop_name, int index) > +{ > + /* > + * Do not create clock-related device links for clocks controllers, > + * clock orphans will handle missing clock parents automatically. > + */ > + if (!strcmp(prop_name, "clocks") && > + of_find_property(np, "#clock-cells", NULL)) > + return NULL; > + > + return parse_prop_cells(np, prop_name, index, "clocks", > + "#clock-cells"); > +} > + > static struct device_node *parse_gpios(struct device_node *np, > const char *prop_name, int index) > {