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=-7.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 62BC0C63697 for ; Thu, 19 Nov 2020 13:09:35 +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 D007D2222F for ; Thu, 19 Nov 2020 13:09:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B1tCHggy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PG79Cd2+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D007D2222F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=v+d1FEBv5wgG5nJtZbErbkBKMlNHZEh+wDZLfJxxRSc=; b=B1tCHggySzrhGksvKixttm0TF 6W61AgT7/xY4nuT3CMAUpZyAQ2LaD+Q5kcUXLJmOOJ4g+YcRtCiCGaYu/lkutme8/RkMNo/93AHJ5 l6fIVYxHQBuUx320ZcxC9vUmwr1axl4TvRpi1XAycmo6BzZnlwL29ngjnUX4wpZHfE6qIHUPYEZqC EImCW0B+aTk80x5NMt5Po53GERPNq6nLXDXY8sS/jWxFxLP7smBaBQpUXMGUGYT8+lVXhf3YDJpsX DOSyriRz3JjTnYh1BsokFzh+x6uu96stm+GCIxKO8ciLgCUur8uYZQ+7Z08TIHy/yHldBduxAigsy aqnG6znuw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfjfY-0003oB-82; Thu, 19 Nov 2020 13:08:12 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfjfS-0003mI-DI for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 13:08:07 +0000 Received: by mail-wr1-x443.google.com with SMTP id m6so6348661wrg.7 for ; Thu, 19 Nov 2020 05:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NAAhUY2tM6ccKrXkcBtqk0m/OvCIAeKgaA0HqteL1I0=; b=PG79Cd2+DS87+UbCdfN6jpDWbVaod5BtQSjCj61EzVjP1VUK8LXCEXI/PeFKyjY/S4 tQItAEndiGIas89tJp1G9dAT9S0ezpFd3rYXXm0O0rwZ3DJMGdERGeEwL+3HuWs6pVei ebjNS73aTYfXhFb428Z8Dr3fnlB2vlKX4DYf7xbsmC9IWgnR5H8u5eGGol3mV/bBXEIK xIIvL3rNv3vRIhtOrPgQew4ff0EsMtlUxYYaltDJARQh1rOyrxem+m6oVDv9FCxXXGZM dYzR6hePTiS9Fighpzk0ve2L7/YM2uGquWEw4F4SNBznfhowNeIMMAI58kbiIz3X6i8P +S0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NAAhUY2tM6ccKrXkcBtqk0m/OvCIAeKgaA0HqteL1I0=; b=UslynfExd74AauPMoae+f5K6JrctgXfe0Mg7bJIrjm86UsLs9Ufov7ipkOZZy6jCXH EcAqaF0qnKUbJaBFI/7KPJA4CRt12WVPs9dULlF+7Fg2wlRZmId9KrlMULAtVsxIzPEi q5H6L8nGzOd1Mpgwjf3gf1eQ+CnY3R7YJaQIPX2/Y+eB2Jf+Xz6i/HEWsn2iQ+BJmaHr dEjho20Ccfic24xbpnegULSh26/UcgJ+8vHHceysuZl7oEUbXhxX5zBku117P1lVObPf jT5KYdaYldFAVMpNrObz7uGvGV6NpraFctDUH68TeH4tvyDOsM3paZTEr+j4xagELGbi Vhxg== X-Gm-Message-State: AOAM5323ibOlbQqW4fpO5A5OEpPnBNrZ+ya8JnIe2lFID8VPw84NLqfM Wjj66+E89w/XjLTGorq5XoI= X-Google-Smtp-Source: ABdhPJyRkQNmzdhTeBG5EQU3yUtO88iu9J1mhAHp8khiEBq3vwcR16ROHW5b/4pH2X3bgBm1H6HhSg== X-Received: by 2002:a5d:634c:: with SMTP id b12mr9938661wrw.130.1605791282471; Thu, 19 Nov 2020 05:08:02 -0800 (PST) Received: from debian (host-92-5-241-147.as43234.net. [92.5.241.147]) by smtp.gmail.com with ESMTPSA id e6sm9440028wme.27.2020.11.19.05.08.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Nov 2020 05:08:02 -0800 (PST) Date: Thu, 19 Nov 2020 13:08:00 +0000 From: Sudip Mukherjee To: Dong Aisheng Subject: Re: [PATCH 1/1] clk: imx: scu: remove the calling of device_is_bound Message-ID: <20201119130800.boyqn4rtczq4wcvn@debian> References: <20201119114302.26263-1-aisheng.dong@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201119114302.26263-1-aisheng.dong@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_080806_591092_76CDAA28 X-CRM114-Status: GOOD ( 19.44 ) 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: Stephen Boyd , linux-imx@nxp.com, Sascha Hauer , Shawn Guo , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Dong, On Thu, Nov 19, 2020 at 07:43:02PM +0800, Dong Aisheng wrote: > The device_is_bound() is unvisable to drivers when built as modules. > It's also not aimed to be used by drivers according to Greg K.H. > Let's remove it from clk-scu driver and find another way to do proper > driver loading sequence. Greg was asking to use device_link for this issue. Have you tried something like the following: (untested as I dont have the hardware). diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index 5b3d4ede7c7c..9ae6c768ea05 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -25,7 +25,7 @@ static int imx8qxp_clk_probe(struct platform_device *pdev) u32 clk_cells; int ret, i; - ret = imx_clk_scu_init(ccm_node); + ret = imx_clk_scu_init(ccm_node, pdev); if (ret) return ret; diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index d10f60e48ece..e834bfadc2a6 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -151,8 +151,9 @@ static inline struct clk_scu *to_clk_scu(struct clk_hw *hw) return container_of(hw, struct clk_scu, hw); } -int imx_clk_scu_init(struct device_node *np) +int imx_clk_scu_init(struct device_node *np, struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct platform_device *pd_dev; u32 clk_cells; int ret, i; @@ -173,12 +174,12 @@ int imx_clk_scu_init(struct device_node *np) */ pd_np = of_find_compatible_node(NULL, NULL, "fsl,scu-pd"); pd_dev = of_find_device_by_node(pd_np); - if (!pd_dev || !device_is_bound(&pd_dev->dev)) { + if (!pd_dev || !device_link_add(dev, &pd_dev->dev, + DL_FLAG_AUTOREMOVE_CONSUMER)) { of_node_put(pd_np); return -EPROBE_DEFER; } } - return platform_driver_register(&imx_clk_scu_driver); } diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index e8352164923e..14e2baf14757 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -13,7 +13,7 @@ extern struct list_head imx_scu_clks[]; extern const struct dev_pm_ops imx_clk_lpcg_scu_pm_ops; -int imx_clk_scu_init(struct device_node *np); +int imx_clk_scu_init(struct device_node *np, struct platform_device *pdev); struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec, void *data); struct clk_hw *imx_clk_scu_alloc_dev(const char *name, -- Regards Sudip _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel