From 94e3d24f5590d2a9c91ef4c93553dd2bc56f16e1 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 29 Oct 2020 12:56:29 +0000 Subject: [PATCH] bcm57xx: Make hotplug more reliable Although hotpluggging PCIe cards isn't common, it's how I'm testing this in the device test enclosure. Add a tiny delay to wait for the kernel to populate the net class on hotplug. --- plugins/bcm57xx/fu-bcm57xx-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/bcm57xx/fu-bcm57xx-device.c b/plugins/bcm57xx/fu-bcm57xx-device.c index 6b9ded167..5e2907e4a 100644 --- a/plugins/bcm57xx/fu-bcm57xx-device.c +++ b/plugins/bcm57xx/fu-bcm57xx-device.c @@ -75,6 +75,10 @@ fu_bcm57xx_device_probe (FuUdevDevice *device, GError **error) /* only if has an interface */ fn = g_build_filename (fu_udev_device_get_sysfs_path (device), "net", NULL); + if (!g_file_test (fn, G_FILE_TEST_EXISTS)) { + g_debug ("waiting for net devices to appear"); + g_usleep (50 * 1000); + } ifaces = fu_common_filename_glob (fn, "en*", NULL); if (ifaces == NULL || ifaces->len == 0) { fu_device_add_child (FU_DEVICE (self), FU_DEVICE (self->recovery));