linux-stable/drivers/base
Russ Weight c8e796895e
regmap: spi-avmm: Fix regmap_bus max_raw_write
The max_raw_write member of the regmap_spi_avmm_bus structure is defined
as:
	.max_raw_write = SPI_AVMM_VAL_SIZE * MAX_WRITE_CNT

SPI_AVMM_VAL_SIZE == 4 and MAX_WRITE_CNT == 1 so this results in a
maximum write transfer size of 4 bytes which provides only enough space to
transfer the address of the target register. It provides no space for the
value to be transferred. This bug became an issue (divide-by-zero in
_regmap_raw_write()) after the following was accepted into mainline:

commit 3981514180 ("regmap: Account for register length when chunking")

Change max_raw_write to include space (4 additional bytes) for both the
register address and value:

	.max_raw_write = SPI_AVMM_REG_SIZE + SPI_AVMM_VAL_SIZE * MAX_WRITE_CNT

Fixes: 7f9fb67358 ("regmap: add Intel SPI Slave to AVMM Bus Bridge support")
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20230620202824.380313-1-russell.h.weight@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-20 21:31:08 +01:00
..
firmware_loader firmware_loader: rework crypto dependencies 2023-04-20 11:42:31 +02:00
power Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
regmap regmap: spi-avmm: Fix regmap_bus max_raw_write 2023-06-20 21:31:08 +01:00
test Merge 6.2-rc5 into driver-core-next 2023-01-22 12:56:55 +01:00
arch_numa.c mm: percpu: add generic pcpu_populate_pte() function 2022-01-20 08:52:52 +02:00
arch_topology.c arch_topology: Remove early cacheinfo error message if -ENOENT 2023-04-14 10:13:38 +01:00
attribute_container.c
auxiliary.c driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
base.h driver core: class: make class_register() take a const * 2023-04-03 21:42:46 +02:00
bus.c driver core: bus: constify bus_get() 2023-03-23 13:21:24 +01:00
cacheinfo.c Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
class.c driver core: class: remove struct class_interface * from callbacks 2023-04-03 21:42:52 +02:00
component.c drivers: base: component: fix memory leak with using debugfs_lookup() 2023-02-08 13:33:10 +01:00
container.c
core.c driver core: update comments in device_rename() 2023-04-20 14:19:25 +02:00
cpu.c tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem 2023-04-05 13:47:43 +00:00
dd.c driver core: Don't require dynamic_debug for initcall_debug probe timing 2023-04-20 14:17:47 +02:00
devcoredump.c driver core: class: mark the struct class for sysfs callbacks as constant 2023-03-29 07:54:58 +02:00
devres.c devres: Pass unique name of the resource to devm_add_action() 2023-03-10 09:06:22 +01:00
devtmpfs.c driver core: clean up the logic to determine which /sys/dev/ directory to use 2023-03-31 17:45:07 +02:00
driver.c driver core: create bus_is_registered() 2023-02-09 10:43:35 +01:00
firmware.c
hypervisor.c
init.c init: Initialize noop_backing_dev_info early 2022-06-16 10:55:57 +02:00
isa.c
Kconfig driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT 2023-03-28 18:45:59 +02:00
Makefile genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
map.c
memory.c drivers/base/memory: Fix comments for phys_index_show() 2023-01-20 14:15:00 +01:00
module.c
node.c mm: memory-failure: add memory failure stats to sysfs 2023-02-02 22:33:28 -08:00
physical_location.c driver core: location: Free struct acpi_pld_info *pld before return false 2023-01-20 14:20:30 +01:00
physical_location.h driver core: physical_location.h remove extern from function prototypes 2023-03-24 15:35:48 +01:00
pinctrl.c
platform-msi.c genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced 2023-03-02 18:09:44 +01:00
platform.c driver core: platform: simplify __platform_driver_probe() 2023-02-01 14:08:10 +01:00
property.c device property: make device_property functions take const device * 2023-04-20 14:25:07 +02:00
soc.c base: soc: populate machine name in soc_device_register if empty 2023-03-29 12:21:23 +02:00
swnode.c driver core: make kobj_type structures constant 2023-02-08 13:34:30 +01:00
syscore.c
topology.c drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist 2022-07-15 17:36:33 +02:00
trace.c
trace.h
transport_class.c drivers: base: transport_class: fix resource leak when transport_add_device() fails 2023-01-20 14:22:53 +01:00