Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rshim for openSUSE:Factory checked 
in at 2021-10-04 18:40:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rshim (Old)
 and      /work/SRC/openSUSE:Factory/.rshim.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rshim"

Mon Oct  4 18:40:32 2021 rev:7 rq:922961 version:2.0.6.1.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/rshim/rshim.changes      2021-03-12 
13:34:04.822389848 +0100
+++ /work/SRC/openSUSE:Factory/.rshim.new.2443/rshim.changes    2021-10-04 
18:42:24.722296026 +0200
@@ -1,0 +2,10 @@
+Wed Sep 29 06:21:09 UTC 2021 - Matthias Brugger <[email protected]>
+
+- update to 2.0.6.1.5
+  * Disable the background timer if no rshim devices
+  * Setting default path for rshim config file
+  * Refine when some workarounds should be applied
+  * Fix hypervisor crash when several cards boot or push streams
+  * Set MTU to standard max size
+
+-------------------------------------------------------------------

Old:
----
  rshim-2.0.5.10.0.tar

New:
----
  rshim-2.0.6.1.5.tar

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rshim.spec ++++++
--- /var/tmp/diff_new_pack.lix6NM/_old  2021-10-04 18:42:25.214296826 +0200
+++ /var/tmp/diff_new_pack.lix6NM/_new  2021-10-04 18:42:25.222296839 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           rshim
-Version:        2.0.5.10.0
+Version:        2.0.6.1.5
 Release:        0
 Summary:        User-space driver for Mellanox BlueField SoC
 License:        GPL-2.0-only

++++++ rshim-2.0.5.10.0.tar -> rshim-2.0.6.1.5.tar ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/configure.ac 
new/rshim-2.0.6.1.5/configure.ac
--- old/rshim-2.0.5.10.0/configure.ac   2021-03-10 20:17:18.000000000 +0100
+++ new/rshim-2.0.6.1.5/configure.ac    2021-09-24 15:36:45.000000000 +0200
@@ -2,7 +2,7 @@
 # Copyright (C) 2019 Mellanox Technologies. All Rights Reserved.
 #
 
-AC_INIT([rshim], [2.0.5])
+AC_INIT([rshim], [2.0.6])
 AC_CONFIG_AUX_DIR(config)
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 AC_LANG(C)
@@ -91,10 +91,13 @@
 ])
 
 if test $backend = freebsd; then
-AC_SUBST(CPPFLAGS, "$CPPFLAGS -I/usr/local/include/libepoll-shim")
-AC_SUBST(LDFLAGS, "$LDFLAGS -L/usr/local/lib")
+AC_SUBST(CPPFLAGS, "$CPPFLAGS -I${prefix}/include/libepoll-shim")
+AC_SUBST(LDFLAGS, "$LDFLAGS -L${prefix}/lib")
 AC_CHECK_HEADERS([sys/epoll.h],[],[AC_MSG_ERROR([Missing libepoll-shim])])
 AC_CHECK_LIB(epoll-shim, epoll_create1)
+AC_SUBST(CPPFLAGS, "$CPPFLAGS 
-DDEFAULT_RSHIM_CONFIG_FILE='\"${prefix}/etc/rshim.conf\"'")
+else
+AC_SUBST(CPPFLAGS, "$CPPFLAGS 
-DDEFAULT_RSHIM_CONFIG_FILE='\"/etc/rshim.conf\"'")
 fi
 AM_CONDITIONAL([OS_FREEBSD], [test "x$backend" = "xfreebsd"])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/debian/changelog 
new/rshim-2.0.6.1.5/debian/changelog
--- old/rshim-2.0.5.10.0/debian/changelog       2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/debian/changelog        2021-09-24 15:36:45.000000000 
+0200
@@ -1,3 +1,10 @@
+rshim (2.0.6-1) UNRELEASED; urgency=low
+
+  * Disable the background timer if no rshim devices
+  * Setting default path for rshim config file
+
+ -- Liming Sun <[email protected]>  Wed, 12 May 2021 17:50:20 -0400
+
 rshim (2.0.5-10) UNRELEASED; urgency=low
 
   * PCIe hotplug support
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/rhel/rshim.spec.in 
new/rshim-2.0.6.1.5/rhel/rshim.spec.in
--- old/rshim-2.0.5.10.0/rhel/rshim.spec.in     2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/rhel/rshim.spec.in      2021-09-24 15:36:45.000000000 
+0200
@@ -4,7 +4,7 @@
 
 Name: rshim
 Version: @VERSION@
-Release: 10%{?dist}
+Release: 1%{?dist}
 Summary: User-space driver for Mellanox BlueField SoC
 
 License: GPLv2
@@ -54,6 +54,10 @@
 %{_mandir}/man8/rshim.8.gz
 
 %changelog
+* Wed May 12 2021 Liming Sun <[email protected]> - 2.0.6-1
+- Disable the background timer if no rshim devices
+- Setting default path for rshim config file
+
 * Wed Mar 10 2021 Liming Sun <[email protected]> - 2.0.5-10
 - PCIe hotplug support
 - Reduce CPU utilization when there is no rshim device
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/rshim.spec.in 
new/rshim-2.0.6.1.5/rshim.spec.in
--- old/rshim-2.0.5.10.0/rshim.spec.in  2021-03-10 20:17:18.000000000 +0100
+++ new/rshim-2.0.6.1.5/rshim.spec.in   2021-09-24 15:36:45.000000000 +0200
@@ -4,7 +4,7 @@
 
 Name: rshim
 Version: @VERSION@
-Release: 10%{?dist}
+Release: 1%{?dist}
 Summary: User-space driver for Mellanox BlueField SoC
 
 License: GPLv2
@@ -95,6 +95,10 @@
 %{_mandir}/man8/bfb-install.8.gz
 
 %changelog
+* Wed May 12 2021 Liming Sun <[email protected]> - 2.0.6-1
+- Disable the background timer if no rshim devices
+- Setting default path for rshim config file
+
 * Wed Mar 10 2021 Liming Sun <[email protected]> - 2.0.5-10
 - PCIe hotplug support
 - Reduce CPU utilization when there is no rshim device
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim.c 
new/rshim-2.0.6.1.5/src/rshim.c
--- old/rshim-2.0.5.10.0/src/rshim.c    2021-03-10 20:17:18.000000000 +0100
+++ new/rshim-2.0.6.1.5/src/rshim.c     2021-09-24 15:36:45.000000000 +0200
@@ -28,7 +28,6 @@
 
 /* RShim timer interval in milliseconds. */
 #define RSHIM_TIMER_INTERVAL 1
-#define RSHIM_TIMER_INTERVAL_SLOW 100
 
 /* Cycles to poll the network initialization before timeout. */
 #define RSHIM_NET_INIT_DELAY (60000 / RSHIM_TIMER_INTERVAL)
@@ -178,7 +177,7 @@
 char *rshim_static_dev_name;
 
 /* Default configuration file. */
-char *rshim_cfg_file = "/etc/rshim.conf";
+const char *rshim_cfg_file = DEFAULT_RSHIM_CONFIG_FILE;
 static int rshim_display_level = 0;
 static int rshim_boot_timeout = 100;
 int rshim_drop_mode = -1;
@@ -264,11 +263,16 @@
   return total;
 }
 
-/* Wake up the worker function. */
+/* Wake up the epoll loop or worker function. */
 void rshim_work_signal(rshim_backend_t *bd)
 {
-  if (__sync_bool_compare_and_swap(&bd->work_pending, false, true))
-    rshim_fd_full_write(rshim_work_fd[1], &bd->index, sizeof(bd->index));
+  if (bd) {
+    if (__sync_bool_compare_and_swap(&bd->work_pending, false, true))
+      rshim_fd_full_write(rshim_work_fd[1], &bd->index, sizeof(bd->index));
+  } else {
+    int index = -1;
+    rshim_fd_full_write(rshim_work_fd[1], &index, sizeof(index));
+  }
 }
 
 /*
@@ -586,11 +590,15 @@
   }
 }
 
-static int rshim_is_livefish(rshim_backend_t *bd)
+static bool rshim_is_livefish(rshim_backend_t *bd)
 {
   uint32_t yu_boot = 0, boot_status;
   int rc;
 
+  /* No need to check livefish mode for pcie rshim driver. */
+  if (!strncmp(bd->dev_name, "pcie", 4) && strncmp(bd->dev_name + 4, "-lf", 3))
+    return false;
+
   /*
    * A value of 1 in yu_boot.boot_status indicates a successful FW
    * boot, any other value indicates livefish mode.
@@ -599,7 +607,7 @@
   boot_status = (yu_boot >> 17) & 3;
   RSHIM_DBG("yu_boot_status: %d\n", boot_status);
 
-  return (rc != 0 || boot_status != 1);
+  return (!rc && boot_status != 1);
 }
 
 
@@ -637,7 +645,8 @@
     return rc;
   }
 
-  if (bd->ver_id == RSHIM_BLUEFIELD_2 && rshim_is_livefish(bd)) {
+  if (bd->ver_id == RSHIM_BLUEFIELD_2 && bd->rev_id == BLUEFIELD_REV0 &&
+      rshim_is_livefish(bd)) {
     RSHIM_DBG("Apply reset type 13\n");
     /* yu.reset_mode_control.reset_mode_control.sw_reset_event_activation13 */
     rshim_mmio_write32(bd, RSHIM_YU_BASE_ADDR + YU_RESET_ACTIVATION_13, 1);
@@ -669,7 +678,7 @@
     return -ENODEV;
   }
 
-  RSHIM_INFO("rshim%d: boot open\n", bd->index);
+  RSHIM_INFO("rshim%d boot open\n", bd->index);
   bd->is_booting = 1;
   bd->boot_rem_cnt = 0;
 
@@ -735,12 +744,13 @@
     RSHIM_ERR("boot_open: got error %d on reset write\n", rc);
 
 boot_open_done:
-  rshim_ref(bd);
-  pthread_mutex_unlock(&bd->mutex);
 
   /* Add a small delay for the reset. */
   sleep(!bd->has_reprobe ? 10 : 1);
 
+  rshim_ref(bd);
+  pthread_mutex_unlock(&bd->mutex);
+
   time(&bd->boot_write_time);
   return 0;
 }
@@ -799,7 +809,7 @@
       time(&tm);
       if (difftime(tm, bd->boot_write_time) > bd->boot_timeout) {
         rc = -ETIMEDOUT;
-        RSHIM_INFO("rshim%d: boot timeout\n", bd->index);
+        RSHIM_INFO("rshim%d boot timeout\n", bd->index);
       } else {
         rc = -EINTR;
       }
@@ -854,7 +864,7 @@
   rshim_work_signal(bd);
   pthread_mutex_unlock(&bd->mutex);
 
-  RSHIM_INFO("rshim%d: boot close\n", bd->index);
+  RSHIM_INFO("rshim%d boot close\n", bd->index);
   rshim_deref(bd);
 }
 
@@ -2006,7 +2016,7 @@
 }
 
 /*
- * For some SmartNIC cards with UART connected to the same RSim host, the
+ * For some BF-1 SmartNIC cards with UART connected to the same RSim host, the
  * BOO_MODE comes up with 0 after power-cycle thus not able to boot from eMMC.
  * This function provides a workaround to detect such case and reset the card
  * with the correct boot mode.
@@ -2016,6 +2026,10 @@
   int rc;
   uint64_t value, uptime_sw, uptime_hw;
 
+  /* This issue is only seen on BF-1 card. */
+  if (bd->ver_id != RSHIM_BLUEFIELD_1)
+    return;
+
   /* Check boot mode 0, which supposes to be set externally. */
   rc = bd->read_rshim(bd, RSHIM_CHANNEL, RSH_BOOT_CONTROL, &value);
   if (rc || value != RSH_BOOT_CONTROL__BOOT_MODE_VAL_NONE)
@@ -2401,7 +2415,7 @@
   struct itimerspec ts;
 
   ts.it_interval.tv_sec = 0;
-  ts.it_interval.tv_nsec = interval * 1000000;
+  ts.it_interval.tv_nsec = (long)interval * 1000000;
   ts.it_value.tv_sec = 0;
   ts.it_value.tv_nsec = ts.it_interval.tv_nsec;
   rshim_timer_interval = interval;
@@ -2559,26 +2573,27 @@
         if (index != RSHIM_MAX_DEV)
           continue;
       }
-
-      /* Check USB for timeout or unhandled fd. */
-      rshim_usb_poll();
     }
 
+    /* Check USB for timeout or unhandled fd. */
+    rshim_usb_poll();
+
     /* Delayed initialization for livefish probe. */
-    if (!rshim_pcie_lf_init_done && !rshim_backend_name) {
+    if (!rshim_pcie_lf_init_done) {
       time(&t1);
       if (difftime(t1, t0) > 3) {
-        rshim_pcie_lf_init();
+        if (!rshim_backend_name)
+          rshim_pcie_lf_init();
         rshim_pcie_lf_init_done = true;
       }
-    }
-
-    /* Use slower timer if no rshim devices are found. */
-    if (rshim_dev_bitmask) {
-      if (rshim_timer_interval == RSHIM_TIMER_INTERVAL_SLOW)
-        rshim_set_timer(timer_fd, RSHIM_TIMER_INTERVAL);
-    } else if (rshim_timer_interval == RSHIM_TIMER_INTERVAL) {
-        rshim_set_timer(timer_fd, RSHIM_TIMER_INTERVAL_SLOW);
+    } else {
+      /* Disable the timer if no rshim devices are found. */
+      if (rshim_dev_bitmask) {
+        if (!rshim_timer_interval)
+          rshim_set_timer(timer_fd, RSHIM_TIMER_INTERVAL);
+      } else if (rshim_timer_interval) {
+          rshim_set_timer(timer_fd, 0);
+      }
     }
   }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim.h 
new/rshim-2.0.6.1.5/src/rshim.h
--- old/rshim-2.0.5.10.0/src/rshim.h    2021-03-10 20:17:18.000000000 +0100
+++ new/rshim-2.0.6.1.5/src/rshim.h     2021-09-24 15:36:45.000000000 +0200
@@ -140,9 +140,6 @@
   TMFIFO_MAX_CHAN   /* Number of channels */
 };
 
-/* Various rshim definitions. */
-#define RSH_INT_VEC0_RTC__SWINT3_MASK 0x8
-
 #define RSH_BYTE_ACC_READ_TRIGGER 0x50
 #define RSH_BYTE_ACC_SIZE_4BYTE   0x10
 #define RSH_BYTE_ACC_PENDING      0x20
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim_net.c 
new/rshim-2.0.6.1.5/src/rshim_net.c
--- old/rshim-2.0.5.10.0/src/rshim_net.c        2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/src/rshim_net.c 2021-09-24 15:36:45.000000000 +0200
@@ -13,6 +13,7 @@
 #ifdef __FreeBSD__
 #include <net/if.h>
 #include <net/if_tap.h>
+#include <net/ethernet.h>
 #endif
 #include <sys/epoll.h>
 #include <sys/ioctl.h>
@@ -20,8 +21,6 @@
 
 #include "rshim.h"
 
-#define ETH_PKT_SIZE            1536 /* maximum non-jumbo ethernet frame size 
*/
-
 static uint8_t rshim_net_default_mac[6] = {0x00, 0x1A, 0xCA, 0xFF, 0xFF, 0x02};
 
 /* Set non-blocking. */
@@ -167,7 +166,7 @@
 
   snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", ifname);
 
-  ifr.ifr_mtu = ETH_PKT_SIZE;
+  ifr.ifr_mtu = ETHERMTU;
   if (ioctl(s, SIOCSIFMTU, &ifr) < 0) {
     RSHIM_ERR("ioctl SIOCSIMTU failed");
     close(s);
@@ -346,6 +345,11 @@
     }
 
     total_len = ntohs(pkt->hdr.len) + sizeof(pkt->hdr);
+    /* Drop invalid data. */
+    if (total_len > sizeof(*pkt)) {
+      bd->net_rx_len = 0;
+      continue;
+    }
     while (bd->net_rx_len < total_len) {
       len = rshim_fifo_read(bd, (char *)pkt + bd->net_rx_len,
                             total_len - bd->net_rx_len,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim_pcie.c 
new/rshim-2.0.6.1.5/src/rshim_pcie.c
--- old/rshim-2.0.5.10.0/src/rshim_pcie.c       2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/src/rshim_pcie.c        2021-09-24 15:36:45.000000000 
+0200
@@ -300,7 +300,7 @@
   if (rshim_is_bluefield1(dev->pci_dev->device_id)) {
     if (dev->write_count == 15) {
       __sync_synchronize();
-      rshim_pcie_read(bd, chan, RSH_SCRATCHPAD, &result);
+      rshim_pcie_read(bd, chan, RSH_SCRATCHPAD1, &result);
     }
     dev->write_count++;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim_pcie_lf.c 
new/rshim-2.0.6.1.5/src/rshim_pcie_lf.c
--- old/rshim-2.0.5.10.0/src/rshim_pcie_lf.c    2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/src/rshim_pcie_lf.c     2021-09-24 15:36:45.000000000 
+0200
@@ -470,7 +470,7 @@
   if (pci_dev->device_id == BLUEFIELD1_DEVICE_ID) {
     if (dev->write_count == 7) {
       __sync_synchronize();
-      rshim_pcie_read(bd, chan, RSH_SCRATCHPAD, &result);
+      rshim_pcie_read(bd, chan, RSH_SCRATCHPAD1, &result);
     }
   dev->write_count++;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim_regs.h 
new/rshim-2.0.6.1.5/src/rshim_regs.h
--- old/rshim-2.0.5.10.0/src/rshim_regs.h       2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/src/rshim_regs.h        2021-09-24 15:36:45.000000000 
+0200
@@ -67,8 +67,6 @@
 
 #define RSH_SCRATCHPAD1 0xc20
 
-#define RSH_SCRATCHPAD 0x20
-
 #define RSH_TM_HOST_TO_TILE_STS 0xa28
 #define RSH_TM_HOST_TO_TILE_STS__LENGTH 0x0001
 #define RSH_TM_HOST_TO_TILE_STS__COUNT_SHIFT 0
@@ -123,8 +121,6 @@
 #define RSH_MMIO_ADDRESS_SPACE__CHANNEL_VAL_WDOG0 0xe
 #define RSH_MMIO_ADDRESS_SPACE__CHANNEL_VAL_WDOG1 0xf
 
-#define RSH_SWINT 0x318
-
 #define RSH_BYTE_ACC_CTL 0x490
 
 #define RSH_BYTE_ACC_WDAT 0x498
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rshim-2.0.5.10.0/src/rshim_usb.c 
new/rshim-2.0.6.1.5/src/rshim_usb.c
--- old/rshim-2.0.5.10.0/src/rshim_usb.c        2021-03-10 20:17:18.000000000 
+0100
+++ new/rshim-2.0.6.1.5/src/rshim_usb.c 2021-09-24 15:36:45.000000000 +0200
@@ -56,7 +56,7 @@
 
 static libusb_context *rshim_usb_ctx;
 static int rshim_usb_epoll_fd;
-static bool rshim_usb_need_probe;
+static bool rshim_usb_need_probe, rshim_usb_need_poll;
 
 static int rshim_usb_product_ids[] = {
   USB_BLUEFIELD_1_PRODUCT_ID,
@@ -84,51 +84,51 @@
 
 struct rshim_usb_addr bf3_wvalue_widx_pair_map[] = {
        [RSHIM_CHANNEL] = {
-               .wvalue = 0x0400,
+               .wvalue = 0x0300,
                .windex = 0x0000,
        },
        [UART0_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x4000,
+               .wvalue = 0x0301,
+               .windex = 0x0000,
        },
        [UART1_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x5000,
+               .wvalue = 0x0301,
+               .windex = 0x1000,
        },
        [DIAGUART_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x6000,
-       },
-       [OOB_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x7000,
-       },
-       [TIMER_ARM_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x8000,
+               .wvalue = 0x0301,
+               .windex = 0x2000,
        },
        [RSH_HUB_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0x9000,
-       },
-       [TIMER_EXT_CHANNEL] = {
-               .wvalue = 0x0400,
-               .windex = 0xa000,
+               .wvalue = 0x0301,
+               .windex = 0x2400,
        },
        [WDOG0_CHANNEL] = {
-               .wvalue = 0x0402,
+               .wvalue = 0x0302,
                .windex = 0x0000,
        },
        [WDOG1_CHANNEL] = {
-               .wvalue = 0x0404,
+               .wvalue = 0x0304,
                .windex = 0x0000,
        },
-       [GIC_CHANNEL] = {
-               .wvalue = 0x0440,
+       [MCH_CORE_CHANNEL] = {
+               .wvalue = 0x0306,
                .windex = 0x0000,
        },
-       [MCH_CORE_CHANNEL] = {
-               .wvalue = 0x0480,
+       [TIMER_ARM_CHANNEL] = {
+               .wvalue = 0x0308,
+               .windex = 0x0000,
+       },
+       [TIMER_EXT_CHANNEL] = {
+               .wvalue = 0x030a,
+               .windex = 0x0000,
+       },
+       [OOB_CHANNEL] = {
+               .wvalue = 0x030a,
+               .windex = 0x1000,
+       },
+       [YU_CHANNEL] = {
+               .wvalue = 0x0340,
                .windex = 0x0000,
        },
 };
@@ -945,6 +945,11 @@
 
   free(usb_pollfd);
 
+  rshim_usb_need_poll = true;
+
+  /* Notify the polling thread. */
+  rshim_work_signal(NULL);
+
   return rc;
 }
 
@@ -1096,5 +1101,6 @@
     rshim_usb_probe();
   }
 
-  libusb_handle_events_timeout_completed(rshim_usb_ctx, &tv, NULL);
+  if (rshim_usb_need_poll)
+    libusb_handle_events_timeout_completed(rshim_usb_ctx, &tv, NULL);
 }

Reply via email to