diff options
author | Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com> | 2023-10-16 00:23:34 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-11-04 00:44:32 +0100 |
commit | 9fd00df05e81a2e1080ce6e9abc35533dca99d74 (patch) | |
tree | 5f67bd33063ebde441686d222941b4267d0c0c29 /include/linux/i3c | |
parent | b53e9758a31c683fc8615df930262192ed5f034b (diff) | |
download | linux-stable-9fd00df05e81a2e1080ce6e9abc35533dca99d74.tar.gz linux-stable-9fd00df05e81a2e1080ce6e9abc35533dca99d74.tar.bz2 linux-stable-9fd00df05e81a2e1080ce6e9abc35533dca99d74.zip |
i3c: master: handle IBIs in order they came
IBI shall be handled in order they appear on the bus. Otherwise could hit
case when order of handling them in device driver will be different. It may
lead to invalid assembling fragmented packets or events order broken.
Added separate workqueue with option WQ_MEM_RECLAIM for each device driver.
This ensures IBI handling order and improves IBI handling performance: IBI
handlers for device B are not blocked by IBI handlers for device A.
Original solution (single workqueue in main driver) was able to handle also
general IBI (not related to specific device) like HJ or MR. So leaving this
for such purposes.
Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231015222334.1652401-2-zbigniew.lukwinski@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'include/linux/i3c')
-rw-r--r-- | include/linux/i3c/master.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 4fd6a777150f..349d7d0dda73 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -129,6 +129,7 @@ struct i3c_ibi_slot { * rejected by the master * @num_slots: number of IBI slots reserved for this device * @enabled: reflect the IBI status + * @wq: workqueue used to execute IBI handlers. * @handler: IBI handler specified at i3c_device_request_ibi() call time. This * handler will be called from the controller workqueue, and as such * is allowed to sleep (though it is recommended to process the IBI @@ -151,6 +152,7 @@ struct i3c_device_ibi_info { unsigned int max_payload_len; unsigned int num_slots; unsigned int enabled; + struct workqueue_struct *wq; void (*handler)(struct i3c_device *dev, const struct i3c_ibi_payload *payload); }; @@ -469,7 +471,7 @@ struct i3c_master_controller_ops { * @boardinfo.i2c: list of I2C boardinfo objects * @boardinfo: board-level information attached to devices connected on the bus * @bus: I3C bus exposed by this master - * @wq: workqueue used to execute IBI handlers. Can also be used by master + * @wq: workqueue which can be used by master * drivers if they need to postpone operations that need to take place * in a thread context. Typical examples are Hot Join processing which * requires taking the bus lock in maintenance, which in turn, can only |