mbox series

[v1,0/1] Fix for IBI handling order

Message ID 20231015222334.1652401-1-zbigniew.lukwinski@linux.intel.com (mailing list archive)
Headers show
Series Fix for IBI handling order | expand

Message

Zbigniew, Lukwinski Oct. 15, 2023, 10:23 p.m. UTC
I would like to introduce here patch to cover IBI handling order broken.

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.

There are two use cases when this problem can happen.

1. MCTP over I3C (aligned with DMTF specification)
Here problem can happen when target device (CPU) wants to send
MCTP request fragment into a few MCTP packets. In such case flow will look
like (having three MCTP packets):
a. CPU wants to send first MCTP packet
b. BMC gets IBI for the first MCTP packet and task is created to handle
that IBI
d. created task handles IBI and runs read transaction to get MCTP packet
and waits for read transaction completion
e. when read transaction happens, CPU wants to send second MCTP packet
right away
f. BMC gets IBI for the second MCTP packet and task is created to handle
that IBI
h. created task (second one) handles IBI and runs read transaction to get
MCTP packet and waits for read transaction completion
e. when read transaction happens, CPU wants to send third MCTP packet right
away
f. BMC gets IBI for the third MCTP packet and task is created to handle
that IBI

At this point having three IBI task without explicitly configured order of
execution which could result with the second one will go first and second
MCTP packet will reach MCTP recipient first.

2. Debug for I3C (aligned with MIPI specification)
Here problem can happen when target device (CPU) sends multiple IBIs one
after another. This could result with the wrong event order will reach
recipient/consumer.

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.

Zbigniew Lukwinski (1):
  i3c: master: handle IBIs in order they came

 drivers/i3c/master.c       | 14 +++++++++++++-
 include/linux/i3c/master.h |  4 +++-
 2 files changed, 16 insertions(+), 2 deletions(-)

Comments

Alexandre Belloni Nov. 3, 2023, 11:44 p.m. UTC | #1
On Mon, 16 Oct 2023 00:23:33 +0200, Zbigniew Lukwinski wrote:
> I would like to introduce here patch to cover IBI handling order broken.
> 
> 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.
> 
> There are two use cases when this problem can happen.
> 
> [...]

Applied, thanks!

[1/1] i3c: master: handle IBIs in order they came
      commit: 9fd00df05e81a2e1080ce6e9abc35533dca99d74

Best regards,