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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C9FC433DB for ; Mon, 1 Feb 2021 10:56:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28E0761477 for ; Mon, 1 Feb 2021 10:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233368AbhBAK4D (ORCPT ); Mon, 1 Feb 2021 05:56:03 -0500 Received: from mail-oi1-f171.google.com ([209.85.167.171]:45308 "EHLO mail-oi1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233410AbhBAKzb (ORCPT ); Mon, 1 Feb 2021 05:55:31 -0500 Received: by mail-oi1-f171.google.com with SMTP id g69so18291577oib.12; Mon, 01 Feb 2021 02:55:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TsZddNdEu5n1CGxavoWBCizkLcHFPyez/OBFVu2/Ol4=; b=uZZpSLxlc9IrMJpLJ3ZPp/etwR6FkMSHS45sM5GphC+qvUzPJnL9cLz6icY5RcfpTI pQdfKo0RTE6nZbS/wslaPxsUCNH+VXSTe7MZ3u0L4BKGNM9GPTT6I95+Ih4fdvg3xsMP 3sCIPBTu8LMeMxL7fOPDj7Kew3z1ebVb2Aad0EL44c2Dt1qPHLbvR+jTwzk0FJsjyMqn 286lQgNhpdWD9NAw0RJldh/z9eOvXaOE3eYtyCSGOda5VoxzI+p26DsqkWqznsllGE8I i8McmBxqQw8/n99lYkBXIYpRPIWg7D8pIormuDm9C62Ap0CLhBKyl9d49J7lwYOgyYsl TMRg== X-Gm-Message-State: AOAM532wHNjigD30ZL3O34rQ0i1YTI5OUG4tWgXj9AJPWOdOtZyTReq5 aSzHjBcwbDDggIs0ccXcz4rZkuUmakp+G9ehYto= X-Google-Smtp-Source: ABdhPJyN2ZpzXcNCMXgUY3hrigvtGooBg8Ikn1SHhUS4Nh5ldPH91gGT2AWWgTkluWm7nrP3FGpgBWJnKTnSMsXIHs0= X-Received: by 2002:aca:4d8d:: with SMTP id a135mr10215866oib.153.1612176890041; Mon, 01 Feb 2021 02:54:50 -0800 (PST) MIME-Version: 1.0 References: <20210128104446.164269-1-tudor.ambarus@microchip.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 1 Feb 2021 11:54:38 +0100 Message-ID: Subject: Re: [PATCH] clk: at91: sama5d2: Mark device OF_POPULATED after setup To: Saravana Kannan Cc: Tudor Ambarus , Alexandre Belloni , LKML , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , linux-clk , mirq-linux@rere.qmqm.pl, Ludovic Desroches , Claudiu Beznea , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Thu, Jan 28, 2021 at 6:08 PM Saravana Kannan wrote: > I already accounted for early clocks like this when I designed > fw_devlink. Each driver shouldn't need to set OF_POPULATED. > drivers/clk/clk.c already does this for you. > > I think the problem is that your driver is using > CLK_OF_DECLARE_DRIVER() instead of CLK_OF_DECLARE(). The comments for > CLK_OF_DECLARE_DRIVER() says: > /* > * Use this macro when you have a driver that requires two initialization > * routines, one at of_clk_init(), and one at platform device probe > */ > > In your case, you are explicitly NOT having a driver bind to this > clock later. So you shouldn't be using CLK_OF_DECLARE() instead. Unless I'm missing something, name##_of_clk_init_driver() clearing OF_POPULATED again causes consumer driver probing to be postponed by fw_devlink until the second initialization phase of the provider has been completed? This is wrong if the consumer only needs a clock instantiated during the first phase, and may cause issues if the consumer is a critical device. E.g. a timer, on ARM SoCs lacking an architecture timer (pre-Cortex A7/A15) or global timer (pre-Cortex A9, or single-core Cortex A9). Probably there are more examples. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds 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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6051FC433DB for ; Mon, 1 Feb 2021 10:56:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D476464E94 for ; Mon, 1 Feb 2021 10:56:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D476464E94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C1xgghn/gOKPz5Qr7WQmp7e/B/PioSPkQ9/AlPH1/Ho=; b=gcrLmxg4q8qjb4bHcpoGf+o+2 S+/xEoCGXSMBz8DNAH/aJDRZF8MX4eZRi+XDLl3U67XH3yeg2Wpga7CrirsgeCs7Tlrh00hVf6XUX 74nQJXIM9lqa5YO+6+3qjM5GwkxvBX40CVEpyzmGWxLKe6rE+xxu3GWCVwu8QNooF3AWtwlalYNHG tOwA48bElfweOtFfJi/G9gfVmJCAUD+9ChPfDv3ErEeuz95It1Q73ZTvL/7aHPtMfS596L5ObW/iI a5qBJg3YM5L0seZ3i0wWXuQxV1VPpPlWP0dTHwxX2e7gqo//G4YfsoEgYHJJ8sWLz9UfzxIzmgkFK D5fkK5HcA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6Wr9-0005NG-RC; Mon, 01 Feb 2021 10:54:55 +0000 Received: from mail-oi1-f181.google.com ([209.85.167.181]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6Wr6-0005Mq-EZ for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2021 10:54:53 +0000 Received: by mail-oi1-f181.google.com with SMTP id h6so18335057oie.5 for ; Mon, 01 Feb 2021 02:54:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TsZddNdEu5n1CGxavoWBCizkLcHFPyez/OBFVu2/Ol4=; b=Noj+NCLoVShg2VD/kpF3co2ez4mwxXX8G1CSh6xwvfeUctaTxTQiOM6jthrjeao+n1 NbO5WUrOEo3EYITYfgnmMc4PhfC0krjF+vK2+PhfTifpXM2yC1P/g+Ye52GQ1hiIaFvu VfrMooEGi6eFWu9hEBBXDgwvjKfHDKVUw5lJPASESHToUyzIoWIZfObJ0LKDwh/bsh4S RzK7i3QoIY43VqQYZMkjOPHXQGfQ+jFaIm8GxqxaBy3EXtoH6rogaN3pZNyDGwOqoSAP s/9zCV1OyH9r6ozfjxuJA3zwM+WYsMSEp5GWhIBmYG3TMiRNjCEvnEu93BQc94imTcG/ exOg== X-Gm-Message-State: AOAM532hlVdmDn71Yo006XqXz0Gq15xVyjAkG4Cf31L4Dm2Rhu9kQylM EqJhVNdPRKcHLa7W479T0yqFRgA/4MslfLF+G5E= X-Google-Smtp-Source: ABdhPJyN2ZpzXcNCMXgUY3hrigvtGooBg8Ikn1SHhUS4Nh5ldPH91gGT2AWWgTkluWm7nrP3FGpgBWJnKTnSMsXIHs0= X-Received: by 2002:aca:4d8d:: with SMTP id a135mr10215866oib.153.1612176890041; Mon, 01 Feb 2021 02:54:50 -0800 (PST) MIME-Version: 1.0 References: <20210128104446.164269-1-tudor.ambarus@microchip.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 1 Feb 2021 11:54:38 +0100 Message-ID: Subject: Re: [PATCH] clk: at91: sama5d2: Mark device OF_POPULATED after setup To: Saravana Kannan X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_055452_497795_4254A8F7 X-CRM114-Status: GOOD ( 17.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Tudor Ambarus , Stephen Boyd , Greg Kroah-Hartman , Michael Turquette , LKML , mirq-linux@rere.qmqm.pl, Ludovic Desroches , Claudiu Beznea , linux-clk , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Saravana, On Thu, Jan 28, 2021 at 6:08 PM Saravana Kannan wrote: > I already accounted for early clocks like this when I designed > fw_devlink. Each driver shouldn't need to set OF_POPULATED. > drivers/clk/clk.c already does this for you. > > I think the problem is that your driver is using > CLK_OF_DECLARE_DRIVER() instead of CLK_OF_DECLARE(). The comments for > CLK_OF_DECLARE_DRIVER() says: > /* > * Use this macro when you have a driver that requires two initialization > * routines, one at of_clk_init(), and one at platform device probe > */ > > In your case, you are explicitly NOT having a driver bind to this > clock later. So you shouldn't be using CLK_OF_DECLARE() instead. Unless I'm missing something, name##_of_clk_init_driver() clearing OF_POPULATED again causes consumer driver probing to be postponed by fw_devlink until the second initialization phase of the provider has been completed? This is wrong if the consumer only needs a clock instantiated during the first phase, and may cause issues if the consumer is a critical device. E.g. a timer, on ARM SoCs lacking an architecture timer (pre-Cortex A7/A15) or global timer (pre-Cortex A9, or single-core Cortex A9). Probably there are more examples. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel