2013-03-07 10:33:30

by Ricardo Ribalda Delgado

[permalink] [raw]
Subject: HOWTO Undo/Revert of_platform_populate?

Hi

I have an FPGA attached to the pci bus. The FPGA has an internal bus
with multiple cores that are already supported in the kernel.

I have made a driver that populates those cores using a user provided
device tree. I use the function of_platform_populate for that.

All this is working fine, but now I need a method to undo what
of_platform_populate does when the fpga is reprogrammed.

I haven't found any function that does this in the api.

Before implementing my own I would like to know if am I missing something?


Thanks!

--
Ricardo Ribalda


2013-03-08 00:07:58

by Rob Herring

[permalink] [raw]
Subject: Re: HOWTO Undo/Revert of_platform_populate?

On 03/07/2013 04:32 AM, Ricardo Ribalda Delgado wrote:
> Hi
>
> I have an FPGA attached to the pci bus. The FPGA has an internal bus
> with multiple cores that are already supported in the kernel.
>
> I have made a driver that populates those cores using a user provided
> device tree. I use the function of_platform_populate for that.
>
> All this is working fine, but now I need a method to undo what
> of_platform_populate does when the fpga is reprogrammed.
>
> I haven't found any function that does this in the api.
>
> Before implementing my own I would like to know if am I missing something?

It's not possible in the current kernel. You need DT overlay support
that was posted recently.

Rob

2013-04-15 13:40:15

by Grant Likely

[permalink] [raw]
Subject: Re: HOWTO Undo/Revert of_platform_populate?

On Thu, 07 Mar 2013 18:07:53 -0600, Rob Herring <[email protected]> wrote:
> On 03/07/2013 04:32 AM, Ricardo Ribalda Delgado wrote:
> > Hi
> >
> > I have an FPGA attached to the pci bus. The FPGA has an internal bus
> > with multiple cores that are already supported in the kernel.
> >
> > I have made a driver that populates those cores using a user provided
> > device tree. I use the function of_platform_populate for that.
> >
> > All this is working fine, but now I need a method to undo what
> > of_platform_populate does when the fpga is reprogrammed.
> >
> > I haven't found any function that does this in the api.
> >
> > Before implementing my own I would like to know if am I missing something?
>
> It's not possible in the current kernel. You need DT overlay support
> that was posted recently.

In the mean time you can merely recurse all the children of the parent
struct device, unregister them from the device model, and release them.

g.