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
Lines changed: 7 additions & 7 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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
L: linux-fpga@vger.kernel.org
1070610706
S: Maintained
1070710707
F: Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update

drivers/fpga/tests/Kconfig

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 14 additions & 10 deletions
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

Lines changed: 14 additions & 25 deletions
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

0 commit comments

Comments
 (0)