]> Git Repo - linux.git/commitdiff
i2c: add debug message for detected HostNotify alerts
authorWolfram Sang <[email protected]>
Thu, 4 Jul 2024 03:28:59 +0000 (05:28 +0200)
committerWolfram Sang <[email protected]>
Wed, 10 Jul 2024 06:31:59 +0000 (08:31 +0200)
Setting up HostNotify can be tricky. Support debugging by stating
when a HostNotify alert was received independent of the irq being
mapped. Especially useful with the in-kernel i2c testunit. Update
documentation as well.

Signed-off-by: Wolfram Sang <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Documentation/i2c/slave-testunit-backend.rst
drivers/i2c/i2c-core-base.c

index 0df60c7c0be49189e828bc0ecd77ed17be96fc54..37142a48ab35cfcd2930e913df670b781e92f003 100644 (file)
@@ -99,6 +99,11 @@ Example to send a notification after 10ms::
 
   # i2cset -y 0 0x30 0x02 0x42 0x64 0x01 i
 
+If the host controller supports HostNotify, this message with debug level
+should appear (Linux 6.11 and later)::
+
+  Detected HostNotify from address 0x30
+
 0x03 SMBUS_BLOCK_PROC_CALL
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index 49fdcb3eb8f66c08d4d13d88d45c9424d764cf9f..a5fce479ab13d026b20cb6cb7aefeb6cac2eb42c 100644 (file)
@@ -1468,6 +1468,8 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)
        if (!adap)
                return -EINVAL;
 
+       dev_dbg(&adap->dev, "Detected HostNotify from address 0x%02x", addr);
+
        irq = irq_find_mapping(adap->host_notify_domain, addr);
        if (irq <= 0)
                return -ENXIO;
This page took 0.063037 seconds and 4 git commands to generate.