Patch "regmap: Account for register length in SMBus I/O limits" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    regmap: Account for register length in SMBus I/O limits

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     regmap-account-for-register-length-in-smbus-i-o-limits.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 0c9d2eb5e94792fe64019008a04d4df5e57625af Mon Sep 17 00:00:00 2001
From: Mark Brown <broonie@xxxxxxxxxx>
Date: Wed, 12 Jul 2023 12:16:40 +0100
Subject: regmap: Account for register length in SMBus I/O limits

From: Mark Brown <broonie@xxxxxxxxxx>

commit 0c9d2eb5e94792fe64019008a04d4df5e57625af upstream.

The SMBus I2C buses have limits on the size of transfers they can do but
do not factor in the register length meaning we may try to do a transfer
longer than our length limit, the core will not take care of this.
Future changes will factor this out into the core but there are a number
of users that assume current behaviour so let's just do something
conservative here.

This does not take account padding bits but practically speaking these
are very rarely if ever used on I2C buses given that they generally run
slowly enough to mean there's no issue.

Cc: stable@xxxxxxxxxx
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Reviewed-by: Xu Yilun <yilun.xu@xxxxxxxxx>
Link: https://lore.kernel.org/r/20230712-regmap-max-transfer-v1-2-80e2aed22e83@xxxxxxxxxx
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/base/regmap/regmap-i2c.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/base/regmap/regmap-i2c.c
+++ b/drivers/base/regmap/regmap-i2c.c
@@ -242,8 +242,8 @@ static int regmap_i2c_smbus_i2c_read(voi
 static const struct regmap_bus regmap_i2c_smbus_i2c_block = {
 	.write = regmap_i2c_smbus_i2c_write,
 	.read = regmap_i2c_smbus_i2c_read,
-	.max_raw_read = I2C_SMBUS_BLOCK_MAX,
-	.max_raw_write = I2C_SMBUS_BLOCK_MAX,
+	.max_raw_read = I2C_SMBUS_BLOCK_MAX - 1,
+	.max_raw_write = I2C_SMBUS_BLOCK_MAX - 1,
 };
 
 static int regmap_i2c_smbus_i2c_write_reg16(void *context, const void *data,
@@ -299,8 +299,8 @@ static int regmap_i2c_smbus_i2c_read_reg
 static const struct regmap_bus regmap_i2c_smbus_i2c_block_reg16 = {
 	.write = regmap_i2c_smbus_i2c_write_reg16,
 	.read = regmap_i2c_smbus_i2c_read_reg16,
-	.max_raw_read = I2C_SMBUS_BLOCK_MAX,
-	.max_raw_write = I2C_SMBUS_BLOCK_MAX,
+	.max_raw_read = I2C_SMBUS_BLOCK_MAX - 2,
+	.max_raw_write = I2C_SMBUS_BLOCK_MAX - 2,
 };
 
 static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,


Patches currently in stable-queue which might be from broonie@xxxxxxxxxx are

queue-6.1/asoc-codecs-wcd938x-fix-missing-mbhc-init-error-handling.patch
queue-6.1/asoc-rt5640-fix-sleep-in-atomic-context.patch
queue-6.1/asoc-codecs-wcd938x-fix-resource-leaks-on-component-remove.patch
queue-6.1/asoc-qdsp6-audioreach-fix-topology-probe-deferral.patch
queue-6.1/asoc-tegra-fix-amx-byte-map.patch
queue-6.1/asoc-codecs-wcd938x-fix-missing-clsh-ctrl-error-handling.patch
queue-6.1/asoc-codecs-wcd938x-fix-soundwire-initialisation-race.patch
queue-6.1/asoc-fsl_sai-disable-bit-clock-with-transmitter.patch
queue-6.1/asoc-fsl_sai-revert-asoc-fsl_sai-enable-mctl_mclk_en-bit-for-master-mode.patch
queue-6.1/asoc-tegra-fix-adx-byte-map.patch
queue-6.1/arm64-fpsimd-ensure-sme-storage-is-allocated-after-sve-vl-changes.patch
queue-6.1/regmap-drop-initial-version-of-maximum-transfer-length-fixes.patch
queue-6.1/asoc-codecs-wcd934x-fix-resource-leaks-on-component-remove.patch
queue-6.1/asoc-cs42l51-fix-driver-to-properly-autoload-with-automatic-module-loading.patch
queue-6.1/asoc-codecs-wcd938x-fix-codec-initialisation-race.patch
queue-6.1/asoc-codecs-wcd-mbhc-v2-fix-resource-leaks-on-component-remove.patch
queue-6.1/regmap-account-for-register-length-in-smbus-i-o-limits.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux