History

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

Pull staging and IIO driver fixes from Greg KH: "Here are some Staging and IIO driver fixes to resolve some reported problems for 5.2-rc3. Nothing major here, just some tiny changes, full details are in the shortlog. All have been in linux-next for a while with no reported issues" * tag 'staging-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000' staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup() staging: vc04_services: prevent integer overflow in create_pagelist() Staging: vc04_services: Fix a couple error codes staging: wlan-ng: fix adapter initialization failure staging: kpc2000: double unlock in error handling in kpc_dma_transfer() staging: kpc2000: Fix build error without CONFIG_UIO staging: kpc2000: fix build error on xtensa staging: erofs: set sb->s_root to NULL when failing from __getname() iio: adc: ti-ads8688: fix timestamp is not updated in buffer iio: dac: ds4422/ds4424 fix chip verification iio: imu: mpu6050: Fix FIFO layout for ICM20602 iio: adc: ads124: avoid buffer overflow iio: adc: modify NPCM ADC read reference voltage

Linus Torvalds committed 7 years ago

Commit 2209a302 parents dbde71d e61ff0f14 files · +91 −17Browse files

Unified · Split

14 files
  1. drivers/iio/adc/npcm_adc.c +1 −1
  2. drivers/iio/adc/ti-ads124s08.c +1 −1
  3. drivers/iio/adc/ti-ads8688.c +1 −1
  4. drivers/iio/dac/ds4424.c +1 −1
  5. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +42 −4
  6. drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +19 −1
  7. drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +3 −0
  8. drivers/staging/erofs/super.c +1 −0
  9. drivers/staging/kpc2000/Kconfig +2 −0
  10. drivers/staging/kpc2000/kpc_dma/fileops.c +1 −3
  11. drivers/staging/vc04_services/bcm2835-camera/controls.c +2 −2
  12. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +9 −0
  13. drivers/staging/wilc1000/wilc_wlan.c +6 −2
  14. drivers/staging/wlan-ng/hfa384x_usb.c +2 −1
drivers/iio/adc/npcm_adc.c+1−1
@@ -149,7 +149,7 @@ static int npcm_adc_read_raw(struct iio_dev *indio_dev, · 148 unmodified lines
149149 }
150150 return IIO_VAL_INT;
151151 case IIO_CHAN_INFO_SCALE:
152− if (info->vref) {
152+ if (!IS_ERR(info->vref)) {
153153 vref_uv = regulator_get_voltage(info->vref);
154154 *val = vref_uv / 1000;
155155 } else {
drivers/iio/adc/ti-ads124s08.c+1−1
@@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan) · 201 unmodified lines
202202 };
203203
204204 priv->data[0] = ADS124S08_CMD_RDATA;
205− memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data));
205+ memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1);
206206
207207 ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t));
208208 if (ret < 0)
drivers/iio/adc/ti-ads8688.c+1−1
@@ -397,7 +397,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p) · 396 unmodified lines
397397 }
398398
399399 iio_push_to_buffers_with_timestamp(indio_dev, buffer,
400− pf->timestamp);
400+ iio_get_time_ns(indio_dev));
401401
402402 iio_trigger_notify_done(indio_dev->trig);
403403
drivers/iio/dac/ds4424.c+1−1
@@ -166,7 +166,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev) · 165 unmodified lines
166166 {
167167 int ret, val;
168168
169− ret = ds4424_get_value(indio_dev, &val, DS4424_DAC_ADDR(0));
169+ ret = ds4424_get_value(indio_dev, &val, 0);
170170 if (ret < 0)
171171 dev_err(&indio_dev->dev,
172172 "%s failed. ret: %d\n", __func__, ret);
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+42−4
@@ -471,7 +471,10 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, · 470 unmodified lines
471471 return IIO_VAL_INT_PLUS_MICRO;
472472 case IIO_TEMP:
473473 *val = 0;
474− *val2 = INV_MPU6050_TEMP_SCALE;
474+ if (st->chip_type == INV_ICM20602)
475+ *val2 = INV_ICM20602_TEMP_SCALE;
476+ else
477+ *val2 = INV_MPU6050_TEMP_SCALE;
475478
476479 return IIO_VAL_INT_PLUS_MICRO;
477480 default:
@@ -480,7 +483,10 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, · 2 unmodified lines
480483 case IIO_CHAN_INFO_OFFSET:
481484 switch (chan->type) {
482485 case IIO_TEMP:
483− *val = INV_MPU6050_TEMP_OFFSET;
486+ if (st->chip_type == INV_ICM20602)
487+ *val = INV_ICM20602_TEMP_OFFSET;
488+ else
489+ *val = INV_MPU6050_TEMP_OFFSET;
484490
485491 return IIO_VAL_INT;
486492 default:
@@ -847,6 +853,32 @@ static const struct iio_chan_spec inv_mpu_channels[] = { · 360 unmodified lines
847853 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z),
848854 };
849855
856+static const struct iio_chan_spec inv_icm20602_channels[] = {
857+ IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP),
858+ {
859+ .type = IIO_TEMP,
860+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW)
861+ | BIT(IIO_CHAN_INFO_OFFSET)
862+ | BIT(IIO_CHAN_INFO_SCALE),
863+ .scan_index = INV_ICM20602_SCAN_TEMP,
864+ .scan_type = {
865+ .sign = 's',
866+ .realbits = 16,
867+ .storagebits = 16,
868+ .shift = 0,
869+ .endianness = IIO_BE,
870+ },
871+ },
872+
873+ INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_ICM20602_SCAN_GYRO_X),
874+ INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Y, INV_ICM20602_SCAN_GYRO_Y),
875+ INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Z, INV_ICM20602_SCAN_GYRO_Z),
876+
877+ INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Y, INV_ICM20602_SCAN_ACCL_Y),
878+ INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_X, INV_ICM20602_SCAN_ACCL_X),
879+ INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z),
880+};
881+
850882 /*
851883 * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and
852884 * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the
@@ -1102,8 +1134,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 249 unmodified lines
11021134 indio_dev->name = name;
11031135 else
11041136 indio_dev->name = dev_name(dev);
1105− indio_dev->channels = inv_mpu_channels;
1106− indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);
1137+
1138+ if (chip_type == INV_ICM20602) {
1139+ indio_dev->channels = inv_icm20602_channels;
1140+ indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels);
1141+ } else {
1142+ indio_dev->channels = inv_mpu_channels;
1143+ indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);
1144+ }
11071145
11081146 indio_dev->info = &mpu_info;
11091147 indio_dev->modes = INDIO_BUFFER_TRIGGERED;
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h+19−1
@@ -208,6 +208,9 @@ struct inv_mpu6050_state { · 207 unmodified lines
208208 #define INV_MPU6050_BYTES_PER_3AXIS_SENSOR 6
209209 #define INV_MPU6050_FIFO_COUNT_BYTE 2
210210
211+/* ICM20602 FIFO samples include temperature readings */
212+#define INV_ICM20602_BYTES_PER_TEMP_SENSOR 2
213+
211214 /* mpu6500 registers */
212215 #define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D
213216 #define INV_MPU6500_REG_ACCEL_OFFSET 0x77
@@ -229,6 +232,9 @@ struct inv_mpu6050_state { · 15 unmodified lines
229232 #define INV_MPU6050_GYRO_CONFIG_FSR_SHIFT 3
230233 #define INV_MPU6050_ACCL_CONFIG_FSR_SHIFT 3
231234
235+#define INV_ICM20602_TEMP_OFFSET 8170
236+#define INV_ICM20602_TEMP_SCALE 3060
237+
232238 /* 6 + 6 round up and plus 8 */
233239 #define INV_MPU6050_OUTPUT_DATA_SIZE 24
234240
@@ -270,7 +276,7 @@ struct inv_mpu6050_state { · 35 unmodified lines
270276 #define INV_ICM20608_WHOAMI_VALUE 0xAF
271277 #define INV_ICM20602_WHOAMI_VALUE 0x12
272278
273−/* scan element definition */
279+/* scan element definition for generic MPU6xxx devices */
274280 enum inv_mpu6050_scan {
275281 INV_MPU6050_SCAN_ACCL_X,
276282 INV_MPU6050_SCAN_ACCL_Y,
@@ -281,6 +287,18 @@ enum inv_mpu6050_scan { · 4 unmodified lines
281287 INV_MPU6050_SCAN_TIMESTAMP,
282288 };
283289
290+/* scan element definition for ICM20602, which includes temperature */
291+enum inv_icm20602_scan {
292+ INV_ICM20602_SCAN_ACCL_X,
293+ INV_ICM20602_SCAN_ACCL_Y,
294+ INV_ICM20602_SCAN_ACCL_Z,
295+ INV_ICM20602_SCAN_TEMP,
296+ INV_ICM20602_SCAN_GYRO_X,
297+ INV_ICM20602_SCAN_GYRO_Y,
298+ INV_ICM20602_SCAN_GYRO_Z,
299+ INV_ICM20602_SCAN_TIMESTAMP,
300+};
301+
284302 enum inv_mpu6050_filter_e {
285303 INV_MPU6050_FILTER_256HZ_NOLPF2 = 0,
286304 INV_MPU6050_FILTER_188HZ,
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c+3−0
@@ -207,6 +207,9 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p) · 206 unmodified lines
207207 if (st->chip_config.gyro_fifo_enable)
208208 bytes_per_datum += INV_MPU6050_BYTES_PER_3AXIS_SENSOR;
209209
210+ if (st->chip_type == INV_ICM20602)
211+ bytes_per_datum += INV_ICM20602_BYTES_PER_TEMP_SENSOR;
212+
210213 /*
211214 * read fifo_count register to know how many bytes are inside the FIFO
212215 * right now
drivers/staging/erofs/super.c+1−0
@@ -457,6 +457,7 @@ static int erofs_read_super(struct super_block *sb, · 456 unmodified lines
457457 */
458458 err_devname:
459459 dput(sb->s_root);
460+ sb->s_root = NULL;
460461 err_iget:
461462 #ifdef EROFS_FS_HAS_MANAGED_CACHE
462463 iput(sbi->managed_cache);
drivers/staging/kpc2000/Kconfig+2−0
@@ -2,7 +2,9 @@ · 1 unmodified line
22
33 config KPC2000
44 bool "Daktronics KPC Device support"
5+ select MFD_CORE
56 depends on PCI
7+ depends on UIO
68 help
79 Select this if you wish to use the Daktronics KPC PCI devices
810
drivers/staging/kpc2000/kpc_dma/fileops.c+1−3
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #include <linux/errno.h> /* error codes */
99 #include <linux/types.h> /* size_t */
1010 #include <linux/cdev.h>
11−#include <asm/uaccess.h> /* copy_*_user */
11+#include <linux/uaccess.h> /* copy_*_user */
1212 #include <linux/aio.h> /* aio stuff */
1313 #include <linux/highmem.h>
1414 #include <linux/pagemap.h>
@@ -116,13 +116,11 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned · 101 unmodified lines
116116 if (desc_needed >= ldev->desc_pool_cnt){
117117 dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d TOO MANY to ever complete!\n", acd->mapped_entry_count, desc_needed, num_descrs_avail);
118118 rv = -EAGAIN;
119− unlock_engine(ldev);
120119 goto err_descr_too_many;
121120 }
122121 if (desc_needed > num_descrs_avail){
123122 dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d Too many to complete right now.\n", acd->mapped_entry_count, desc_needed, num_descrs_avail);
124123 rv = -EMSGSIZE;
125− unlock_engine(ldev);
126124 goto err_descr_too_many;
127125 }
128126
drivers/staging/vc04_services/bcm2835-camera/controls.c+2−2
@@ -572,7 +572,7 @@ exit: · 571 unmodified lines
572572 dev->colourfx.enable ? "true" : "false",
573573 dev->colourfx.u, dev->colourfx.v,
574574 ret, (ret == 0 ? 0 : -EINVAL));
575− return (ret == 0 ? 0 : EINVAL);
575+ return (ret == 0 ? 0 : -EINVAL);
576576 }
577577
578578 static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
@@ -596,7 +596,7 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, · 17 unmodified lines
596596 "%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n",
597597 __func__, mmal_ctrl, ctrl->id, ctrl->val, ret,
598598 (ret == 0 ? 0 : -EINVAL));
599− return (ret == 0 ? 0 : EINVAL);
599+ return (ret == 0 ? 0 : -EINVAL);
600600 }
601601
602602 static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev,
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c+9−0
@@ -368,9 +368,18 @@ create_pagelist(char __user *buf, size_t count, unsigned short type) · 367 unmodified lines
368368 int dma_buffers;
369369 dma_addr_t dma_addr;
370370
371+ if (count >= INT_MAX - PAGE_SIZE)
372+ return NULL;
373+
371374 offset = ((unsigned int)(unsigned long)buf & (PAGE_SIZE - 1));
372375 num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE);
373376
377+ if (num_pages > (SIZE_MAX - sizeof(struct pagelist) -
378+ sizeof(struct vchiq_pagelist_info)) /
379+ (sizeof(u32) + sizeof(pages[0]) +
380+ sizeof(struct scatterlist)))
381+ return NULL;
382+
374383 pagelist_size = sizeof(struct pagelist) +
375384 (num_pages * sizeof(u32)) +
376385 (num_pages * sizeof(pages[0]) +
drivers/staging/wilc1000/wilc_wlan.c+6−2
@@ -1076,13 +1076,17 @@ void wilc_wlan_cleanup(struct net_device *dev) · 1075 unmodified lines
10761076 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP);
10771077
10781078 ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, &reg);
1079− if (!ret)
1079+ if (!ret) {
10801080 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
1081+ return;
1082+ }
10811083
10821084 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0,
10831085 (reg | ABORT_INT));
1084− if (!ret)
1086+ if (!ret) {
10851087 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
1088+ return;
1089+ }
10861090
10871091 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
10881092 wilc->hif_func->hif_deinit(NULL);
drivers/staging/wlan-ng/hfa384x_usb.c+2−1
@@ -3119,7 +3119,9 @@ static void hfa384x_usbin_callback(struct urb *urb) · 3118 unmodified lines
31193119 break;
31203120 }
31213121
3122+ /* Save values from the RX URB before reposting overwrites it. */
31223123 urb_status = urb->status;
3124+ usbin = (union hfa384x_usbin *)urb->transfer_buffer;
31233125
31243126 if (action != ABORT) {
31253127 /* Repost the RX URB */
@@ -3136,7 +3138,6 @@ static void hfa384x_usbin_callback(struct urb *urb) · 10 unmodified lines
31363138 /* Note: the check of the sw_support field, the type field doesn't
31373139 * have bit 12 set like the docs suggest.
31383140 */
3139− usbin = (union hfa384x_usbin *)urb->transfer_buffer;
31403141 type = le16_to_cpu(usbin->type);
31413142 if (HFA384x_USB_ISRXFRM(type)) {
31423143 if (action == HANDLE) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t