Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO driver fixes from Greg KH:
"Here are a number of small IIO and staging driver fixes for 5.15-rc6.

They include:

- vc04_services bugfix for reported problem

- r8188eu array underflow fix

- iio driver fixes for a lot of tiny reported issues.

All of these have been in linux-next for a while with no reported
issues"

* tag 'staging-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: r8188eu: prevent array underflow in rtw_hal_update_ra_mask()
staging: vc04_services: shut up out-of-range warning
iio: light: opt3001: Fixed timeout error when 0 lux
iio: adis16480: fix devices that do not support sleep mode
iio: mtk-auxadc: fix case IIO_CHAN_INFO_PROCESSED
iio: adis16475: fix deadlock on frequency set
iio: ssp_sensors: add more range checking in ssp_parse_dataframe()
iio: ssp_sensors: fix error code in ssp_print_mcu_debug()
iio: adc: ad7793: Fix IRQ flag
iio: adc: ad7780: Fix IRQ flag
iio: adc: ad7192: Add IRQ flag
iio: adc: aspeed: set driver data when adc probe.
iio: adc: rzg2l_adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume()
iio: adc: max1027: Fix the number of max1X31 channels
iio: adc: max1027: Fix wrong shift with 12-bit devices
iio: adc128s052: Fix the error handling path of 'adc128_probe()'
iio: adc: rzg2l_adc: Fix -EBUSY timeout error return
iio: accel: fxls8962af: return IRQ_HANDLED when fifo is flushed
iio: dac: ti-dac5571: fix an error code in probe()

+52 -18
+1 -1
drivers/iio/accel/fxls8962af-core.c
··· 738 738 739 739 if (reg & FXLS8962AF_INT_STATUS_SRC_BUF) { 740 740 ret = fxls8962af_fifo_flush(indio_dev); 741 - if (ret) 741 + if (ret < 0) 742 742 return IRQ_NONE; 743 743 744 744 return IRQ_HANDLED;
+1
drivers/iio/adc/ad7192.c
··· 293 293 .has_registers = true, 294 294 .addr_shift = 3, 295 295 .read_mask = BIT(6), 296 + .irq_flags = IRQF_TRIGGER_FALLING, 296 297 }; 297 298 298 299 static const struct ad_sd_calib_data ad7192_calib_arr[8] = {
+1 -1
drivers/iio/adc/ad7780.c
··· 203 203 .set_mode = ad7780_set_mode, 204 204 .postprocess_sample = ad7780_postprocess_sample, 205 205 .has_registers = false, 206 - .irq_flags = IRQF_TRIGGER_LOW, 206 + .irq_flags = IRQF_TRIGGER_FALLING, 207 207 }; 208 208 209 209 #define _AD7780_CHANNEL(_bits, _wordsize, _mask_all) \
+1 -1
drivers/iio/adc/ad7793.c
··· 206 206 .has_registers = true, 207 207 .addr_shift = 3, 208 208 .read_mask = BIT(6), 209 - .irq_flags = IRQF_TRIGGER_LOW, 209 + .irq_flags = IRQF_TRIGGER_FALLING, 210 210 }; 211 211 212 212 static const struct ad_sd_calib_data ad7793_calib_arr[6] = {
+1
drivers/iio/adc/aspeed_adc.c
··· 183 183 184 184 data = iio_priv(indio_dev); 185 185 data->dev = &pdev->dev; 186 + platform_set_drvdata(pdev, indio_dev); 186 187 187 188 data->base = devm_platform_ioremap_resource(pdev, 0); 188 189 if (IS_ERR(data->base))
+1 -2
drivers/iio/adc/max1027.c
··· 103 103 .sign = 'u', \ 104 104 .realbits = depth, \ 105 105 .storagebits = 16, \ 106 - .shift = 2, \ 106 + .shift = (depth == 10) ? 2 : 0, \ 107 107 .endianness = IIO_BE, \ 108 108 }, \ 109 109 } ··· 142 142 MAX1027_V_CHAN(11, depth) 143 143 144 144 #define MAX1X31_CHANNELS(depth) \ 145 - MAX1X27_CHANNELS(depth), \ 146 145 MAX1X29_CHANNELS(depth), \ 147 146 MAX1027_V_CHAN(12, depth), \ 148 147 MAX1027_V_CHAN(13, depth), \
+8
drivers/iio/adc/mt6577_auxadc.c
··· 82 82 MT6577_AUXADC_CHANNEL(15), 83 83 }; 84 84 85 + /* For Voltage calculation */ 86 + #define VOLTAGE_FULL_RANGE 1500 /* VA voltage */ 87 + #define AUXADC_PRECISE 4096 /* 12 bits */ 88 + 85 89 static int mt_auxadc_get_cali_data(int rawdata, bool enable_cali) 86 90 { 87 91 return rawdata; ··· 195 191 } 196 192 if (adc_dev->dev_comp->sample_data_cali) 197 193 *val = mt_auxadc_get_cali_data(*val, true); 194 + 195 + /* Convert adc raw data to voltage: 0 - 1500 mV */ 196 + *val = *val * VOLTAGE_FULL_RANGE / AUXADC_PRECISE; 197 + 198 198 return IIO_VAL_INT; 199 199 200 200 default:
+4 -2
drivers/iio/adc/rzg2l_adc.c
··· 401 401 exit_hw_init: 402 402 clk_disable_unprepare(adc->pclk); 403 403 404 - return 0; 404 + return ret; 405 405 } 406 406 407 407 static void rzg2l_adc_pm_runtime_disable(void *data) ··· 570 570 return ret; 571 571 572 572 ret = clk_prepare_enable(adc->adclk); 573 - if (ret) 573 + if (ret) { 574 + clk_disable_unprepare(adc->pclk); 574 575 return ret; 576 + } 575 577 576 578 rzg2l_adc_pwr(adc, true); 577 579
+6
drivers/iio/adc/ti-adc128s052.c
··· 171 171 mutex_init(&adc->lock); 172 172 173 173 ret = iio_device_register(indio_dev); 174 + if (ret) 175 + goto err_disable_regulator; 174 176 177 + return 0; 178 + 179 + err_disable_regulator: 180 + regulator_disable(adc->reg); 175 181 return ret; 176 182 } 177 183
+9 -2
drivers/iio/common/ssp_sensors/ssp_spi.c
··· 137 137 if (length > received_len - *data_index || length <= 0) { 138 138 ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n", 139 139 length, received_len); 140 - return length ? length : -EPROTO; 140 + return -EPROTO; 141 141 } 142 142 143 143 ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]); ··· 273 273 for (idx = 0; idx < len;) { 274 274 switch (dataframe[idx++]) { 275 275 case SSP_MSG2AP_INST_BYPASS_DATA: 276 + if (idx >= len) 277 + return -EPROTO; 276 278 sd = dataframe[idx++]; 277 279 if (sd < 0 || sd >= SSP_SENSOR_MAX) { 278 280 dev_err(SSP_DEV, ··· 284 282 285 283 if (indio_devs[sd]) { 286 284 spd = iio_priv(indio_devs[sd]); 287 - if (spd->process_data) 285 + if (spd->process_data) { 286 + if (idx >= len) 287 + return -EPROTO; 288 288 spd->process_data(indio_devs[sd], 289 289 &dataframe[idx], 290 290 data->timestamp); 291 + } 291 292 } else { 292 293 dev_err(SSP_DEV, "no client for frame\n"); 293 294 } ··· 298 293 idx += ssp_offset_map[sd]; 299 294 break; 300 295 case SSP_MSG2AP_INST_DEBUG_DATA: 296 + if (idx >= len) 297 + return -EPROTO; 301 298 sd = ssp_print_mcu_debug(dataframe, &idx, len); 302 299 if (sd) { 303 300 dev_err(SSP_DEV,
+1
drivers/iio/dac/ti-dac5571.c
··· 350 350 data->dac5571_pwrdwn = dac5571_pwrdwn_quad; 351 351 break; 352 352 default: 353 + ret = -EINVAL; 353 354 goto err; 354 355 } 355 356
+2 -1
drivers/iio/imu/adis16475.c
··· 353 353 if (dec > st->info->max_dec) 354 354 dec = st->info->max_dec; 355 355 356 - ret = adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec); 356 + ret = __adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec); 357 357 if (ret) 358 358 goto error; 359 359 360 + adis_dev_unlock(&st->adis); 360 361 /* 361 362 * If decimation is used, then gyro and accel data will have meaningful 362 363 * bits on the LSB registers. This info is used on the trigger handler.
+11 -3
drivers/iio/imu/adis16480.c
··· 144 144 unsigned int max_dec_rate; 145 145 const unsigned int *filter_freqs; 146 146 bool has_pps_clk_mode; 147 + bool has_sleep_cnt; 147 148 const struct adis_data adis_data; 148 149 }; 149 150 ··· 940 939 .temp_scale = 5650, /* 5.65 milli degree Celsius */ 941 940 .int_clk = 2460000, 942 941 .max_dec_rate = 2048, 942 + .has_sleep_cnt = true, 943 943 .filter_freqs = adis16480_def_filter_freqs, 944 944 .adis_data = ADIS16480_DATA(16375, &adis16485_timeouts, 0), 945 945 }, ··· 954 952 .temp_scale = 5650, /* 5.65 milli degree Celsius */ 955 953 .int_clk = 2460000, 956 954 .max_dec_rate = 2048, 955 + .has_sleep_cnt = true, 957 956 .filter_freqs = adis16480_def_filter_freqs, 958 957 .adis_data = ADIS16480_DATA(16480, &adis16480_timeouts, 0), 959 958 }, ··· 968 965 .temp_scale = 5650, /* 5.65 milli degree Celsius */ 969 966 .int_clk = 2460000, 970 967 .max_dec_rate = 2048, 968 + .has_sleep_cnt = true, 971 969 .filter_freqs = adis16480_def_filter_freqs, 972 970 .adis_data = ADIS16480_DATA(16485, &adis16485_timeouts, 0), 973 971 }, ··· 982 978 .temp_scale = 5650, /* 5.65 milli degree Celsius */ 983 979 .int_clk = 2460000, 984 980 .max_dec_rate = 2048, 981 + .has_sleep_cnt = true, 985 982 .filter_freqs = adis16480_def_filter_freqs, 986 983 .adis_data = ADIS16480_DATA(16488, &adis16485_timeouts, 0), 987 984 }, ··· 1430 1425 if (ret) 1431 1426 return ret; 1432 1427 1433 - ret = devm_add_action_or_reset(&spi->dev, adis16480_stop, indio_dev); 1434 - if (ret) 1435 - return ret; 1428 + if (st->chip_info->has_sleep_cnt) { 1429 + ret = devm_add_action_or_reset(&spi->dev, adis16480_stop, 1430 + indio_dev); 1431 + if (ret) 1432 + return ret; 1433 + } 1436 1434 1437 1435 ret = adis16480_config_irq_pin(spi->dev.of_node, st); 1438 1436 if (ret)
+3 -3
drivers/iio/light/opt3001.c
··· 276 276 ret = wait_event_timeout(opt->result_ready_queue, 277 277 opt->result_ready, 278 278 msecs_to_jiffies(OPT3001_RESULT_READY_LONG)); 279 + if (ret == 0) 280 + return -ETIMEDOUT; 279 281 } else { 280 282 /* Sleep for result ready time */ 281 283 timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ? ··· 314 312 /* Disallow IRQ to access the device while lock is active */ 315 313 opt->ok_to_ignore_lock = false; 316 314 317 - if (ret == 0) 318 - return -ETIMEDOUT; 319 - else if (ret < 0) 315 + if (ret < 0) 320 316 return ret; 321 317 322 318 if (opt->use_irq) {
+1 -1
drivers/staging/r8188eu/hal/hal_intf.c
··· 248 248 #ifdef CONFIG_88EU_AP_MODE 249 249 struct sta_info *psta = NULL; 250 250 struct sta_priv *pstapriv = &adapt->stapriv; 251 - if ((mac_id - 1) > 0) 251 + if (mac_id >= 2) 252 252 psta = pstapriv->sta_aid[(mac_id - 1) - 1]; 253 253 if (psta) 254 254 add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
+1 -1
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
··· 182 182 offset = (uintptr_t)ubuf & (PAGE_SIZE - 1); 183 183 num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE); 184 184 185 - if (num_pages > (SIZE_MAX - sizeof(struct pagelist) - 185 + if ((size_t)num_pages > (SIZE_MAX - sizeof(struct pagelist) - 186 186 sizeof(struct vchiq_pagelist_info)) / 187 187 (sizeof(u32) + sizeof(pages[0]) + 188 188 sizeof(struct scatterlist)))