Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3126059pxb; Mon, 9 Nov 2020 03:22:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlMi/0x+4Xv/P+hKXWJTGdqbumrX/jzATh9No5pp3TGck9sPi6VmgaeVC6lRmsWNjwLNvu X-Received: by 2002:a50:9993:: with SMTP id m19mr14350484edb.99.1604920936231; Mon, 09 Nov 2020 03:22:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604920936; cv=none; d=google.com; s=arc-20160816; b=uOc6ekJnhTmvybk4QMUYObVa9zPlbLCKQhqUrBoIf3Dp7VeIrWLr+shTzfqkW4Qgot nBRNWvxiTU0F4wIYZGFpLwT+JXzhWfdfQnsYb7OsgYH5YE6HkG6fV+bELt+pt889Giaz 5uR5SNuFh/49SM4uxujqhHSkDjuoQVFMF5mJSN4yoYy9+6KOJwTI/V1sFcMpuMP7BHtl ApcCpePki/MQvtJMASbbRK/STVG2p5KVbGtciAb2B37RsbZM5zHQraiYYJH248GO+Fq3 MMdPzFT3y9Xc65luSF2j5vyf9+D9h8HoqLHMNkH5izeip4ecY6Ykha6+KypDAbtj4XGY bsWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kc0eZrwE84e3glq3XH8q7UFVZGb6mvovyfHQ9zc586o=; b=rpeXRpYqYdTw6Qki58W3AJLdwOQffEGs0tGmbFpQj1iZuLqfS59DWQoBjqhoga6rHT 97TC1/JPqz2GtuKF6hhoPpOW4vyUBnQ6V8yADXhAqZ9nLWVv10g86nTbj6oQy4xJZgyp h8fn/zgbyVqcXaZ0iVXhk36I2TZtR7v6ms9UdVH9FPJJCghlLM+8Nda8eN7ubFr4nVBn HdAuU7mCJWjbxpNTEoREtdYEUELe2nnittBaeyIWkp/toRRpz6/Noxow4JgrhkJBEc5V TJfYmBsKJ6a3+FsfUNnkciwUZ/qajK1CKwysSkWefxwgf1mx0tIEPrXhGmRFDBAtcLQi MrGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xkg4nzXS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nt19si6863430ejb.490.2020.11.09.03.21.53; Mon, 09 Nov 2020 03:22:16 -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=@gmail.com header.s=20161025 header.b=Xkg4nzXS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729168AbgKILTe (ORCPT + 99 others); Mon, 9 Nov 2020 06:19:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727311AbgKILTd (ORCPT ); Mon, 9 Nov 2020 06:19:33 -0500 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B3DBC0613CF for ; Mon, 9 Nov 2020 03:19:33 -0800 (PST) Received: by mail-yb1-xb44.google.com with SMTP id m188so7856739ybf.2 for ; Mon, 09 Nov 2020 03:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kc0eZrwE84e3glq3XH8q7UFVZGb6mvovyfHQ9zc586o=; b=Xkg4nzXS/Qbdsu7JGP8Xre4Wws/wijgFIP4t7SKuwnHu6oszbKhwoyFTV/vbsEVY20 Gf7RCSted+Omw4wMwJDOUnGSiX1vvEo/sWnoWVIyF7+kGm7VtdNJ7EGdFb8dr8/48K/a dPCI9iplbV8FyuMZdvc9HmQ5PcFC7/zpcklUxJ32Afqmduw09xxsgOoUrwCPABglnL0W Ao7Gs6jYm741g98IwpRn4w102P0Yu5iD8oH5mYs3ET+5rGZS4FxGf7aRl5DkJck6ctel Aq1igmb+wnvJMUhZLzRlnpRHL11dzrFR/Ia6bLaj+bnDHAGYR93j7+GMc5jE/zGunmjX V5zA== 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=kc0eZrwE84e3glq3XH8q7UFVZGb6mvovyfHQ9zc586o=; b=WAhi5fEnthAzQ56C54T5tWb0A95QDr5MATRzqXqbQshbuHH5v1SPte9ed7ap1iPqQr Es5hoCzG58wAuE41BvySdEFDR1Ad+xqwXtwmRwGJSrZsoYNTQdS6KdwDILkeif1rfOSV wRwe3Gz76uLCK6TZ+yaHpklPVAody0GX8b27op5GYdi19MNaUBOcQ2bPY6OVE8v4vNnG rEYibrcbFEX2xMtySi7fuNys0KnOxAnDxZyGYc/bEFafanO4JZtSS9mjWXP9KRgMYydC da9HDW3aoPYvPw4X3WdTw1ZYlZIyCCx1FKRPEZLVvm8p2wMOWXfGCmxYEsY1x7gQjzx+ vgFA== X-Gm-Message-State: AOAM532CgAb8K7QjsUcAA3bu7jbX+F/wTbMiDXkfW9ePKnrfVNSs8lrh bYjwpC83Lp2YJo3+V7kOSrmE/bEDfLQyHeU2htw= X-Received: by 2002:a25:209:: with SMTP id 9mr2725325ybc.127.1604920772501; Mon, 09 Nov 2020 03:19:32 -0800 (PST) MIME-Version: 1.0 References: <20201107224727.11015-1-sudipm.mukherjee@gmail.com> <20201108082317.GA40741@kroah.com> <20201109103703.GA1310551@kroah.com> In-Reply-To: From: Sudip Mukherjee Date: Mon, 9 Nov 2020 11:18:56 +0000 Message-ID: Subject: Re: [PATCH RESEND] driver core: export device_is_bound() to fix build failure To: Aisheng Dong Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel , Shawn Guo , Stephen Boyd Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". But I am sure Greg can give you better suggestion than this. :) -- Regards Sudip