Re: [PATCH v2] media: staging: rkisp1: The rkisp1 should be depended on CONFIG_OF
Em Tue, 14 Jan 2020 10:17:20 +0800 Zhang Xiaoxu escreveu: > If 'CONFIG_VIDEO_ROCKCHIP_ISP1' configured but no 'CONFIG_OF', the > default configuration maybe: > # CONFIG_OF is not set > CONFIG_PHY_ROCKCHIP_DPHY_RX0=y > CONFIG_VIDEO_ROCKCHIP_ISP1=y > > This will cause the following compilation errors: > drivers/staging/media/rkisp1/rkisp1-isp.o: > In function `rkisp1_mipi_csi2_start.isra.5': > rkisp1-isp.c:(.text+0x1238): > undefined reference to `phy_mipi_dphy_get_default_config' > make: *** [vmlinux] Error 1 > > Signed-off-by: Zhang Xiaoxu > --- > drivers/staging/media/rkisp1/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/rkisp1/Kconfig > b/drivers/staging/media/rkisp1/Kconfig > index b859a493caba..23080b7f07a6 100644 > --- a/drivers/staging/media/rkisp1/Kconfig > +++ b/drivers/staging/media/rkisp1/Kconfig > @@ -3,7 +3,7 @@ > config VIDEO_ROCKCHIP_ISP1 > tristate "Rockchip Image Signal Processing v1 Unit driver" > depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API > - depends on ARCH_ROCKCHIP || COMPILE_TEST > + depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF Makes sense. Yet, I would prefer to have this as: depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF depends on ARCH_ROCKCHIP || COMPILE_TEST Just to let the arch-specific/compile test dependency line clearer. > select VIDEOBUF2_DMA_CONTIG > select VIDEOBUF2_VMALLOC > select V4L2_FWNODE Cheers, Mauro ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] iio: adis16480: Make use of __adis_initial_startup
From: Nuno Sá All actions done in `adis16480_initial_setup()` are now done in `__adis_initial_startup()` so, there's no need for code duplication. Furthermore, the call to `adis16480_initial_setup()` is done before any device configuration since the device will be reset if not already (via rst pin). This is actually fixing a potential bug since `adis_reset()` was being called after configuring the device which is obviously a problem. Signed-off-by: Nuno Sá Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis16480.c | 55 - 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index e1de25f18e2e..36973662a31d 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1014,40 +1014,6 @@ static int adis16480_enable_irq(struct adis *adis, bool enable) return __adis_write_reg_16(adis, ADIS16480_REG_FNCTIO_CTRL, val); } -static int adis16480_initial_setup(struct iio_dev *indio_dev) -{ - struct adis16480 *st = iio_priv(indio_dev); - uint16_t prod_id; - unsigned int device_id; - int ret; - - adis_reset(&st->adis); - msleep(70); - - ret = adis_write_reg_16(&st->adis, ADIS16480_REG_GLOB_CMD, BIT(1)); - if (ret) - return ret; - msleep(30); - - ret = adis_check_status(&st->adis); - if (ret) - return ret; - - ret = adis_read_reg_16(&st->adis, ADIS16480_REG_PROD_ID, &prod_id); - if (ret) - return ret; - - ret = sscanf(indio_dev->name, "adis%u\n", &device_id); - if (ret != 1) - return -EINVAL; - - if (prod_id != device_id) - dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.", - device_id, prod_id); - - return 0; -} - #define ADIS16480_DIAG_STAT_XGYRO_FAIL 0 #define ADIS16480_DIAG_STAT_YGYRO_FAIL 1 #define ADIS16480_DIAG_STAT_ZGYRO_FAIL 2 @@ -1075,6 +1041,7 @@ static const char * const adis16480_status_error_msgs[] = { static const struct adis_data adis16480_data = { .diag_stat_reg = ADIS16480_REG_DIAG_STS, .glob_cmd_reg = ADIS16480_REG_GLOB_CMD, + .prod_id_reg = ADIS16480_REG_PROD_ID, .has_paging = true, .read_delay = 5, @@ -1296,18 +1263,22 @@ static int adis16480_probe(struct spi_device *spi) if (ret) return ret; - ret = adis16480_config_irq_pin(spi->dev.of_node, st); + ret = __adis_initial_startup(&st->adis); if (ret) return ret; + ret = adis16480_config_irq_pin(spi->dev.of_node, st); + if (ret) + goto error_stop_device; + ret = adis16480_get_ext_clocks(st); if (ret) - return ret; + goto error_stop_device; if (!IS_ERR_OR_NULL(st->ext_clk)) { ret = adis16480_ext_clk_config(st, spi->dev.of_node, true); if (ret) - return ret; + goto error_stop_device; st->clk_freq = clk_get_rate(st->ext_clk); st->clk_freq *= 1000; /* micro */ @@ -1319,24 +1290,20 @@ static int adis16480_probe(struct spi_device *spi) if (ret) goto error_clk_disable_unprepare; - ret = adis16480_initial_setup(indio_dev); - if (ret) - goto error_cleanup_buffer; - ret = iio_device_register(indio_dev); if (ret) - goto error_stop_device; + goto error_cleanup_buffer; adis16480_debugfs_init(indio_dev); return 0; -error_stop_device: - adis16480_stop_device(indio_dev); error_cleanup_buffer: adis_cleanup_buffer_and_trigger(&st->adis, indio_dev); error_clk_disable_unprepare: clk_disable_unprepare(st->ext_clk); +error_stop_device: + adis16480_stop_device(indio_dev); return ret; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] iio: imu: adis: Add self_test_reg variable
From: Nuno Sá This patch adds a dedicated self_test_reg variable. This is also a step to let new drivers make use of `adis_initial_startup()`. Some devices use MSG_CTRL reg to request a self_test command while others use the GLOB_CMD register. Signed-off-by: Nuno Sá Signed-off-by: Alexandru Ardelean --- drivers/iio/accel/adis16201.c | 1 + drivers/iio/accel/adis16209.c | 1 + drivers/iio/gyro/adis16136.c | 1 + drivers/iio/gyro/adis16260.c | 1 + drivers/iio/imu/adis.c| 6 +++--- drivers/iio/imu/adis16400.c | 1 + drivers/iio/imu/adis16460.c | 2 ++ drivers/iio/imu/adis16480.c | 3 +++ drivers/staging/iio/accel/adis16203.c | 1 + drivers/staging/iio/accel/adis16240.c | 1 + include/linux/iio/imu/adis.h | 2 ++ 11 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/iio/accel/adis16201.c b/drivers/iio/accel/adis16201.c index 0f0f27a8184e..4154e7396bbe 100644 --- a/drivers/iio/accel/adis16201.c +++ b/drivers/iio/accel/adis16201.c @@ -246,6 +246,7 @@ static const struct adis_data adis16201_data = { .diag_stat_reg = ADIS16201_DIAG_STAT_REG, .self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN, + .self_test_reg = ADIS16201_MSC_CTRL_REG, .self_test_no_autoclear = true, .timeouts = &adis16201_timeouts, diff --git a/drivers/iio/accel/adis16209.c b/drivers/iio/accel/adis16209.c index c6dbd2424e10..31d45e7c5485 100644 --- a/drivers/iio/accel/adis16209.c +++ b/drivers/iio/accel/adis16209.c @@ -256,6 +256,7 @@ static const struct adis_data adis16209_data = { .diag_stat_reg = ADIS16209_STAT_REG, .self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN, + .self_test_reg = ADIS16209_MSC_CTRL_REG, .self_test_no_autoclear = true, .timeouts = &adis16209_timeouts, diff --git a/drivers/iio/gyro/adis16136.c b/drivers/iio/gyro/adis16136.c index d5e03a406d4a..e8375d4a408f 100644 --- a/drivers/iio/gyro/adis16136.c +++ b/drivers/iio/gyro/adis16136.c @@ -472,6 +472,7 @@ static const struct adis_data adis16136_data = { .msc_ctrl_reg = ADIS16136_REG_MSC_CTRL, .self_test_mask = ADIS16136_MSC_CTRL_SELF_TEST, + .self_test_reg = ADIS16136_REG_MSC_CTRL, .read_delay = 10, .write_delay = 10, diff --git a/drivers/iio/gyro/adis16260.c b/drivers/iio/gyro/adis16260.c index be09b3e5910c..9823573e811a 100644 --- a/drivers/iio/gyro/adis16260.c +++ b/drivers/iio/gyro/adis16260.c @@ -346,6 +346,7 @@ static const struct adis_data adis16260_data = { .diag_stat_reg = ADIS16260_DIAG_STAT, .self_test_mask = ADIS16260_MSC_CTRL_MEM_TEST, + .self_test_reg = ADIS16260_MSC_CTRL, .timeouts = &adis16260_timeouts, .status_error_msgs = adis1620_status_error_msgs, diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index 022bb54fb748..d02b1911b0f2 100644 --- a/drivers/iio/imu/adis.c +++ b/drivers/iio/imu/adis.c @@ -346,8 +346,8 @@ static int adis_self_test(struct adis *adis) int ret; const struct adis_timeout *timeouts = adis->data->timeouts; - ret = __adis_write_reg_16(adis, adis->data->msc_ctrl_reg, - adis->data->self_test_mask); + ret = __adis_write_reg_16(adis, adis->data->self_test_reg, + adis->data->self_test_mask); if (ret) { dev_err(&adis->spi->dev, "Failed to initiate self test: %d\n", ret); @@ -359,7 +359,7 @@ static int adis_self_test(struct adis *adis) ret = __adis_check_status(adis); if (adis->data->self_test_no_autoclear) - __adis_write_reg_16(adis, adis->data->msc_ctrl_reg, 0x00); + __adis_write_reg_16(adis, adis->data->self_test_reg, 0x00); return ret; } diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c index cfb1c19eb930..a59cd7e0c7ed 100644 --- a/drivers/iio/imu/adis16400.c +++ b/drivers/iio/imu/adis16400.c @@ -1126,6 +1126,7 @@ static const struct adis_data adis16400_data = { .write_delay = 50, .self_test_mask = ADIS16400_MSC_CTRL_MEM_TEST, + .self_test_reg = ADIS16400_MSC_CTRL, .status_error_msgs = adis16400_status_error_msgs, .status_error_mask = BIT(ADIS16400_DIAG_STAT_ZACCL_FAIL) | diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c index 9539cfe4a259..42fa473c6d81 100644 --- a/drivers/iio/imu/adis16460.c +++ b/drivers/iio/imu/adis16460.c @@ -392,6 +392,8 @@ static const struct adis_timeout adis16460_timeouts = { static const struct adis_data adis16460_data = { .diag_stat_reg = ADIS16460_REG_DIAG_STAT, .glob_cmd_reg = ADIS16460_REG_GLOB_CMD, + .self_test_mask = BIT(2), + .self_test_reg = ADIS16460_REG_GLOB_CMD, .has_paging = false, .read_delay = 5, .write_delay = 5, diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index dac87f10
[PATCH 4/4] iio: adis16460: Make use of __adis_initial_startup
From: Nuno Sá All of the actions done in `adis16460_initial_setup()` are now done in `__adis_initial_startup()` so, there's no need for code duplication. Signed-off-by: Nuno Sá Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis16460.c | 37 ++--- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c index 42fa473c6d81..6f94e81c41eb 100644 --- a/drivers/iio/imu/adis16460.c +++ b/drivers/iio/imu/adis16460.c @@ -333,40 +333,6 @@ static int adis16460_enable_irq(struct adis *adis, bool enable) return 0; } -static int adis16460_initial_setup(struct iio_dev *indio_dev) -{ - struct adis16460 *st = iio_priv(indio_dev); - uint16_t prod_id; - unsigned int device_id; - int ret; - - adis_reset(&st->adis); - msleep(222); - - ret = adis_write_reg_16(&st->adis, ADIS16460_REG_GLOB_CMD, BIT(1)); - if (ret) - return ret; - msleep(75); - - ret = adis_check_status(&st->adis); - if (ret) - return ret; - - ret = adis_read_reg_16(&st->adis, ADIS16460_REG_PROD_ID, &prod_id); - if (ret) - return ret; - - ret = sscanf(indio_dev->name, "adis%u\n", &device_id); - if (ret != 1) - return -EINVAL; - - if (prod_id != device_id) - dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.", - device_id, prod_id); - - return 0; -} - #define ADIS16460_DIAG_STAT_IN_CLK_OOS 7 #define ADIS16460_DIAG_STAT_FLASH_MEM 6 #define ADIS16460_DIAG_STAT_SELF_TEST 5 @@ -392,6 +358,7 @@ static const struct adis_timeout adis16460_timeouts = { static const struct adis_data adis16460_data = { .diag_stat_reg = ADIS16460_REG_DIAG_STAT, .glob_cmd_reg = ADIS16460_REG_GLOB_CMD, + .prod_id_reg = ADIS16460_REG_PROD_ID, .self_test_mask = BIT(2), .self_test_reg = ADIS16460_REG_GLOB_CMD, .has_paging = false, @@ -441,7 +408,7 @@ static int adis16460_probe(struct spi_device *spi) adis16460_enable_irq(&st->adis, 0); - ret = adis16460_initial_setup(indio_dev); + ret = __adis_initial_startup(&st->adis); if (ret) goto error_cleanup_buffer; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] iio: imu: adis: Refactor adis_initial_startup
From: Nuno Sá All the ADIS devices perform, at the beginning, a self test to make sure the device is in a sane state. Furthermore, some drivers also do a call to `adis_reset()` before the test which is also a good practice. This patch unifies all those operation so that, there's no need for code duplication. Furthermore, the rst pin is also checked to make sure the device is not in HW reset. On top of this, some drivers also read the device product id and compare it with the device being probed to make sure the correct device is being handled. This can also be passed to the library by introducing a variable holding the PROD_ID register of the device. Signed-off-by: Nuno Sá Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/Kconfig | 1 + drivers/iio/imu/adis.c | 63 ++-- include/linux/iio/imu/adis.h | 15 - 3 files changed, 61 insertions(+), 18 deletions(-) diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig index 60bb1029e759..63036cf473c7 100644 --- a/drivers/iio/imu/Kconfig +++ b/drivers/iio/imu/Kconfig @@ -85,6 +85,7 @@ endmenu config IIO_ADIS_LIB tristate + depends on GPIOLIB help A set of IO helper functions for the Analog Devices ADIS* device family. diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c index d02b1911b0f2..1eca5271380e 100644 --- a/drivers/iio/imu/adis.c +++ b/drivers/iio/imu/adis.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -365,36 +366,64 @@ static int adis_self_test(struct adis *adis) } /** - * adis_inital_startup() - Performs device self-test + * __adis_initial_startup() - Device initial setup * @adis: The adis device * + * This functions makes sure the device is not in reset, via rst pin. + * Furthermore it performs a SW reset (only in the case we are not coming from + * reset already) and a self test. It also compares the product id with the + * device id if the prod_id_reg variable is set. + * * Returns 0 if the device is operational, a negative error code otherwise. * * This function should be called early on in the device initialization sequence * to ensure that the device is in a sane and known state and that it is usable. */ -int adis_initial_startup(struct adis *adis) +int __adis_initial_startup(struct adis *adis) { int ret; - - mutex_lock(&adis->state_lock); + struct gpio_desc *gpio; + const struct adis_timeout *timeouts = adis->data->timeouts; + const char *iio_name = spi_get_device_id(adis->spi)->name; + u16 prod_id, dev_id; + + /* check if the device has rst pin low */ + gpio = devm_gpiod_get_optional(&adis->spi->dev, "reset", GPIOD_ASIS); + if (IS_ERR(gpio)) { + return PTR_ERR(gpio); + } else if (gpio && gpiod_get_value_cansleep(gpio)) { + /* bring device out of reset */ + gpiod_set_value_cansleep(gpio, 0); + msleep(timeouts->reset_ms); + } else { + ret = __adis_reset(adis); + if (ret) + return ret; + } ret = adis_self_test(adis); - if (ret) { - dev_err(&adis->spi->dev, "Self-test failed, trying reset.\n"); - __adis_reset(adis); - ret = adis_self_test(adis); - if (ret) { - dev_err(&adis->spi->dev, "Second self-test failed, giving up.\n"); - goto out_unlock; - } - } + if (ret) + return ret; -out_unlock: - mutex_unlock(&adis->state_lock); - return ret; + if (!adis->data->prod_id_reg) + return 0; + + ret = adis_read_reg_16(adis, adis->data->prod_id_reg, &prod_id); + if (ret) + return ret; + + ret = sscanf(iio_name, "adis%hu\n", &dev_id); + if (ret != 1) + return -EINVAL; + + if (prod_id != dev_id) + dev_warn(&adis->spi->dev, +"Device ID(%u) and product ID(%u) do not match.", +dev_id, prod_id); + + return 0; } -EXPORT_SYMBOL_GPL(adis_initial_startup); +EXPORT_SYMBOL_GPL(__adis_initial_startup); /** * adis_single_conversion() - Performs a single sample conversion diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index d21a013d1122..c43e7922ab32 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h @@ -41,6 +41,7 @@ struct adis_timeout { * @glob_cmd_reg: Register address of the GLOB_CMD register * @msc_ctrl_reg: Register address of the MSC_CTRL register * @diag_stat_reg: Register address of the DIAG_STAT register + * @prod_id_reg: Register address of the PROD_ID register * @self_test_reg: Register address to request self test command * @status_error_msgs: Array of error messgaes * @status_error_mask: @@ -54,6 +55,7 @@ struct adis_data { uns
Proposal / Partnership
I am a banker, I have some amount of funds that I want to move out of the country. I need a good partner someone I can trust. It is risk free and legal. Reply to this email: chiuting...@gmail.com CHIU TING. Proposal / Partnership ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: Add MA USB Host driver
This code is not terrible. It would have helped a lot if you had run it through checkpatch --strict. This driver initializes most local variables to zero which disables GCC's uninitialized error variable checking and generally makes the code harder to understand. Try to remove this as much as you can. On Mon, Jan 20, 2020 at 09:30:43AM +, Vladimir Stankovic wrote: > +++ b/drivers/staging/mausb_host/Kconfig > @@ -0,0 +1,15 @@ > +# > +# Copyright (c) 2019 - 2020 DisplayLink (UK) Ltd. > +# > +# This file is subject to the terms and conditions of the GNU General Public > +# License v2. See the file COPYING in the main directory of this archive for > +# more details. > +# > + > +config HOST_MAUSB > + bool "MA-USB Host Driver" > + depends on USB=y Why can't HOST_MAUSB be built as a module? > + default y It should default to disabled. > +static int mausb_insert_usb_device(struct mausb_dev *mdevs, > + struct mausb_usb_device_ctx *usb_device) > +{ > + struct rb_node **new_node = &(mdevs->usb_devices.rb_node), > +*parent = NULL; This is another this which the code has all over. Split these up into two lines. struct rb_node **new_node = &mdevs->usb_devices.rb_node; struct rb_node *parent = NULL; Search for all the lines that end in a comma and fix them. > +static int mausb_hcd_start(struct usb_hcd *hcd) > +{ > + mausb_pr_info(""); There is too much debug output. Here we can use ftrace to get this information. A lot of the warning messages are not clear. One just says "Fragmentation" without telling the user what to do. I guess search for quotes and think about rephrasing or deleting stuff. > + > + hcd->power_budget = 0; > + hcd->uses_new_polling = 1; > + return 0; > +} [ snip ] > +static int mausb_drop_endpoint(struct usb_hcd *hcd, struct usb_device *dev, > + struct usb_host_endpoint *endpoint) > +{ > + int8_t port_number = 0; > + int status = 0, > + retries = 0; > + struct hub_ctx *hub = (struct hub_ctx *)hcd->hcd_priv; > + struct mausb_device *ma_dev; > + struct mausb_usb_device_ctx *usb_device_ctx; > + struct mausb_endpoint_ctx *endpoint_ctx = endpoint->hcpriv; > + unsigned long flags; > + > + port_number = get_root_hub_port_number(dev); > + > + if (port_number < 0 || port_number >= NUMBER_OF_PORTS) { > + mausb_pr_info("port_number out of range, port_number=%x", > + port_number); > + return -EINVAL; > + } > + > + spin_lock_irqsave(&mhcd->lock, flags); > + ma_dev = hub->ma_devs[port_number].ma_dev; > + spin_unlock_irqrestore(&mhcd->lock, flags); > + > + if (!ma_dev) { > + mausb_pr_err("MAUSB device not found on port_number=%d", > + port_number); > + return -ENODEV; > + } > + > + usb_device_ctx = > + mausb_find_usb_device(&hub->ma_devs[port_number], dev); > + > + if (!endpoint_ctx) { > + mausb_pr_err("Endpoint context doesn't exist"); > + return 0; > + } > + if (!usb_device_ctx) { > + mausb_pr_err("Usb device context doesn't exist"); > + return 0; > + } > + > + mausb_pr_info("Start dropping ep_handle=%#x, dev_handle=%#x", > + endpoint_ctx->ep_handle, endpoint_ctx->dev_handle); > + > + if (atomic_read(&ma_dev->unresponsive_client)) { > + mausb_pr_err("Client is not responsive anymore - drop endpoint > immediately"); > + endpoint->hcpriv = NULL; > + kfree(endpoint_ctx); > + return status; This is an example where disabling GCC's uninitialized variable checking hurts the code. This should be "return 0;" or "return -ESOMETHING;". > + } > + > + status = mausb_epinactivate_event_to_user(ma_dev, > + usb_device_ctx->dev_handle, > + endpoint_ctx->ep_handle); > + > + mausb_pr_info("epinactivate request ep_handle=%#x, dev_handle=%#x, > status=%d", > +endpoint_ctx->ep_handle, endpoint_ctx->dev_handle, > +status); > + > + while (true) { > + status = mausb_epdelete_event_to_user(ma_dev, > + usb_device_ctx->dev_handle, > + endpoint_ctx->ep_handle); > + > + mausb_pr_info("ep_handle_delete_request, ep_handle=%#x, > dev_handle=%#x, status=%d", > + endpoint_ctx->ep_handle, endpoint_ctx->dev_handle, > + status); > + /* sleep for 10 ms to give device some time */ ^ Delete this an just put 10ms in the usleep_range() parameters. Ideally code should document itself.