linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: cbus-gpio: set atomic transfer callback
@ 2021-11-27 19:42 Aaro Koskinen
  2021-11-29  8:52 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Aaro Koskinen @ 2021-11-27 19:42 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c; +Cc: linux-kernel, Tony Lindgren

CBUS transfers have always been atomic, but after commit 63b96983a5dd
("i2c: core: introduce callbacks for atomic transfers") we started to see
warnings during e.g. poweroff as the atomic callback is not explicitly set.
Fix that.

Fixes the following WARNING seen during Nokia N810 power down:

[  786.570617] reboot: Power down
[  786.573913] ------------[ cut here ]------------
[  786.578826] WARNING: CPU: 0 PID: 672 at drivers/i2c/i2c-core.h:40 i2c_smbus_xfer+0x100/0x110
[  786.587799] No atomic I2C transfer handler for 'i2c-2'

Fixes: 63b96983a5dd ("i2c: core: introduce callbacks for atomic transfers")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/i2c/busses/i2c-cbus-gpio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cbus-gpio.c b/drivers/i2c/busses/i2c-cbus-gpio.c
index 72df563477b1..f8639a4457d2 100644
--- a/drivers/i2c/busses/i2c-cbus-gpio.c
+++ b/drivers/i2c/busses/i2c-cbus-gpio.c
@@ -195,8 +195,9 @@ static u32 cbus_i2c_func(struct i2c_adapter *adapter)
 }
 
 static const struct i2c_algorithm cbus_i2c_algo = {
-	.smbus_xfer	= cbus_i2c_smbus_xfer,
-	.functionality	= cbus_i2c_func,
+	.smbus_xfer		= cbus_i2c_smbus_xfer,
+	.smbus_xfer_atomic	= cbus_i2c_smbus_xfer,
+	.functionality		= cbus_i2c_func,
 };
 
 static int cbus_i2c_remove(struct platform_device *pdev)
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: cbus-gpio: set atomic transfer callback
  2021-11-27 19:42 [PATCH] i2c: cbus-gpio: set atomic transfer callback Aaro Koskinen
@ 2021-11-29  8:52 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2021-11-29  8:52 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-i2c, linux-kernel, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On Sat, Nov 27, 2021 at 09:42:14PM +0200, Aaro Koskinen wrote:
> CBUS transfers have always been atomic, but after commit 63b96983a5dd
> ("i2c: core: introduce callbacks for atomic transfers") we started to see
> warnings during e.g. poweroff as the atomic callback is not explicitly set.
> Fix that.
> 
> Fixes the following WARNING seen during Nokia N810 power down:
> 
> [  786.570617] reboot: Power down

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-29  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 19:42 [PATCH] i2c: cbus-gpio: set atomic transfer callback Aaro Koskinen
2021-11-29  8:52 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).