lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH RESEND] driver core: export device_is_bound() to fix build failure
    Hi Aisheng,

    On Mon, Nov 9, 2020 at 10:57 AM Aisheng Dong <aisheng.dong@nxp.com> wrote:
    >
    > Hi Greg,
    >
    > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    > > 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
    > > > <gregkh@linuxfoundation.org> 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.
    > > > > >

    <snip>

    > >
    > > 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

    \
     
     \ /
      Last update: 2020-11-09 12:20    [W:5.153 / U:0.184 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site