* [Q] reprobe deferred-probing drivers
@ 2012-10-17 8:27 Guennadi Liakhovetski
2012-10-17 8:43 ` Guennadi Liakhovetski
2012-10-17 15:02 ` Greg Kroah-Hartman
0 siblings, 2 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2012-10-17 8:27 UTC (permalink / raw)
To: linux-kernel; +Cc: Linux Media Mailing List, Greg Kroah-Hartman
Hi
I've got a situation, for which I currently don't have a (good) solution.
Let's say device A depends on device B and as long as B hasn't probed, A
requests deferred probing. Now B probes, which causes A to also succeed
its probing. Next we want to remove B, say, by unloading its driver. A has
to go back into "deferred-probing" state. How do we do it? This can be
achieved by unloading B's driver and loading again. Essentially, we have
to use the sysfs "unbind" and then the "bind" attributes. But how do we do
this from the kernel? Shall we export driver_bind() and driver_unbind()?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Q] reprobe deferred-probing drivers
2012-10-17 8:27 [Q] reprobe deferred-probing drivers Guennadi Liakhovetski
@ 2012-10-17 8:43 ` Guennadi Liakhovetski
2012-10-17 16:02 ` Ming Lei
2012-10-17 15:02 ` Greg Kroah-Hartman
1 sibling, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2012-10-17 8:43 UTC (permalink / raw)
To: linux-kernel; +Cc: Linux Media Mailing List, Greg Kroah-Hartman
On Wed, 17 Oct 2012, Guennadi Liakhovetski wrote:
> Hi
>
> I've got a situation, for which I currently don't have a (good) solution.
Ok, right, would it be acceptable to just do something like
if (dev->parent)
device_lock(dev->parent);
device_release_driver(dev);
device_attach(dev);
?
Thanks
Guennadi
> Let's say device A depends on device B and as long as B hasn't probed, A
> requests deferred probing. Now B probes, which causes A to also succeed
> its probing. Next we want to remove B, say, by unloading its driver. A has
> to go back into "deferred-probing" state. How do we do it? This can be
> achieved by unloading B's driver and loading again. Essentially, we have
> to use the sysfs "unbind" and then the "bind" attributes. But how do we do
> this from the kernel? Shall we export driver_bind() and driver_unbind()?
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Q] reprobe deferred-probing drivers
2012-10-17 8:43 ` Guennadi Liakhovetski
@ 2012-10-17 16:02 ` Ming Lei
0 siblings, 0 replies; 5+ messages in thread
From: Ming Lei @ 2012-10-17 16:02 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: linux-kernel, Linux Media Mailing List, Greg Kroah-Hartman
On Wed, Oct 17, 2012 at 4:43 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Wed, 17 Oct 2012, Guennadi Liakhovetski wrote:
>
>> Hi
>>
>> I've got a situation, for which I currently don't have a (good) solution.
>
> Ok, right, would it be acceptable to just do something like
>
> if (dev->parent)
> device_lock(dev->parent);
> device_release_driver(dev);
> device_attach(dev);
The above should be OK for your purpose, and looks some other
deferred-probe devices may need this handling too.
But I am wondering how you could get the pointer of device A for
releasing driver in device B's remove()?
Thanks,
--
Ming Lei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Q] reprobe deferred-probing drivers
2012-10-17 8:27 [Q] reprobe deferred-probing drivers Guennadi Liakhovetski
2012-10-17 8:43 ` Guennadi Liakhovetski
@ 2012-10-17 15:02 ` Greg Kroah-Hartman
2012-10-17 15:10 ` Guennadi Liakhovetski
1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-17 15:02 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-kernel, Linux Media Mailing List
On Wed, Oct 17, 2012 at 10:27:36AM +0200, Guennadi Liakhovetski wrote:
> Hi
>
> I've got a situation, for which I currently don't have a (good) solution.
>
> Let's say device A depends on device B and as long as B hasn't probed, A
> requests deferred probing. Now B probes, which causes A to also succeed
> its probing. Next we want to remove B, say, by unloading its driver. A has
> to go back into "deferred-probing" state. How do we do it? This can be
> achieved by unloading B's driver and loading again. Essentially, we have
> to use the sysfs "unbind" and then the "bind" attributes. But how do we do
> this from the kernel? Shall we export driver_bind() and driver_unbind()?
No, no driver should ever have to mess with that at all, it is up to the
bus to do this. Do you have a pointer to the code you are concerned
about?
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Q] reprobe deferred-probing drivers
2012-10-17 15:02 ` Greg Kroah-Hartman
@ 2012-10-17 15:10 ` Guennadi Liakhovetski
0 siblings, 0 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2012-10-17 15:10 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Linux Media Mailing List
On Wed, 17 Oct 2012, Greg Kroah-Hartman wrote:
> On Wed, Oct 17, 2012 at 10:27:36AM +0200, Guennadi Liakhovetski wrote:
> > Hi
> >
> > I've got a situation, for which I currently don't have a (good) solution.
> >
> > Let's say device A depends on device B and as long as B hasn't probed, A
> > requests deferred probing. Now B probes, which causes A to also succeed
> > its probing. Next we want to remove B, say, by unloading its driver. A has
> > to go back into "deferred-probing" state. How do we do it? This can be
> > achieved by unloading B's driver and loading again. Essentially, we have
> > to use the sysfs "unbind" and then the "bind" attributes. But how do we do
> > this from the kernel? Shall we export driver_bind() and driver_unbind()?
>
> No, no driver should ever have to mess with that at all, it is up to the
> bus to do this. Do you have a pointer to the code you are concerned
> about?
No, not yet. I'm currently working on it. I'll do it using the
device_release_driver(sd->dev);
device_attach(sd->dev);
trick and post to linux-media. I'll (try to remember to) add you to cc,
then we can see how to properly implement it.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-17 16:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17 8:27 [Q] reprobe deferred-probing drivers Guennadi Liakhovetski
2012-10-17 8:43 ` Guennadi Liakhovetski
2012-10-17 16:02 ` Ming Lei
2012-10-17 15:02 ` Greg Kroah-Hartman
2012-10-17 15:10 ` Guennadi Liakhovetski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.