Skip to content

Commit a477e3a

Browse files
committed
Merge tag 'char-misc-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here is a small set of char/misc and other smaller driver subsystem fixes for 6.6-rc6. Included in here are: - lots of iio driver fixes - binder memory leak fix - mcb driver fixes - counter driver fixes - firmware loader documentation fix - documentation update for embargoed hardware issues All of these have been in linux-next for over a week with no reported issues" * tag 'char-misc-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (22 commits) iio: pressure: ms5611: ms5611_prom_is_valid false negative bug dt-bindings: iio: adc: adi,ad7292: Fix additionalProperties on channel nodes iio: adc: ad7192: Correct reference voltage iio: light: vcnl4000: Don't power on/off chip in config iio: addac: Kconfig: update ad74413r selections iio: pressure: dps310: Adjust Timeout Settings iio: imu: bno055: Fix missing Kconfig dependencies iio: adc: imx8qxp: Fix address for command buffer registers iio: cros_ec: fix an use-after-free in cros_ec_sensors_push_data() iio: irsd200: fix -Warray-bounds bug in irsd200_trigger_handler dt-bindings: iio: rohm,bu27010: add missing vdd-supply to example binder: fix memory leaks of spam and pending work firmware_loader: Update contact emails for ABI docs Documentation: embargoed-hardware-issues.rst: Clarify prenotifaction mcb: remove is_added flag from mcb_device struct coresight: tmc-etr: Disable warnings for allocation failures coresight: Fix run time warnings while reusing ETR buffer iio: admv1013: add mixer_vgate corner cases iio: pressure: bmp280: Fix NULL pointer exception iio: dac: ad3552r: Correct device IDs ...
2 parents 19fd4a9 + ffd1f15 commit a477e3a

File tree

24 files changed

+94
-62
lines changed

24 files changed

+94
-62
lines changed

Documentation/ABI/testing/sysfs-class-firmware

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
What: /sys/class/firmware/.../data
22
Date: July 2022
33
KernelVersion: 5.19
4-
Contact: Russ Weight <russell.h.weight@intel.com>
4+
Contact: Russ Weight <russ.weight@linux.dev>
55
Description: The data sysfs file is used for firmware-fallback and for
66
firmware uploads. Cat a firmware image to this sysfs file
77
after you echo 1 to the loading sysfs file. When the firmware
@@ -13,7 +13,7 @@ Description: The data sysfs file is used for firmware-fallback and for
1313
What: /sys/class/firmware/.../cancel
1414
Date: July 2022
1515
KernelVersion: 5.19
16-
Contact: Russ Weight <russell.h.weight@intel.com>
16+
Contact: Russ Weight <russ.weight@linux.dev>
1717
Description: Write-only. For firmware uploads, write a "1" to this file to
1818
request that the transfer of firmware data to the lower-level
1919
device be canceled. This request will be rejected (EBUSY) if
@@ -23,7 +23,7 @@ Description: Write-only. For firmware uploads, write a "1" to this file to
2323
What: /sys/class/firmware/.../error
2424
Date: July 2022
2525
KernelVersion: 5.19
26-
Contact: Russ Weight <russell.h.weight@intel.com>
26+
Contact: Russ Weight <russ.weight@linux.dev>
2727
Description: Read-only. Returns a string describing a failed firmware
2828
upload. This string will be in the form of <STATUS>:<ERROR>,
2929
where <STATUS> will be one of the status strings described
@@ -37,7 +37,7 @@ Description: Read-only. Returns a string describing a failed firmware
3737
What: /sys/class/firmware/.../loading
3838
Date: July 2022
3939
KernelVersion: 5.19
40-
Contact: Russ Weight <russell.h.weight@intel.com>
40+
Contact: Russ Weight <russ.weight@linux.dev>
4141
Description: The loading sysfs file is used for both firmware-fallback and
4242
for firmware uploads. Echo 1 onto the loading file to indicate
4343
you are writing a firmware file to the data sysfs node. Echo
@@ -49,7 +49,7 @@ Description: The loading sysfs file is used for both firmware-fallback and
4949
What: /sys/class/firmware/.../remaining_size
5050
Date: July 2022
5151
KernelVersion: 5.19
52-
Contact: Russ Weight <russell.h.weight@intel.com>
52+
Contact: Russ Weight <russ.weight@linux.dev>
5353
Description: Read-only. For firmware upload, this file contains the size
5454
of the firmware data that remains to be transferred to the
5555
lower-level device driver. The size value is initialized to
@@ -62,15 +62,15 @@ Description: Read-only. For firmware upload, this file contains the size
6262
What: /sys/class/firmware/.../status
6363
Date: July 2022
6464
KernelVersion: 5.19
65-
Contact: Russ Weight <russell.h.weight@intel.com>
65+
Contact: Russ Weight <russ.weight@linux.dev>
6666
Description: Read-only. Returns a string describing the current status of
6767
a firmware upload. The string will be one of the following:
6868
idle, "receiving", "preparing", "transferring", "programming".
6969

7070
What: /sys/class/firmware/.../timeout
7171
Date: July 2022
7272
KernelVersion: 5.19
73-
Contact: Russ Weight <russell.h.weight@intel.com>
73+
Contact: Russ Weight <russ.weight@linux.dev>
7474
Description: This file supports the timeout mechanism for firmware
7575
fallback. This file has no affect on firmware uploads. For
7676
more information on timeouts please see the documentation

Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ patternProperties:
6161
required:
6262
- reg
6363

64-
additionalProperties: true
64+
additionalProperties: false
6565

6666
allOf:
6767
- $ref: /schemas/spi/spi-peripheral-props.yaml#

Documentation/devicetree/bindings/iio/light/rohm,bu27010.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ examples:
4545
light-sensor@38 {
4646
compatible = "rohm,bu27010";
4747
reg = <0x38>;
48+
vdd-supply = <&vdd>;
4849
};
4950
};

Documentation/process/embargoed-hardware-issues.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Contact
2525
The Linux kernel hardware security team is separate from the regular Linux
2626
kernel security team.
2727

28-
The team only handles the coordination of embargoed hardware security
29-
issues. Reports of pure software security bugs in the Linux kernel are not
28+
The team only handles developing fixes for embargoed hardware security
29+
issues. Reports of pure software security bugs in the Linux kernel are not
3030
handled by this team and the reporter will be guided to contact the regular
3131
Linux kernel security team (:ref:`Documentation/admin-guide/
3232
<securitybugs>`) instead.
3333

3434
The team can be contacted by email at <[email protected]>. This
35-
is a private list of security officers who will help you to coordinate an
36-
issue according to our documented process.
35+
is a private list of security officers who will help you to coordinate a
36+
fix according to our documented process.
3737

3838
The list is encrypted and email to the list can be sent by either PGP or
3939
S/MIME encrypted and must be signed with the reporter's PGP key or S/MIME
@@ -132,11 +132,11 @@ other hardware could be affected.
132132

133133
The hardware security team will provide an incident-specific encrypted
134134
mailing-list which will be used for initial discussion with the reporter,
135-
further disclosure and coordination.
135+
further disclosure, and coordination of fixes.
136136

137137
The hardware security team will provide the disclosing party a list of
138138
developers (domain experts) who should be informed initially about the
139-
issue after confirming with the developers that they will adhere to this
139+
issue after confirming with the developers that they will adhere to this
140140
Memorandum of Understanding and the documented process. These developers
141141
form the initial response team and will be responsible for handling the
142142
issue after initial contact. The hardware security team is supporting the
@@ -209,13 +209,18 @@ five work days this is taken as silent acknowledgement.
209209
After acknowledgement or resolution of an objection the expert is disclosed
210210
by the incident team and brought into the development process.
211211

212+
List participants may not communicate about the issue outside of the
213+
private mailing list. List participants may not use any shared resources
214+
(e.g. employer build farms, CI systems, etc) when working on patches.
215+
212216

213217
Coordinated release
214218
"""""""""""""""""""
215219

216220
The involved parties will negotiate the date and time where the embargo
217221
ends. At that point the prepared mitigations are integrated into the
218-
relevant kernel trees and published.
222+
relevant kernel trees and published. There is no pre-notification process:
223+
fixes are published in public and available to everyone at the same time.
219224

220225
While we understand that hardware security issues need coordinated embargo
221226
time, the embargo time should be constrained to the minimum time which is

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8110,7 +8110,7 @@ F: include/linux/arm_ffa.h
81108110

81118111
FIRMWARE LOADER (request_firmware)
81128112
M: Luis Chamberlain <[email protected]>
8113-
M: Russ Weight <russell.h.weight@intel.com>
8113+
M: Russ Weight <russ.weight@linux.dev>
81148114
81158115
S: Maintained
81168116
F: Documentation/firmware_class/

drivers/android/binder.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4812,6 +4812,8 @@ static void binder_release_work(struct binder_proc *proc,
48124812
"undelivered TRANSACTION_ERROR: %u\n",
48134813
e->cmd);
48144814
} break;
4815+
case BINDER_WORK_TRANSACTION_PENDING:
4816+
case BINDER_WORK_TRANSACTION_ONEWAY_SPAM_SUSPECT:
48154817
case BINDER_WORK_TRANSACTION_COMPLETE: {
48164818
binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
48174819
"undelivered TRANSACTION_COMPLETE\n");

drivers/counter/counter-chrdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ static int counter_get_ext(const struct counter_comp *const ext,
247247
if (*id == component_id)
248248
return 0;
249249

250-
if (ext->type == COUNTER_COMP_ARRAY) {
251-
element = ext->priv;
250+
if (ext[*ext_idx].type == COUNTER_COMP_ARRAY) {
251+
element = ext[*ext_idx].priv;
252252

253253
if (component_id - *id < element->length)
254254
return 0;

drivers/counter/microchip-tcb-capture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
9797
priv->qdec_mode = 0;
9898
/* Set highest rate based on whether soc has gclk or not */
9999
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
100-
if (priv->tc_cfg->has_gclk)
100+
if (!priv->tc_cfg->has_gclk)
101101
cmr |= ATMEL_TC_TIMER_CLOCK2;
102102
else
103103
cmr |= ATMEL_TC_TIMER_CLOCK1;

drivers/hwtracing/coresight/coresight-tmc-etr.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ static int tmc_etr_alloc_flat_buf(struct tmc_drvdata *drvdata,
610610

611611
flat_buf->vaddr = dma_alloc_noncoherent(real_dev, etr_buf->size,
612612
&flat_buf->daddr,
613-
DMA_FROM_DEVICE, GFP_KERNEL);
613+
DMA_FROM_DEVICE,
614+
GFP_KERNEL | __GFP_NOWARN);
614615
if (!flat_buf->vaddr) {
615616
kfree(flat_buf);
616617
return -ENOMEM;
@@ -1173,16 +1174,6 @@ static struct etr_buf *tmc_etr_get_sysfs_buffer(struct coresight_device *csdev)
11731174
goto out;
11741175
}
11751176

1176-
/*
1177-
* In sysFS mode we can have multiple writers per sink. Since this
1178-
* sink is already enabled no memory is needed and the HW need not be
1179-
* touched, even if the buffer size has changed.
1180-
*/
1181-
if (drvdata->mode == CS_MODE_SYSFS) {
1182-
atomic_inc(&csdev->refcnt);
1183-
goto out;
1184-
}
1185-
11861177
/*
11871178
* If we don't have a buffer or it doesn't match the requested size,
11881179
* use the buffer allocated above. Otherwise reuse the existing buffer.
@@ -1204,7 +1195,7 @@ static struct etr_buf *tmc_etr_get_sysfs_buffer(struct coresight_device *csdev)
12041195

12051196
static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
12061197
{
1207-
int ret;
1198+
int ret = 0;
12081199
unsigned long flags;
12091200
struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
12101201
struct etr_buf *sysfs_buf = tmc_etr_get_sysfs_buffer(csdev);
@@ -1213,12 +1204,24 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
12131204
return PTR_ERR(sysfs_buf);
12141205

12151206
spin_lock_irqsave(&drvdata->spinlock, flags);
1207+
1208+
/*
1209+
* In sysFS mode we can have multiple writers per sink. Since this
1210+
* sink is already enabled no memory is needed and the HW need not be
1211+
* touched, even if the buffer size has changed.
1212+
*/
1213+
if (drvdata->mode == CS_MODE_SYSFS) {
1214+
atomic_inc(&csdev->refcnt);
1215+
goto out;
1216+
}
1217+
12161218
ret = tmc_etr_enable_hw(drvdata, sysfs_buf);
12171219
if (!ret) {
12181220
drvdata->mode = CS_MODE_SYSFS;
12191221
atomic_inc(&csdev->refcnt);
12201222
}
12211223

1224+
out:
12221225
spin_unlock_irqrestore(&drvdata->spinlock, flags);
12231226

12241227
if (!ret)

drivers/iio/adc/ad7192.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ struct ad7192_chip_info {
177177
struct ad7192_state {
178178
const struct ad7192_chip_info *chip_info;
179179
struct regulator *avdd;
180+
struct regulator *vref;
180181
struct clk *mclk;
181182
u16 int_vref_mv;
182183
u32 fclk;
@@ -1008,10 +1009,30 @@ static int ad7192_probe(struct spi_device *spi)
10081009
if (ret)
10091010
return dev_err_probe(&spi->dev, ret, "Failed to enable specified DVdd supply\n");
10101011

1011-
ret = regulator_get_voltage(st->avdd);
1012-
if (ret < 0) {
1013-
dev_err(&spi->dev, "Device tree error, reference voltage undefined\n");
1014-
return ret;
1012+
st->vref = devm_regulator_get_optional(&spi->dev, "vref");
1013+
if (IS_ERR(st->vref)) {
1014+
if (PTR_ERR(st->vref) != -ENODEV)
1015+
return PTR_ERR(st->vref);
1016+
1017+
ret = regulator_get_voltage(st->avdd);
1018+
if (ret < 0)
1019+
return dev_err_probe(&spi->dev, ret,
1020+
"Device tree error, AVdd voltage undefined\n");
1021+
} else {
1022+
ret = regulator_enable(st->vref);
1023+
if (ret) {
1024+
dev_err(&spi->dev, "Failed to enable specified Vref supply\n");
1025+
return ret;
1026+
}
1027+
1028+
ret = devm_add_action_or_reset(&spi->dev, ad7192_reg_disable, st->vref);
1029+
if (ret)
1030+
return ret;
1031+
1032+
ret = regulator_get_voltage(st->vref);
1033+
if (ret < 0)
1034+
return dev_err_probe(&spi->dev, ret,
1035+
"Device tree error, Vref voltage undefined\n");
10151036
}
10161037
st->int_vref_mv = ret / 1000;
10171038

drivers/iio/adc/imx8qxp-adc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
#define IMX8QXP_ADR_ADC_FCTRL 0x30
3939
#define IMX8QXP_ADR_ADC_SWTRIG 0x34
4040
#define IMX8QXP_ADR_ADC_TCTRL(tid) (0xc0 + (tid) * 4)
41-
#define IMX8QXP_ADR_ADC_CMDH(cid) (0x100 + (cid) * 8)
42-
#define IMX8QXP_ADR_ADC_CMDL(cid) (0x104 + (cid) * 8)
41+
#define IMX8QXP_ADR_ADC_CMDL(cid) (0x100 + (cid) * 8)
42+
#define IMX8QXP_ADR_ADC_CMDH(cid) (0x104 + (cid) * 8)
4343
#define IMX8QXP_ADR_ADC_RESFIFO 0x300
4444
#define IMX8QXP_ADR_ADC_TST 0xffc
4545

drivers/iio/addac/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ config AD74413R
2424
depends on GPIOLIB && SPI
2525
select REGMAP_SPI
2626
select CRC8
27+
select IIO_BUFFER
28+
select IIO_TRIGGERED_BUFFER
2729
help
2830
Say yes here to build support for Analog Devices AD74412R/AD74413R
2931
quad-channel software configurable input/output solution.

drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,11 @@ int cros_ec_sensors_push_data(struct iio_dev *indio_dev,
190190
/*
191191
* Ignore samples if the buffer is not set: it is needed if the ODR is
192192
* set but the buffer is not enabled yet.
193+
*
194+
* Note: iio_device_claim_buffer_mode() returns -EBUSY if the buffer
195+
* is not enabled.
193196
*/
194-
if (!iio_buffer_enabled(indio_dev))
197+
if (iio_device_claim_buffer_mode(indio_dev) < 0)
195198
return 0;
196199

197200
out = (s16 *)st->samples;
@@ -210,6 +213,7 @@ int cros_ec_sensors_push_data(struct iio_dev *indio_dev,
210213
iio_push_to_buffers_with_timestamp(indio_dev, st->samples,
211214
timestamp + delta);
212215

216+
iio_device_release_buffer_mode(indio_dev);
213217
return 0;
214218
}
215219
EXPORT_SYMBOL_GPL(cros_ec_sensors_push_data);

drivers/iio/dac/ad3552r.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ enum ad3552r_ch_vref_select {
140140
};
141141

142142
enum ad3542r_id {
143-
AD3542R_ID = 0x4008,
144-
AD3552R_ID = 0x4009,
143+
AD3542R_ID = 0x4009,
144+
AD3552R_ID = 0x4008,
145145
};
146146

147147
enum ad3552r_ch_output_range {

drivers/iio/frequency/admv1013.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
351351
if (vcm < 0)
352352
return vcm;
353353

354-
if (vcm < 1800000)
354+
if (vcm <= 1800000)
355355
mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
356-
else if (vcm > 1800000 && vcm < 2600000)
356+
else if (vcm > 1800000 && vcm <= 2600000)
357357
mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
358358
else
359359
return -EINVAL;

drivers/iio/imu/bno055/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
config BOSCH_BNO055
44
tristate
5+
select IIO_BUFFER
6+
select IIO_TRIGGERED_BUFFER
57

68
config BOSCH_BNO055_SERIAL
79
tristate "Bosch BNO055 attached via UART"

drivers/iio/light/vcnl4000.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,6 @@ static int vcnl4040_write_event_config(struct iio_dev *indio_dev,
15131513

15141514
out:
15151515
mutex_unlock(&data->vcnl4000_lock);
1516-
data->chip_spec->set_power_state(data, data->ps_int || data->als_int);
15171516

15181517
return ret;
15191518
}

drivers/iio/pressure/bmp280-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2179,7 +2179,7 @@ int bmp280_common_probe(struct device *dev,
21792179
* however as it happens, the BMP085 shares the chip ID of BMP180
21802180
* so we look for an IRQ if we have that.
21812181
*/
2182-
if (irq > 0 || (chip_id == BMP180_CHIP_ID)) {
2182+
if (irq > 0 && (chip_id == BMP180_CHIP_ID)) {
21832183
ret = bmp085_fetch_eoc_irq(dev, name, irq, data);
21842184
if (ret)
21852185
return ret;

drivers/iio/pressure/dps310.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
#define DPS310_RESET_MAGIC 0x09
5858
#define DPS310_COEF_BASE 0x10
5959

60-
/* Make sure sleep time is <= 20ms for usleep_range */
61-
#define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
60+
/* Make sure sleep time is <= 30ms for usleep_range */
61+
#define DPS310_POLL_SLEEP_US(t) min(30000, (t) / 8)
6262
/* Silently handle error in rate value here */
6363
#define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
6464

@@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
402402
if (rc)
403403
return rc;
404404

405-
/* Wait for device chip access: 2.5ms in specification */
406-
usleep_range(2500, 12000);
405+
/* Wait for device chip access: 15ms in specification */
406+
usleep_range(15000, 55000);
407407
return 0;
408408
}
409409

drivers/iio/pressure/ms5611_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static bool ms5611_prom_is_valid(u16 *prom, size_t len)
7676

7777
crc = (crc >> 12) & 0x000F;
7878

79-
return crc_orig != 0x0000 && crc == crc_orig;
79+
return crc == crc_orig;
8080
}
8181

8282
static int ms5611_read_prom(struct iio_dev *indio_dev)

0 commit comments

Comments
 (0)