Skip to content

Commit 0a6dce0

Browse files
committed
Merge tag 'char-misc-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc/iio driver fixes from Greg KH: "Here are some small char/misc/iio and some other minor driver subsystem fixes for 6.19-rc7. Nothing huge here, just some fixes for reported issues including: - lots of little iio driver fixes - comedi driver fixes - mux driver fix - w1 driver fixes - uio driver fix - slimbus driver fixes - hwtracing bugfix - other tiny bugfixes All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (36 commits) comedi: dmm32at: serialize use of paged registers mei: trace: treat reg parameter as string uio: pci_sva: correct '-ENODEV' check logic uacce: ensure safe queue release with state management uacce: implement mremap in uacce_vm_ops to return -EPERM uacce: fix isolate sysfs check condition uacce: fix cdev handling in the cleanup path slimbus: core: clean up of_slim_get_device() slimbus: core: fix of_slim_get_device() kernel doc slimbus: core: amend slim_get_device() kernel doc slimbus: core: fix device reference leak on report present slimbus: core: fix runtime PM imbalance on report present slimbus: core: fix OF node leak on registration failure intel_th: rename error label intel_th: fix device leak on output open() comedi: Fix getting range information for subdevices 16 to 255 mux: mmio: Fix IS_ERR() vs NULL check in probe() interconnect: debugfs: initialize src_node and dst_node to empty strings iio: dac: ad3552r-hs: fix out-of-bound write in ad3552r_hs_write_data_source iio: accel: iis328dq: fix gain values ...
2 parents 11de40c + 88da5f4 commit 0a6dce0

30 files changed

Lines changed: 313 additions & 139 deletions

File tree

Documentation/devicetree/bindings/interconnect/qcom,sa8775p-rpmh.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,37 @@ allOf:
7474
- description: aggre UFS CARD AXI clock
7575
- description: RPMH CC IPA clock
7676

77+
- if:
78+
properties:
79+
compatible:
80+
contains:
81+
enum:
82+
- qcom,sa8775p-config-noc
83+
- qcom,sa8775p-dc-noc
84+
- qcom,sa8775p-gem-noc
85+
- qcom,sa8775p-gpdsp-anoc
86+
- qcom,sa8775p-lpass-ag-noc
87+
- qcom,sa8775p-mmss-noc
88+
- qcom,sa8775p-nspa-noc
89+
- qcom,sa8775p-nspb-noc
90+
- qcom,sa8775p-pcie-anoc
91+
- qcom,sa8775p-system-noc
92+
then:
93+
properties:
94+
clocks: false
95+
96+
- if:
97+
properties:
98+
compatible:
99+
contains:
100+
enum:
101+
- qcom,sa8775p-clk-virt
102+
- qcom,sa8775p-mc-virt
103+
then:
104+
properties:
105+
reg: false
106+
clocks: false
107+
77108
unevaluatedProperties: false
78109

79110
examples:

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13172,6 +13172,7 @@ F: Documentation/devicetree/bindings/interconnect/
1317213172
F: Documentation/driver-api/interconnect.rst
1317313173
F: drivers/interconnect/
1317413174
F: include/dt-bindings/interconnect/
13175+
F: include/linux/interconnect-clk.h
1317513176
F: include/linux/interconnect-provider.h
1317613177
F: include/linux/interconnect.h
1317713178

drivers/comedi/comedi_fops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ static int do_chaninfo_ioctl(struct comedi_device *dev,
11551155
for (i = 0; i < s->n_chan; i++) {
11561156
int x;
11571157

1158-
x = (dev->minor << 28) | (it->subdev << 24) | (i << 16) |
1158+
x = (it->subdev << 24) | (i << 16) |
11591159
(s->range_table_list[i]->length);
11601160
if (put_user(x, it->rangelist + i))
11611161
return -EFAULT;

drivers/comedi/drivers/dmm32at.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ static int dmm32at_ai_cmdtest(struct comedi_device *dev,
330330

331331
static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec)
332332
{
333+
unsigned long irq_flags;
333334
unsigned char lo1, lo2, hi2;
334335
unsigned short both2;
335336

@@ -342,6 +343,9 @@ static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec)
342343
/* set counter clocks to 10MHz, disable all aux dio */
343344
outb(0, dev->iobase + DMM32AT_CTRDIO_CFG_REG);
344345

346+
/* serialize access to control register and paged registers */
347+
spin_lock_irqsave(&dev->spinlock, irq_flags);
348+
345349
/* get access to the clock regs */
346350
outb(DMM32AT_CTRL_PAGE_8254, dev->iobase + DMM32AT_CTRL_REG);
347351

@@ -354,6 +358,8 @@ static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec)
354358
outb(lo2, dev->iobase + DMM32AT_CLK2);
355359
outb(hi2, dev->iobase + DMM32AT_CLK2);
356360

361+
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
362+
357363
/* enable the ai conversion interrupt and the clock to start scans */
358364
outb(DMM32AT_INTCLK_ADINT |
359365
DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL,
@@ -363,13 +369,19 @@ static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec)
363369
static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
364370
{
365371
struct comedi_cmd *cmd = &s->async->cmd;
372+
unsigned long irq_flags;
366373
int ret;
367374

368375
dmm32at_ai_set_chanspec(dev, s, cmd->chanlist[0], cmd->chanlist_len);
369376

377+
/* serialize access to control register and paged registers */
378+
spin_lock_irqsave(&dev->spinlock, irq_flags);
379+
370380
/* reset the interrupt just in case */
371381
outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG);
372382

383+
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
384+
373385
/*
374386
* wait for circuit to settle
375387
* we don't have the 'insn' here but it's not needed
@@ -429,8 +441,13 @@ static irqreturn_t dmm32at_isr(int irq, void *d)
429441
comedi_handle_events(dev, s);
430442
}
431443

444+
/* serialize access to control register and paged registers */
445+
spin_lock(&dev->spinlock);
446+
432447
/* reset the interrupt */
433448
outb(DMM32AT_CTRL_INTRST, dev->iobase + DMM32AT_CTRL_REG);
449+
450+
spin_unlock(&dev->spinlock);
434451
return IRQ_HANDLED;
435452
}
436453

@@ -481,14 +498,25 @@ static int dmm32at_ao_insn_write(struct comedi_device *dev,
481498
static int dmm32at_8255_io(struct comedi_device *dev,
482499
int dir, int port, int data, unsigned long regbase)
483500
{
501+
unsigned long irq_flags;
502+
int ret;
503+
504+
/* serialize access to control register and paged registers */
505+
spin_lock_irqsave(&dev->spinlock, irq_flags);
506+
484507
/* get access to the DIO regs */
485508
outb(DMM32AT_CTRL_PAGE_8255, dev->iobase + DMM32AT_CTRL_REG);
486509

487510
if (dir) {
488511
outb(data, dev->iobase + regbase + port);
489-
return 0;
512+
ret = 0;
513+
} else {
514+
ret = inb(dev->iobase + regbase + port);
490515
}
491-
return inb(dev->iobase + regbase + port);
516+
517+
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
518+
519+
return ret;
492520
}
493521

494522
/* Make sure the board is there and put it to a known state */

drivers/comedi/range.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int do_rangeinfo_ioctl(struct comedi_device *dev,
5252
const struct comedi_lrange *lr;
5353
struct comedi_subdevice *s;
5454

55-
subd = (it->range_type >> 24) & 0xf;
55+
subd = (it->range_type >> 24) & 0xff;
5656
chan = (it->range_type >> 16) & 0xff;
5757

5858
if (!dev->attached)

drivers/hwtracing/intel_th/core.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,16 +810,19 @@ static int intel_th_output_open(struct inode *inode, struct file *file)
810810
int err;
811811

812812
dev = bus_find_device_by_devt(&intel_th_bus, inode->i_rdev);
813-
if (!dev || !dev->driver) {
813+
if (!dev)
814+
return -ENODEV;
815+
816+
if (!dev->driver) {
814817
err = -ENODEV;
815-
goto out_no_device;
818+
goto err_put_dev;
816819
}
817820

818821
thdrv = to_intel_th_driver(dev->driver);
819822
fops = fops_get(thdrv->fops);
820823
if (!fops) {
821824
err = -ENODEV;
822-
goto out_put_device;
825+
goto err_put_dev;
823826
}
824827

825828
replace_fops(file, fops);
@@ -829,19 +832,29 @@ static int intel_th_output_open(struct inode *inode, struct file *file)
829832
if (file->f_op->open) {
830833
err = file->f_op->open(inode, file);
831834
if (err)
832-
goto out_put_device;
835+
goto err_put_dev;
833836
}
834837

835838
return 0;
836839

837-
out_put_device:
840+
err_put_dev:
838841
put_device(dev);
839-
out_no_device:
842+
840843
return err;
841844
}
842845

846+
static int intel_th_output_release(struct inode *inode, struct file *file)
847+
{
848+
struct intel_th_device *thdev = file->private_data;
849+
850+
put_device(&thdev->dev);
851+
852+
return 0;
853+
}
854+
843855
static const struct file_operations intel_th_output_fops = {
844856
.open = intel_th_output_open,
857+
.release = intel_th_output_release,
845858
.llseek = noop_llseek,
846859
};
847860

drivers/iio/accel/adxl380.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,9 +1784,9 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
17841784
st->int_map[1] = ADXL380_INT0_MAP1_REG;
17851785
} else {
17861786
st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
1787-
if (st->irq > 0)
1788-
return dev_err_probe(st->dev, -ENODEV,
1789-
"no interrupt name specified");
1787+
if (st->irq < 0)
1788+
return dev_err_probe(st->dev, st->irq,
1789+
"no interrupt name specified\n");
17901790
st->int_map[0] = ADXL380_INT1_MAP0_REG;
17911791
st->int_map[1] = ADXL380_INT1_MAP1_REG;
17921792
}

drivers/iio/accel/st_accel_core.c

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
517517
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
518518
.sensors_supported = {
519519
[0] = H3LIS331DL_ACCEL_DEV_NAME,
520-
[1] = IIS328DQ_ACCEL_DEV_NAME,
521520
},
522521
.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
523522
.odr = {
@@ -584,6 +583,77 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
584583
.multi_read_bit = true,
585584
.bootime = 2,
586585
},
586+
{
587+
.wai = 0x32,
588+
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
589+
.sensors_supported = {
590+
[0] = IIS328DQ_ACCEL_DEV_NAME,
591+
},
592+
.ch = (struct iio_chan_spec *)st_accel_12bit_channels,
593+
.odr = {
594+
.addr = 0x20,
595+
.mask = 0x18,
596+
.odr_avl = {
597+
{ .hz = 50, .value = 0x00, },
598+
{ .hz = 100, .value = 0x01, },
599+
{ .hz = 400, .value = 0x02, },
600+
{ .hz = 1000, .value = 0x03, },
601+
},
602+
},
603+
.pw = {
604+
.addr = 0x20,
605+
.mask = 0x20,
606+
.value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
607+
.value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
608+
},
609+
.enable_axis = {
610+
.addr = ST_SENSORS_DEFAULT_AXIS_ADDR,
611+
.mask = ST_SENSORS_DEFAULT_AXIS_MASK,
612+
},
613+
.fs = {
614+
.addr = 0x23,
615+
.mask = 0x30,
616+
.fs_avl = {
617+
[0] = {
618+
.num = ST_ACCEL_FS_AVL_100G,
619+
.value = 0x00,
620+
.gain = IIO_G_TO_M_S_2(980),
621+
},
622+
[1] = {
623+
.num = ST_ACCEL_FS_AVL_200G,
624+
.value = 0x01,
625+
.gain = IIO_G_TO_M_S_2(1950),
626+
},
627+
[2] = {
628+
.num = ST_ACCEL_FS_AVL_400G,
629+
.value = 0x03,
630+
.gain = IIO_G_TO_M_S_2(3910),
631+
},
632+
},
633+
},
634+
.bdu = {
635+
.addr = 0x23,
636+
.mask = 0x80,
637+
},
638+
.drdy_irq = {
639+
.int1 = {
640+
.addr = 0x22,
641+
.mask = 0x02,
642+
},
643+
.int2 = {
644+
.addr = 0x22,
645+
.mask = 0x10,
646+
},
647+
.addr_ihl = 0x22,
648+
.mask_ihl = 0x80,
649+
},
650+
.sim = {
651+
.addr = 0x23,
652+
.value = BIT(0),
653+
},
654+
.multi_read_bit = true,
655+
.bootime = 2,
656+
},
587657
{
588658
/* No WAI register present */
589659
.sensors_supported = {

drivers/iio/adc/ad7280a.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,9 @@ static int ad7280_probe(struct spi_device *spi)
10241024

10251025
st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ;
10261026
st->spi->mode = SPI_MODE_1;
1027-
spi_setup(st->spi);
1027+
ret = spi_setup(st->spi);
1028+
if (ret < 0)
1029+
return ret;
10281030

10291031
st->ctrl_lb = FIELD_PREP(AD7280A_CTRL_LB_ACQ_TIME_MSK, st->acquisition_time) |
10301032
FIELD_PREP(AD7280A_CTRL_LB_THERMISTOR_MSK, st->thermistor_term_en);

drivers/iio/adc/ad7606_par.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static int ad7606_par_bus_setup_iio_backend(struct device *dev,
4343
struct iio_dev *indio_dev)
4444
{
4545
struct ad7606_state *st = iio_priv(indio_dev);
46-
unsigned int ret, c;
46+
unsigned int c;
47+
int ret;
4748
struct iio_backend_data_fmt data = {
4849
.sign_extend = true,
4950
.enable = true,

0 commit comments

Comments
 (0)