[U-Boot] [RFC PATCH 05/22] sandbox: Remove all drivers before exit

Simon Glass
2014-05-27T21:05:50Z

Hi Jon,

On 27 May 2014 09:28, Jon Loeliger <loeliger@gmail.com> wrote:
> On Sat, May 24, 2014 at 4:21 PM, Simon Glass <sjg@chromium.org> wrote:
>> Drivers are supposed to be able to close down cleanly. To set a good example,
>> make sandbox shut down its driver model drivers and remove them before exit.
>
> Right. But we should be careful here...
>
>> It may be desirable to do the same more generally once driver model is more
>> widely-used. This could be done during bootm, before U-Boot jumps to the OS.
>> It seems far too early to make this change.
>
> Some drivers should probably NOT be shut down prior to bootm handing
> off to some other OS. It could be that their sole purpose for starting and
> running was to enable some continued driver state for the OS.
>
> I'm thinking of some clock, or PHY or maybe some aspect of the ARM SCU
> that should be "left running".
>
> So maybe if there is a general "shutdown" pass, there might be a need for
> a flag to indicate that it is/isn't OK to do so at OS-hand-off time.

Yes agreed. I think we can cross that bridge when we come to it
though. So long as the drivers have a way of shutting down then we
have at least encouraged driver authors to think about this issue. My
concern was that in U-Boot people might think that the remove() method
is a waste of time.

Regards,
Simon