Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3137125pxb; Mon, 9 Nov 2020 03:42:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZTEMCv+S+0o93UloAZKxw3KnKQqcfog9687aIPeg1zjAlbOVCCgkL0yO7BcUlC9luwVVI X-Received: by 2002:a17:907:9e3:: with SMTP id ce3mr14733330ejc.4.1604922174598; Mon, 09 Nov 2020 03:42:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604922174; cv=none; d=google.com; s=arc-20160816; b=Y99i2KDG3Xc5GHx606g2AaNUG+duY/8g6jAPJO7qcbnkeCD7DLPxVVC9pM0bCQVHL7 geJaX/MbTTO2FoT1bG/j+8en/2wSRl2XTYzA5D1F6O98pnDGaeeu/xuygLk8p4atf+RV 2N3JhKrWmdAivM9VTDQQeY8wXFnp5jKbfnU7ri7X8f4T3K3WNoaZCbHFEUmqy1r6A1RP o5XzlLu03tPaP0Vi9cqhKQm8FuZda4PKbPsItvTLLwgamDzx7Mezt5OkRVbITFdJI0ul jVs+OM0GjUiN1OWJNpS4uoRDCblmZnSewup0WYpO6rPSYXO3+J+YOlAvPQOe/hJtIfso mP9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kr7MvaAoXma0jWx+jukLZQs1AvZmSQp7rmZElgSpaqg=; b=K8xpDCHlAFi5rrN7+hGMuKg4noqJhw2TD6fY8R6jwVBASDWl1veLavcbBz+n+TbaYy 2MeGxHUJ2R43coFfF7gv5UwcSyhe+LOypWdv9xzSCe0crwhJWjj62NSqvfcJ5cSsAEKH KaDM41qIed3p5jT+Rp7kros6ZkBQV0t2LrpP4GBioV8sV/lmRf8IzZNNdFfYlijeXLuI cTkFgrRMt9Hh/aHLcPmx26CMs7j6qs7Ts8FiCfqZvp8SMm+nEkA9+TlvsUYC6jkd05ey DDStLlHrkH+JtnrvN0JQY4zcyxYrncb6maETmsXMI7nl1pdBq1Li4UZiFTPHVL+U6biP suuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UuFpOwJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si6190252ejx.678.2020.11.09.03.42.30; Mon, 09 Nov 2020 03:42:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UuFpOwJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729516AbgKILlM (ORCPT + 99 others); Mon, 9 Nov 2020 06:41:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:33774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729038AbgKILlM (ORCPT ); Mon, 9 Nov 2020 06:41:12 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 21A1F206ED; Mon, 9 Nov 2020 11:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604922071; bh=DdnMt4dQZoBazp+CcQ4voHqmXOu6LUFvv01/xOPmr+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UuFpOwJ3KiWu5V1sgJj/SVUK/BrOrRC1WZYcczQTEWqTTDT/EWgQ5lq73kVcI7Vid SMjjpP2945dgFy2GtvCM6LwPij2STkSf3vpKV4myivDKWiPrhJNtYrvjLXL1cEbEt9 EjeDNTJt9lJMvYdzjdccshE38LrC+uDoAvlfnX0Q= Date: Mon, 9 Nov 2020 12:42:11 +0100 From: Greg Kroah-Hartman To: Sudip Mukherjee Cc: Aisheng Dong , "Rafael J . Wysocki" , linux-kernel , Shawn Guo , Stephen Boyd Subject: Re: [PATCH RESEND] driver core: export device_is_bound() to fix build failure Message-ID: <20201109114211.GD1769924@kroah.com> References: <20201107224727.11015-1-sudipm.mukherjee@gmail.com> <20201108082317.GA40741@kroah.com> <20201109103703.GA1310551@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 11:18:56AM +0000, Sudip Mukherjee wrote: > Hi Aisheng, > > On Mon, Nov 9, 2020 at 10:57 AM Aisheng Dong wrote: > > > > Hi Greg, > > > > > From: Greg Kroah-Hartman > > > Sent: Monday, November 9, 2020 6:37 PM > > > Subject: Re: [PATCH RESEND] driver core: export device_is_bound() to fix build > > > failure > > > > > > On Mon, Nov 09, 2020 at 10:14:46AM +0000, Sudip Mukherjee wrote: > > > > Hi Greg, > > > > > > > > On Sun, Nov 8, 2020 at 8:23 AM Greg Kroah-Hartman > > > > wrote: > > > > > > > > > > On Sat, Nov 07, 2020 at 10:47:27PM +0000, Sudip Mukherjee wrote: > > > > > > When CONFIG_MXC_CLK_SCU is configured as 'm' the build fails as it > > > > > > is unable to find device_is_bound(). The error being: > > > > > > ERROR: modpost: "device_is_bound" [drivers/clk/imx/clk-imx-scu.ko] > > > > > > undefined! > > > > > > > > > > > > Export the symbol so that the module finds it. > > > > > > > > > > > > > > > probe() should never call this function as it makes no sense at all at that point in > > > time. The driver should be fixed. > > > > Would you suggest if any other API we can use to allow the driver to know whether > > another device has been probed? > > > > For imx scu driver in question, it has a special requirement that it depends on scu power domain > > driver. However, there're a huge number (200+) of power domains for each device clock, we can't define > > them all in DT for a single clock controller node. > > > > That's why we wanted to use device_is_bound() before to check if scu power domain is ready or not to > > support defer probe. > > iiuc, you are waiting for "fsl,scu-pd" to be registered. > I think you might be able to use bus_for_each_dev() to check if the > device has registered with the bus or not. It will be on the bus only > after bind was successful. The bus will be "platform_bus_type". No, do not do that, again, no individual driver should ever have to do that. Think about what would be involved if _every_ driver started doing this. > But I am sure Greg can give you better suggestion than this. :) device link :) thanks, greg k-h