It has been reported that memory corruption can occurred because network
packages where received after EXIT_BOOT_SERVICES. See the thread
starting at [1].
We try to remove all drivers when EXIT_BOOT_SERVICES is called. But
* Some network drivers don't call their own stop method when removed.
* Some network drivers don't have a remove method.
* Some devices have CONFIG_DM_DEVICE_REMOVE=n.
Let's call eth_halt() in EXIT_BOOT_SERVICES explicitly.
[1]
https://lore.kernel.org/all/
C101B675-EEE6-44CB-8A44-
83F72182FBD6@kohlschutter.com/
Cc: Michael Brown <mcb30@ipxe.org>
Reported-by: Christian Kohlschütter <christian@kohlschutter.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Michael Brown <mcb30@ipxe.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christian Kohlschütter <christian@kohlschutter.com>
#include <irq_func.h>
#include <log.h>
#include <malloc.h>
+#include <net-common.h>
#include <pe.h>
#include <time.h>
#include <u-boot/crc.h>
bootm_disable_interrupts();
if (IS_ENABLED(CONFIG_USB_DEVICE))
udc_disconnect();
+ if (IS_ENABLED(CONFIG_DM_ETH))
+ eth_halt();
board_quiesce_devices();
dm_remove_devices_active();
}