diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2023-12-22 15:50:36 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-22 15:50:36 -0300 |
| commit | c743e4b42757b73e4b349eefea11341bc34480fd (patch) | |
| tree | 7a38800e3adc6fe3d00218915147a9f201be13cb | |
| parent | 0a73d1bdd7713a6189482e463c98043c9939a2a2 (diff) | |
| parent | bea769a55fd0e88b813fde9cc9db60b511081ba6 (diff) | |
| download | meta-freescale-c743e4b42757b73e4b349eefea11341bc34480fd.tar.gz | |
Merge pull request #1711 from Villemoes/uuu-bump
uuu: bump to 1.5.141
| -rw-r--r-- | recipes-devtools/uuu/files/0001-libuuu-usbhotplug.cpp-don-t-limit-retry-logic-to-win.patch | 61 | ||||
| -rw-r--r-- | recipes-devtools/uuu/uuu_git.bb | 6 |
2 files changed, 65 insertions, 2 deletions
diff --git a/recipes-devtools/uuu/files/0001-libuuu-usbhotplug.cpp-don-t-limit-retry-logic-to-win.patch b/recipes-devtools/uuu/files/0001-libuuu-usbhotplug.cpp-don-t-limit-retry-logic-to-win.patch new file mode 100644 index 000000000..3c53a65cc --- /dev/null +++ b/recipes-devtools/uuu/files/0001-libuuu-usbhotplug.cpp-don-t-limit-retry-logic-to-win.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From 51e8aa31a9260492576e316096dc8fb68065a7fd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
| 3 | Date: Fri, 22 Dec 2023 11:57:15 +0100 | ||
| 4 | Subject: [PATCH] libuuu/usbhotplug.cpp: don't limit retry logic to windows | ||
| 5 | |||
| 6 | When using the udev rules to avoid use of sudo, we have sometimes | ||
| 7 | observed uuu spuriously failing because it sees the device and | ||
| 8 | attempts to open it, before the udev daemon has had a chance to apply | ||
| 9 | its rules and grant access to the current user (via the 'uaccess' | ||
| 10 | tag). | ||
| 11 | |||
| 12 | The error in that case is -EACCES which libusb translates to | ||
| 13 | LIBUSB_ERROR_ACCESS, so extend the retry logic to that case. Also, | ||
| 14 | since I have seen the open() succeed on the 5th and last attempt, bump | ||
| 15 | the number of retries to 10, for a total of around 2 seconds instead | ||
| 16 | of just 1. | ||
| 17 | |||
| 18 | Upstream-Status: Submitted [https://github.com/nxp-imx/mfgtools/pull/407] | ||
| 19 | Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
| 20 | --- | ||
| 21 | libuuu/usbhotplug.cpp | 11 ++++++----- | ||
| 22 | 1 file changed, 6 insertions(+), 5 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/libuuu/usbhotplug.cpp b/libuuu/usbhotplug.cpp | ||
| 25 | index 815d9dd..cc3d6ce 100644 | ||
| 26 | --- a/libuuu/usbhotplug.cpp | ||
| 27 | +++ b/libuuu/usbhotplug.cpp | ||
| 28 | @@ -214,10 +214,7 @@ static string get_device_path(libusb_device *dev) | ||
| 29 | |||
| 30 | static int open_libusb(libusb_device *dev, void **usb_device_handle) | ||
| 31 | { | ||
| 32 | - int retry = 1; | ||
| 33 | -#ifdef WIN32 | ||
| 34 | - retry = 5; | ||
| 35 | -#endif | ||
| 36 | + int retry = 10; | ||
| 37 | |||
| 38 | while (retry) | ||
| 39 | { | ||
| 40 | @@ -226,13 +223,17 @@ static int open_libusb(libusb_device *dev, void **usb_device_handle) | ||
| 41 | /* work around windows open device failure 1/10 | ||
| 42 | * sometime HID device detect need some time, refresh list | ||
| 43 | * to make sure HID driver installed. | ||
| 44 | + * | ||
| 45 | + * On linux, udev rules may need some time to kick in, | ||
| 46 | + * so also retry on -EACCES. | ||
| 47 | */ | ||
| 48 | CAutoList l; | ||
| 49 | |||
| 50 | int ret; | ||
| 51 | if ((ret = libusb_open(dev, (libusb_device_handle **)(usb_device_handle))) < 0) | ||
| 52 | { | ||
| 53 | - if ((ret != LIBUSB_ERROR_NOT_SUPPORTED) || (retry == 0)) | ||
| 54 | + if ((ret != LIBUSB_ERROR_NOT_SUPPORTED && ret != LIBUSB_ERROR_ACCESS) | ||
| 55 | + || (retry == 0)) | ||
| 56 | { | ||
| 57 | set_last_err_string("Failure open usb device" TRY_SUDO); | ||
| 58 | return -1; | ||
| 59 | -- | ||
| 60 | 2.40.1.1.g1c60b9335d | ||
| 61 | |||
diff --git a/recipes-devtools/uuu/uuu_git.bb b/recipes-devtools/uuu/uuu_git.bb index 29a443be4..69eed48f5 100644 --- a/recipes-devtools/uuu/uuu_git.bb +++ b/recipes-devtools/uuu/uuu_git.bb | |||
| @@ -3,8 +3,10 @@ DESCRIPTION = "Image deploy tool for i.MX chips" | |||
| 3 | HOMEPAGE = "https://github.com/nxp-imx/mfgtools" | 3 | HOMEPAGE = "https://github.com/nxp-imx/mfgtools" |
| 4 | 4 | ||
| 5 | SRC_URI = "git://github.com/nxp-imx/mfgtools.git;protocol=https;branch=master" | 5 | SRC_URI = "git://github.com/nxp-imx/mfgtools.git;protocol=https;branch=master" |
| 6 | SRCREV = "ed48c514ee4c1ea4562c875877b180a87474f895" | 6 | SRCREV = "de317f587003dbd6203af1c647e2fccb912f8f0d" |
| 7 | PV = "1.4.243" | 7 | PV = "1.5.141" |
| 8 | |||
| 9 | SRC_URI += "file://0001-libuuu-usbhotplug.cpp-don-t-limit-retry-logic-to-win.patch" | ||
| 8 | 10 | ||
| 9 | LICENSE = "BSD-3-Clause" | 11 | LICENSE = "BSD-3-Clause" |
| 10 | LIC_FILES_CHKSUM = "file://LICENSE;md5=38ec0c18112e9a92cffc4951661e85a5" | 12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=38ec0c18112e9a92cffc4951661e85a5" |
