Skip to content

Commit db5cda7

Browse files
committed
Merge tag 'char-misc-6.6-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some very small driver fixes for 6.6-final that have shown up in the past two weeks. Included in here are: - tiny fastrpc bugfixes for reported errors - nvmem register fixes - iio driver fixes for some reported problems - fpga test fix - MAINTAINERS file update for fpga All of these have been in linux-next this week with no reported problems" * tag 'char-misc-6.6-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: fpga: Fix memory leak for fpga_region_test_class_find() fpga: m10bmc-sec: Change contact for secure update driver fpga: disable KUnit test suites when module support is enabled iio: afe: rescale: Accept only offset channels nvmem: imx: correct nregs for i.MX6ULL nvmem: imx: correct nregs for i.MX6UL nvmem: imx: correct nregs for i.MX6SLL misc: fastrpc: Unmap only if buffer is unmapped from DSP misc: fastrpc: Clean buffers on remote invocation failures misc: fastrpc: Free DMA handles for RPC calls with no arguments misc: fastrpc: Reset metadata buffer to avoid incorrect free iio: exynos-adc: request second interupt only when touchscreen mode is used iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds dt-bindings: iio: add missing reset-gpios constrain
2 parents 8907bfd + 28926da commit db5cda7

File tree

14 files changed

+85
-73
lines changed

14 files changed

+85
-73
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/sr_root_entry_hash
22
Date: Sep 2022
33
KernelVersion: 5.20
4-
Contact: Russ Weight <russell.h.weight@intel.com>
4+
Contact: Peter Colberg <peter.colberg@intel.com>
55
Description: Read only. Returns the root entry hash for the static
66
region if one is programmed, else it returns the
77
string: "hash not programmed". This file is only
@@ -11,7 +11,7 @@ Description: Read only. Returns the root entry hash for the static
1111
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/pr_root_entry_hash
1212
Date: Sep 2022
1313
KernelVersion: 5.20
14-
Contact: Russ Weight <russell.h.weight@intel.com>
14+
Contact: Peter Colberg <peter.colberg@intel.com>
1515
Description: Read only. Returns the root entry hash for the partial
1616
reconfiguration region if one is programmed, else it
1717
returns the string: "hash not programmed". This file
@@ -21,7 +21,7 @@ Description: Read only. Returns the root entry hash for the partial
2121
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/bmc_root_entry_hash
2222
Date: Sep 2022
2323
KernelVersion: 5.20
24-
Contact: Russ Weight <russell.h.weight@intel.com>
24+
Contact: Peter Colberg <peter.colberg@intel.com>
2525
Description: Read only. Returns the root entry hash for the BMC image
2626
if one is programmed, else it returns the string:
2727
"hash not programmed". This file is only visible if the
@@ -31,31 +31,31 @@ Description: Read only. Returns the root entry hash for the BMC image
3131
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/sr_canceled_csks
3232
Date: Sep 2022
3333
KernelVersion: 5.20
34-
Contact: Russ Weight <russell.h.weight@intel.com>
34+
Contact: Peter Colberg <peter.colberg@intel.com>
3535
Description: Read only. Returns a list of indices for canceled code
3636
signing keys for the static region. The standard bitmap
3737
list format is used (e.g. "1,2-6,9").
3838

3939
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/pr_canceled_csks
4040
Date: Sep 2022
4141
KernelVersion: 5.20
42-
Contact: Russ Weight <russell.h.weight@intel.com>
42+
Contact: Peter Colberg <peter.colberg@intel.com>
4343
Description: Read only. Returns a list of indices for canceled code
4444
signing keys for the partial reconfiguration region. The
4545
standard bitmap list format is used (e.g. "1,2-6,9").
4646

4747
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/bmc_canceled_csks
4848
Date: Sep 2022
4949
KernelVersion: 5.20
50-
Contact: Russ Weight <russell.h.weight@intel.com>
50+
Contact: Peter Colberg <peter.colberg@intel.com>
5151
Description: Read only. Returns a list of indices for canceled code
5252
signing keys for the BMC. The standard bitmap list format
5353
is used (e.g. "1,2-6,9").
5454

5555
What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/flash_count
5656
Date: Sep 2022
5757
KernelVersion: 5.20
58-
Contact: Russ Weight <russell.h.weight@intel.com>
58+
Contact: Peter Colberg <peter.colberg@intel.com>
5959
Description: Read only. Returns number of times the secure update
6060
staging area has been flashed.
6161
Format: "%u".

Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ properties:
3232

3333
spi-cpol: true
3434

35-
reset-gpios: true
35+
reset-gpios:
36+
maxItems: 1
3637

3738
interrupts:
3839
minItems: 1

Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ properties:
7878
- const: -1000
7979
- const: 22000
8080

81-
reset-gpios: true
81+
reset-gpios:
82+
maxItems: 1
8283

8384
adi,dc-dc-ilim-microamp:
8485
enum: [150000, 200000, 250000, 300000, 350000, 400000]

Documentation/devicetree/bindings/iio/health/ti,afe4403.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ properties:
2323
maxItems: 1
2424
description: Connected to ADC_RDY pin.
2525

26-
reset-gpios: true
26+
reset-gpios:
27+
maxItems: 1
2728

2829
required:
2930
- compatible

Documentation/devicetree/bindings/iio/health/ti,afe4404.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ properties:
2323
maxItems: 1
2424
description: Connected to ADC_RDY pin.
2525

26-
reset-gpios: true
26+
reset-gpios:
27+
maxItems: 1
2728

2829
additionalProperties: false
2930

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -10701,7 +10701,7 @@ F: drivers/mfd/intel-m10-bmc*
1070110701
F: include/linux/mfd/intel-m10-bmc.h
1070210702

1070310703
INTEL MAX10 BMC SECURE UPDATES
10704-
M: Russ Weight <russell.h.weight@intel.com>
10704+
M: Peter Colberg <peter.colberg@intel.com>
1070510705
1070610706
S: Maintained
1070710707
F: Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update

drivers/fpga/tests/Kconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config FPGA_KUNIT_TESTS
2-
tristate "KUnit test for the FPGA subsystem" if !KUNIT_ALL_TESTS
3-
depends on FPGA && FPGA_REGION && FPGA_BRIDGE && KUNIT=y
2+
bool "KUnit test for the FPGA subsystem" if !KUNIT_ALL_TESTS
3+
depends on FPGA=y && FPGA_REGION=y && FPGA_BRIDGE=y && KUNIT=y && MODULES=n
44
default KUNIT_ALL_TESTS
55
help
66
This builds unit tests for the FPGA subsystem

drivers/fpga/tests/fpga-region-test.c

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ static void fpga_region_test_class_find(struct kunit *test)
9393

9494
region = fpga_region_class_find(NULL, &ctx->region_pdev->dev, fake_region_match);
9595
KUNIT_EXPECT_PTR_EQ(test, region, ctx->region);
96+
97+
put_device(&region->dev);
9698
}
9799

98100
/*

drivers/iio/adc/exynos_adc.c

+14-10
Original file line numberDiff line numberDiff line change
@@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev)
826826
}
827827
}
828828

829+
/* leave out any TS related code if unreachable */
830+
if (IS_REACHABLE(CONFIG_INPUT)) {
831+
has_ts = of_property_read_bool(pdev->dev.of_node,
832+
"has-touchscreen") || pdata;
833+
}
834+
829835
irq = platform_get_irq(pdev, 0);
830836
if (irq < 0)
831837
return irq;
832838
info->irq = irq;
833839

834-
irq = platform_get_irq(pdev, 1);
835-
if (irq == -EPROBE_DEFER)
836-
return irq;
840+
if (has_ts) {
841+
irq = platform_get_irq(pdev, 1);
842+
if (irq == -EPROBE_DEFER)
843+
return irq;
837844

838-
info->tsirq = irq;
845+
info->tsirq = irq;
846+
} else {
847+
info->tsirq = -1;
848+
}
839849

840850
info->dev = &pdev->dev;
841851

@@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)
900910
if (info->data->init_hw)
901911
info->data->init_hw(info);
902912

903-
/* leave out any TS related code if unreachable */
904-
if (IS_REACHABLE(CONFIG_INPUT)) {
905-
has_ts = of_property_read_bool(pdev->dev.of_node,
906-
"has-touchscreen") || pdata;
907-
}
908-
909913
if (pdata)
910914
info->delay = pdata->delay;
911915
else

drivers/iio/adc/xilinx-xadc-core.c

+14-25
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ static const struct xadc_ops xadc_zynq_ops = {
456456
.interrupt_handler = xadc_zynq_interrupt_handler,
457457
.update_alarm = xadc_zynq_update_alarm,
458458
.type = XADC_TYPE_S7,
459+
/* Temp in C = (val * 503.975) / 2**bits - 273.15 */
460+
.temp_scale = 503975,
461+
.temp_offset = 273150,
459462
};
460463

461464
static const unsigned int xadc_axi_reg_offsets[] = {
@@ -566,6 +569,9 @@ static const struct xadc_ops xadc_7s_axi_ops = {
566569
.interrupt_handler = xadc_axi_interrupt_handler,
567570
.flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL,
568571
.type = XADC_TYPE_S7,
572+
/* Temp in C = (val * 503.975) / 2**bits - 273.15 */
573+
.temp_scale = 503975,
574+
.temp_offset = 273150,
569575
};
570576

571577
static const struct xadc_ops xadc_us_axi_ops = {
@@ -577,6 +583,12 @@ static const struct xadc_ops xadc_us_axi_ops = {
577583
.interrupt_handler = xadc_axi_interrupt_handler,
578584
.flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL,
579585
.type = XADC_TYPE_US,
586+
/**
587+
* Values below are for UltraScale+ (SYSMONE4) using internal reference.
588+
* See https://docs.xilinx.com/v/u/en-US/ug580-ultrascale-sysmon
589+
*/
590+
.temp_scale = 509314,
591+
.temp_offset = 280231,
580592
};
581593

582594
static int _xadc_update_adc_reg(struct xadc *xadc, unsigned int reg,
@@ -945,16 +957,15 @@ static int xadc_read_raw(struct iio_dev *indio_dev,
945957
*val2 = bits;
946958
return IIO_VAL_FRACTIONAL_LOG2;
947959
case IIO_TEMP:
948-
/* Temp in C = (val * 503.975) / 2**bits - 273.15 */
949-
*val = 503975;
960+
*val = xadc->ops->temp_scale;
950961
*val2 = bits;
951962
return IIO_VAL_FRACTIONAL_LOG2;
952963
default:
953964
return -EINVAL;
954965
}
955966
case IIO_CHAN_INFO_OFFSET:
956967
/* Only the temperature channel has an offset */
957-
*val = -((273150 << bits) / 503975);
968+
*val = -((xadc->ops->temp_offset << bits) / xadc->ops->temp_scale);
958969
return IIO_VAL_INT;
959970
case IIO_CHAN_INFO_SAMP_FREQ:
960971
ret = xadc_read_samplerate(xadc);
@@ -1423,28 +1434,6 @@ static int xadc_probe(struct platform_device *pdev)
14231434
if (ret)
14241435
return ret;
14251436

1426-
/* Disable all alarms */
1427-
ret = xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK,
1428-
XADC_CONF1_ALARM_MASK);
1429-
if (ret)
1430-
return ret;
1431-
1432-
/* Set thresholds to min/max */
1433-
for (i = 0; i < 16; i++) {
1434-
/*
1435-
* Set max voltage threshold and both temperature thresholds to
1436-
* 0xffff, min voltage threshold to 0.
1437-
*/
1438-
if (i % 8 < 4 || i == 7)
1439-
xadc->threshold[i] = 0xffff;
1440-
else
1441-
xadc->threshold[i] = 0;
1442-
ret = xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(i),
1443-
xadc->threshold[i]);
1444-
if (ret)
1445-
return ret;
1446-
}
1447-
14481437
/* Go to non-buffered mode */
14491438
xadc_postdisable(indio_dev);
14501439

drivers/iio/adc/xilinx-xadc.h

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ struct xadc_ops {
8585

8686
unsigned int flags;
8787
enum xadc_type type;
88+
int temp_scale;
89+
int temp_offset;
8890
};
8991

9092
static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg,

drivers/iio/afe/iio-rescale.c

+15-4
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,18 @@ static int rescale_read_raw(struct iio_dev *indio_dev,
214214
return ret < 0 ? ret : -EOPNOTSUPP;
215215
}
216216

217-
ret = iio_read_channel_scale(rescale->source, &scale, &scale2);
218-
return rescale_process_offset(rescale, ret, scale, scale2,
217+
if (iio_channel_has_info(rescale->source->channel,
218+
IIO_CHAN_INFO_SCALE)) {
219+
ret = iio_read_channel_scale(rescale->source, &scale, &scale2);
220+
return rescale_process_offset(rescale, ret, scale, scale2,
221+
schan_off, val, val2);
222+
}
223+
224+
/*
225+
* If we get here we have no scale so scale 1:1 but apply
226+
* rescaler and offset, if any.
227+
*/
228+
return rescale_process_offset(rescale, IIO_VAL_FRACTIONAL, 1, 1,
219229
schan_off, val, val2);
220230
default:
221231
return -EINVAL;
@@ -280,8 +290,9 @@ static int rescale_configure_channel(struct device *dev,
280290
chan->type = rescale->cfg->type;
281291

282292
if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) &&
283-
iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE)) {
284-
dev_info(dev, "using raw+scale source channel\n");
293+
(iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE) ||
294+
iio_channel_has_info(schan, IIO_CHAN_INFO_OFFSET))) {
295+
dev_info(dev, "using raw+scale/offset source channel\n");
285296
} else if (iio_channel_has_info(schan, IIO_CHAN_INFO_PROCESSED)) {
286297
dev_info(dev, "using processed channel\n");
287298
rescale->chan_processed = true;

drivers/misc/fastrpc.c

+17-17
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
958958
if (err)
959959
return err;
960960

961+
memset(ctx->buf->virt, 0, pkt_size);
961962
rpra = ctx->buf->virt;
962963
list = fastrpc_invoke_buf_start(rpra, ctx->nscalars);
963964
pages = fastrpc_phy_page_start(list, ctx->nscalars);
@@ -1090,6 +1091,7 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx,
10901091
}
10911092
}
10921093

1094+
/* Clean up fdlist which is updated by DSP */
10931095
for (i = 0; i < FASTRPC_MAX_FDLIST; i++) {
10941096
if (!fdlist[i])
10951097
break;
@@ -1156,11 +1158,9 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
11561158
if (IS_ERR(ctx))
11571159
return PTR_ERR(ctx);
11581160

1159-
if (ctx->nscalars) {
1160-
err = fastrpc_get_args(kernel, ctx);
1161-
if (err)
1162-
goto bail;
1163-
}
1161+
err = fastrpc_get_args(kernel, ctx);
1162+
if (err)
1163+
goto bail;
11641164

11651165
/* make sure that all CPU memory writes are seen by DSP */
11661166
dma_wmb();
@@ -1176,6 +1176,13 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
11761176
err = wait_for_completion_interruptible(&ctx->work);
11771177
}
11781178

1179+
if (err)
1180+
goto bail;
1181+
1182+
/* make sure that all memory writes by DSP are seen by CPU */
1183+
dma_rmb();
1184+
/* populate all the output buffers with results */
1185+
err = fastrpc_put_args(ctx, kernel);
11791186
if (err)
11801187
goto bail;
11811188

@@ -1184,15 +1191,6 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
11841191
if (err)
11851192
goto bail;
11861193

1187-
if (ctx->nscalars) {
1188-
/* make sure that all memory writes by DSP are seen by CPU */
1189-
dma_rmb();
1190-
/* populate all the output buffers with results */
1191-
err = fastrpc_put_args(ctx, kernel);
1192-
if (err)
1193-
goto bail;
1194-
}
1195-
11961194
bail:
11971195
if (err != -ERESTARTSYS && err != -ETIMEDOUT) {
11981196
/* We are done with this compute context */
@@ -1983,11 +1981,13 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me
19831981
sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_MEM_UNMAP, 1, 0);
19841982
err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc,
19851983
&args[0]);
1986-
fastrpc_map_put(map);
1987-
if (err)
1984+
if (err) {
19881985
dev_err(dev, "unmmap\tpt fd = %d, 0x%09llx error\n", map->fd, map->raddr);
1986+
return err;
1987+
}
1988+
fastrpc_map_put(map);
19891989

1990-
return err;
1990+
return 0;
19911991
}
19921992

19931993
static int fastrpc_req_mem_unmap(struct fastrpc_user *fl, char __user *argp)

0 commit comments

Comments
 (0)