All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Device cleanup before starting OS (Linux)
@ 2017-02-28 16:32 Stefan Roese
  2017-03-01  5:40 ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2017-02-28 16:32 UTC (permalink / raw)
  To: u-boot

Hi!

I'm currently trying to add some code to stop (DMA) buffer usage
in the Marvell mvpp2 ethernet driver, that should only be
executed once, before the OS is started - stop() does not work
easily for me here. I've found the weak function
"board_quiesce_devices()", which is already used for
such cases. But since you are not fond of weak functions
(I totally agree here, this is far from perfect) and already
suggested some kind of "finalize" DM API call, I'm wondering
if I should introduce this new API call for such cases and use
it in the ethernet driver.

So what is your opinion about this? Should I add such a
finalize DM function and call it from the arch/.../bootm
code? Or do you have other suggestions on how to handle
such driver specific last-stage (pre OS) calls?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Device cleanup before starting OS (Linux)
  2017-02-28 16:32 [U-Boot] Device cleanup before starting OS (Linux) Stefan Roese
@ 2017-03-01  5:40 ` Simon Glass
  2017-03-01  5:52   ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2017-03-01  5:40 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On 28 February 2017 at 09:32, Stefan Roese <sr@denx.de> wrote:
>
> Hi!
>
> I'm currently trying to add some code to stop (DMA) buffer usage
> in the Marvell mvpp2 ethernet driver, that should only be
> executed once, before the OS is started - stop() does not work
> easily for me here. I've found the weak function
> "board_quiesce_devices()", which is already used for
> such cases. But since you are not fond of weak functions
> (I totally agree here, this is far from perfect) and already
> suggested some kind of "finalize" DM API call, I'm wondering
> if I should introduce this new API call for such cases and use
> it in the ethernet driver.
>
> So what is your opinion about this? Should I add such a
> finalize DM function and call it from the arch/.../bootm
> code? Or do you have other suggestions on how to handle
> such driver specific last-stage (pre OS) calls?

Is it possible to use the device's remove() method?

Regards,
Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Device cleanup before starting OS (Linux)
  2017-03-01  5:40 ` Simon Glass
@ 2017-03-01  5:52   ` Stefan Roese
  2017-03-01 10:36     ` Stefan Roese
  2017-03-03  4:53     ` Simon Glass
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Roese @ 2017-03-01  5:52 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 01.03.2017 06:40, Simon Glass wrote:
> On 28 February 2017 at 09:32, Stefan Roese <sr@denx.de> wrote:
>>
>> Hi!
>>
>> I'm currently trying to add some code to stop (DMA) buffer usage
>> in the Marvell mvpp2 ethernet driver, that should only be
>> executed once, before the OS is started - stop() does not work
>> easily for me here. I've found the weak function
>> "board_quiesce_devices()", which is already used for
>> such cases. But since you are not fond of weak functions
>> (I totally agree here, this is far from perfect) and already
>> suggested some kind of "finalize" DM API call, I'm wondering
>> if I should introduce this new API call for such cases and use
>> it in the ethernet driver.
>>
>> So what is your opinion about this? Should I add such a
>> finalize DM function and call it from the arch/.../bootm
>> code? Or do you have other suggestions on how to handle
>> such driver specific last-stage (pre OS) calls?
> 
> Is it possible to use the device's remove() method?

I also thought about this of course. Using remove has the
following disadvantages, that I currently can think of:

- The remove functions of all devices are called, adding
  to the bootup time

- Since all devices are removed, serial (and other) output
  is not available (for debug purposes) any more

It should be possible to add a DM flag to enable this pre-OS
device remove, which could be enabled on a per-device basis.
This way we don't need another API function. But still I
need to hook this pre-OS "remove" into arch/.../bootm.

What do you think?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Device cleanup before starting OS (Linux)
  2017-03-01  5:52   ` Stefan Roese
@ 2017-03-01 10:36     ` Stefan Roese
  2017-03-03  4:53     ` Simon Glass
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2017-03-01 10:36 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 01.03.2017 06:52, Stefan Roese wrote:
> On 01.03.2017 06:40, Simon Glass wrote:
>> On 28 February 2017 at 09:32, Stefan Roese <sr@denx.de> wrote:
>>>
>>> Hi!
>>>
>>> I'm currently trying to add some code to stop (DMA) buffer usage
>>> in the Marvell mvpp2 ethernet driver, that should only be
>>> executed once, before the OS is started - stop() does not work
>>> easily for me here. I've found the weak function
>>> "board_quiesce_devices()", which is already used for
>>> such cases. But since you are not fond of weak functions
>>> (I totally agree here, this is far from perfect) and already
>>> suggested some kind of "finalize" DM API call, I'm wondering
>>> if I should introduce this new API call for such cases and use
>>> it in the ethernet driver.
>>>
>>> So what is your opinion about this? Should I add such a
>>> finalize DM function and call it from the arch/.../bootm
>>> code? Or do you have other suggestions on how to handle
>>> such driver specific last-stage (pre OS) calls?
>>
>> Is it possible to use the device's remove() method?
>
> I also thought about this of course. Using remove has the
> following disadvantages, that I currently can think of:
>
> - The remove functions of all devices are called, adding
>   to the bootup time
>
> - Since all devices are removed, serial (and other) output
>   is not available (for debug purposes) any more
>
> It should be possible to add a DM flag to enable this pre-OS
> device remove, which could be enabled on a per-device basis.
> This way we don't need another API function. But still I
> need to hook this pre-OS "remove" into arch/.../bootm.

I've just sent a small RFC patch series enabling this pre-OS
remove support via DM. It would be great, if you could review
this series and perhaps even ack it, if you are okay with it.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Device cleanup before starting OS (Linux)
  2017-03-01  5:52   ` Stefan Roese
  2017-03-01 10:36     ` Stefan Roese
@ 2017-03-03  4:53     ` Simon Glass
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Glass @ 2017-03-03  4:53 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On 28 February 2017 at 22:52, Stefan Roese <sr@denx.de> wrote:
> Hi Simon,
>
> On 01.03.2017 06:40, Simon Glass wrote:
>> On 28 February 2017 at 09:32, Stefan Roese <sr@denx.de> wrote:
>>>
>>> Hi!
>>>
>>> I'm currently trying to add some code to stop (DMA) buffer usage
>>> in the Marvell mvpp2 ethernet driver, that should only be
>>> executed once, before the OS is started - stop() does not work
>>> easily for me here. I've found the weak function
>>> "board_quiesce_devices()", which is already used for
>>> such cases. But since you are not fond of weak functions
>>> (I totally agree here, this is far from perfect) and already
>>> suggested some kind of "finalize" DM API call, I'm wondering
>>> if I should introduce this new API call for such cases and use
>>> it in the ethernet driver.
>>>
>>> So what is your opinion about this? Should I add such a
>>> finalize DM function and call it from the arch/.../bootm
>>> code? Or do you have other suggestions on how to handle
>>> such driver specific last-stage (pre OS) calls?
>>
>> Is it possible to use the device's remove() method?
>
> I also thought about this of course. Using remove has the
> following disadvantages, that I currently can think of:
>
> - The remove functions of all devices are called, adding
>   to the bootup time

This seems fairly convincing to me, although I'd be interested to see
if the actual impact is noticeable (e.g. >1ms).

>
> - Since all devices are removed, serial (and other) output
>   is not available (for debug purposes) any more

This seems a lot more convincing.

>
> It should be possible to add a DM flag to enable this pre-OS
> device remove, which could be enabled on a per-device basis.
> This way we don't need another API function. But still I
> need to hook this pre-OS "remove" into arch/.../bootm.
>
> What do you think?

I'll reply on the patches.

>
> Thanks,
> Stefan

Regards,
Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-03  4:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 16:32 [U-Boot] Device cleanup before starting OS (Linux) Stefan Roese
2017-03-01  5:40 ` Simon Glass
2017-03-01  5:52   ` Stefan Roese
2017-03-01 10:36     ` Stefan Roese
2017-03-03  4:53     ` Simon Glass

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.