* from WHERE platform driver's probe is called?
@ 2014-11-21 13:16 Sunil Shahu
2014-11-21 13:42 ` Sudip Mukherjee
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Sunil Shahu @ 2014-11-21 13:16 UTC (permalink / raw)
To: kernelnewbies
Hello,
I am looking into platform driver and devices and understood HOW platform driver's probe is called from kernel doc and following forum.http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
For further information I went through code in platform_driver_register() and got lost. I looked web but could not find substantiation information.
I am still not able to locate from WHERE this probe function is called and WHO calls it?Can someone please point to source code or some other document related to this?
Thanks,Sunil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141121/e0cf908f/attachment.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
@ 2014-11-21 13:42 ` Sudip Mukherjee
2014-11-21 14:06 ` Daniel Baluta
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Sudip Mukherjee @ 2014-11-21 13:42 UTC (permalink / raw)
To: kernelnewbies
On Fri, Nov 21, 2014 at 6:46 PM, Sunil Shahu <sunil.rockon@yahoo.in> wrote:
> Hello,
>
> I am looking into platform driver and devices and understood HOW platform
> driver's probe is called from kernel doc and following forum.
> http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
>
> For further information I went through code in platform_driver_register()
> and got lost. I looked web but could not find substantiation information.
>
> I am still not able to locate from WHERE this probe function is called and
> WHO calls it?
> Can someone please point to source code or some other document related to
> this?
i am also not exactly sure, but i think the individual drivers probe
function is called from platform_drv_probe() of platform.c
thanks
sudip
>
> Thanks,
> Sunil.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
2014-11-21 13:42 ` Sudip Mukherjee
@ 2014-11-21 14:06 ` Daniel Baluta
2014-11-21 14:11 ` Varka Bhadram
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2014-11-21 14:06 UTC (permalink / raw)
To: kernelnewbies
On Fri, Nov 21, 2014 at 3:16 PM, Sunil Shahu <sunil.rockon@yahoo.in> wrote:
> Hello,
>
> I am looking into platform driver and devices and understood HOW platform
> driver's probe is called from kernel doc and following forum.
> http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
>
> For further information I went through code in platform_driver_register()
> and got lost. I looked web but could not find substantiation information.
>
> I am still not able to locate from WHERE this probe function is called and
> WHO calls it?
> Can someone please point to source code or some other document related to
> this?
Does dump_stack() help?
Daniel.
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
2014-11-21 13:42 ` Sudip Mukherjee
2014-11-21 14:06 ` Daniel Baluta
@ 2014-11-21 14:11 ` Varka Bhadram
2014-11-21 14:29 ` Greg KH
2014-11-22 16:40 ` Aruna Hewapathirane
4 siblings, 0 replies; 8+ messages in thread
From: Varka Bhadram @ 2014-11-21 14:11 UTC (permalink / raw)
To: kernelnewbies
This link can answer your ques:
http://stackoverflow.com/questions/22722520/who-calls-probe-function-in-driver-code
Thanks.
On Fri, Nov 21, 2014 at 6:46 PM, Sunil Shahu <sunil.rockon@yahoo.in> wrote:
> Hello,
>
> I am looking into platform driver and devices and understood HOW platform
> driver's probe is called from kernel doc and following forum.
> http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
>
> For further information I went through code in platform_driver_register()
> and got lost. I looked web but could not find substantiation information.
>
> I am still not able to locate from WHERE this probe function is called and
> WHO calls it?
> Can someone please point to source code or some other document related to
> this?
>
> Thanks,
> Sunil.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141121/7af5308d/attachment.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
` (2 preceding siblings ...)
2014-11-21 14:11 ` Varka Bhadram
@ 2014-11-21 14:29 ` Greg KH
2014-11-22 3:26 ` subin gangadharan
2014-11-22 16:40 ` Aruna Hewapathirane
4 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2014-11-21 14:29 UTC (permalink / raw)
To: kernelnewbies
On Fri, Nov 21, 2014 at 01:16:21PM +0000, Sunil Shahu wrote:
> Hello,
>
> I am looking into platform driver and devices and understood HOW platform
> driver's probe is called from kernel doc and following forum.
> http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
>
> For further information I went through code in platform_driver_register() and
> got lost. I looked web but could not find substantiation information.
>
> I am still not able to locate from WHERE this probe function is called and WHO
> calls it?
It all starts by your own driver, you end up calling it yourself,
through the driver core callbacks.
> Can someone please point to source code or some other document related to this?
Can you please provide a specific example of what you are wanting to see
the callback chain for? What driver are you asking about? Have you
read the platform code in drivers/base/ ?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 14:29 ` Greg KH
@ 2014-11-22 3:26 ` subin gangadharan
[not found] ` <713189992.1177678.1417078856074.JavaMail.yahoo@jws10919.mail.sg3.yahoo.com>
0 siblings, 1 reply; 8+ messages in thread
From: subin gangadharan @ 2014-11-22 3:26 UTC (permalink / raw)
To: kernelnewbies
Hi Sunil,
>>I am still not able to locate from WHERE this probe function is called and WHO calls it?
I can try to give you a snapshot of the function call trace. But if
you really want to get in depth detail, as Greg said look at the code
driver/base.
driver_register
->bus_add_driver->driver_attach->__driver_attach->driver_probe_device->really_probe->drv->probe
Basically when you register your platform driver, the platform
bus(platform_bus_type) will scan for the matching device. If you look
at the platform_bus_type structure you can find the match function
which does the matching of driver and device. Once it's found the
right device, it will attach the driver to the device.Look at the
function driver_attach. And if you look at the
platform_driver_register function, you can see that
"platform_drv_probe" function is assigned to driver.probe function.
And this probe function will finally call your registered platform
driver probe function.
Hope this helps.
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
` (3 preceding siblings ...)
2014-11-21 14:29 ` Greg KH
@ 2014-11-22 16:40 ` Aruna Hewapathirane
4 siblings, 0 replies; 8+ messages in thread
From: Aruna Hewapathirane @ 2014-11-22 16:40 UTC (permalink / raw)
To: kernelnewbies
>>I am looking into platform driver and devices and understood HOW platform
driver's probe is called from kernel doc and >>following forum.
>>>>http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
<http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050>
I would ask *what* is platform device driver ? and what is the *difference*
between a platform device driver and a normal device driver ?
The answer here explains it extremely well :
http://stackoverflow.com/questions/15610570/what-is-the-difference-between-platform-driver-and-normal-device-driver
>>For further information I went through code in platform_driver_register()
and got lost. I looked web but could not find
>>substantiation information.
This will help:
http://code.woboq.org/linux/linux/drivers/base/platform.c.html#platform_driver_probe
>>I am still not able to locate from WHERE this probe function is called
and WHO calls it?
>>Can someone please point to source code or some other document related to
this?
Review this article carefully:
https://coherentmusings.wordpress.com/2013/12/13/how-to-write-a-platform-devicedriver-adc-driver-using-wm97xx-codec/
Have fun :)
Aruna
On Fri, Nov 21, 2014 at 8:16 AM, Sunil Shahu <sunil.rockon@yahoo.in> wrote:
> Hello,
>
> I am looking into platform driver and devices and understood HOW platform
> driver's probe is called from kernel doc and following forum.
> http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
>
> For further information I went through code in platform_driver_register()
> and got lost. I looked web but could not find substantiation information.
>
> I am still not able to locate from WHERE this probe function is called and
> WHO calls it?
> Can someone please point to source code or some other document related to
> this?
>
> Thanks,
> Sunil.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141122/91c16ee2/attachment.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* from WHERE platform driver's probe is called?
[not found] ` <713189992.1177678.1417078856074.JavaMail.yahoo@jws10919.mail.sg3.yahoo.com>
@ 2014-12-02 18:33 ` subin gangadharan
0 siblings, 0 replies; 8+ messages in thread
From: subin gangadharan @ 2014-12-02 18:33 UTC (permalink / raw)
To: kernelnewbies
On Thu, Nov 27, 2014 at 1:00 AM, Sunil Shahu <sunil.rockon@yahoo.in> wrote:
> Hi Daniel,
> Thanks, dump_stack() is what I needed.
>
> Hi Subin,
> Thanks for the snapshot.
>
> Also, I am attaching a graph for what I understood after following
> dump_stack().
>
> Please let me know if there is any issue with the flow.
>
> Thanks,
> Sunil.
>
>
>
> On Saturday, 22 November 2014 9:04 AM, subin gangadharan
> <subingangadharan@gmail.com> wrote:
>
>
> Hi Sunil,
>
>>>I am still not able to locate from WHERE this probe function is called and
>>> WHO calls it?
>
> I can try to give you a snapshot of the function call trace. But if
> you really want to get in depth detail, as Greg said look at the code
> driver/base.
>
> driver_register
> ->bus_add_driver->driver_attach->__driver_attach->driver_probe_device->really_probe->drv->probe
>
> Basically when you register your platform driver, the platform
> bus(platform_bus_type) will scan for the matching device. If you look
> at the platform_bus_type structure you can find the match function
> which does the matching of driver and device. Once it's found the
> right device, it will attach the driver to the device.Look at the
> function driver_attach. And if you look at the
> platform_driver_register function, you can see that
> "platform_drv_probe" function is assigned to driver.probe function.
> And this probe function will finally call your registered platform
> driver probe function.
>
> Hope this helps.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
Hi Sunil,
Thanks for the nice detailed snap shot.
Subin
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-12-02 18:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21 13:16 from WHERE platform driver's probe is called? Sunil Shahu
2014-11-21 13:42 ` Sudip Mukherjee
2014-11-21 14:06 ` Daniel Baluta
2014-11-21 14:11 ` Varka Bhadram
2014-11-21 14:29 ` Greg KH
2014-11-22 3:26 ` subin gangadharan
[not found] ` <713189992.1177678.1417078856074.JavaMail.yahoo@jws10919.mail.sg3.yahoo.com>
2014-12-02 18:33 ` subin gangadharan
2014-11-22 16:40 ` Aruna Hewapathirane
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).