patch "mei: amthif: discard not read messages" added to char-misc-next
Subsystems (3)
This is a note to let you know that I've just added the patch titled
mei: amthif: discard not read messages
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-next branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
Quoted 1 line
From
9d04ee11db7bf0d848266cbfd7db336097a0e239Mon Sep 17 00:00:00 2001
From: Alexander Usyskin <[email protected]>
Date: Sun, 17 Apr 2016 12:16:04 -0400
Subject: mei: amthif: discard not read messages
When a message is received and amthif client is not in reading state the message is ignored and left dangling in the queue. This may happen after one of the amthif host connections is closed w/o completing the reading. Another client will pick up a wrong message on next read attempt which will lead to link reset.
To prevent this the driver has to properly discard the message when amthif client is not in reading state.
--- drivers/misc/mei/amthif.c | 4 +++- drivers/misc/mei/interrupt.c | 1 - drivers/misc/mei/mei_dev.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-)
drivers/misc/mei/amthif.c +3 -1
@@ -380,8 +380,10 @@ int mei_amthif_irq_read_msg(struct mei_cl *cl, dev = cl->dev; -if (dev->iamthif_state !=MEI_IAMTHIF_READING ) +if (dev->iamthif_state !=MEI_IAMTHIF_READING ) { +mei_irq_discard_msg (dev, mei_hdr);return 0 ; + } ret =mei_cl_irq_read_msg (cl, mei_hdr, cmpl_list);if (ret)
drivers/misc/mei/interrupt.c +0 -1
@@ -76,7 +76,6 @@ static inline int mei_cl_hbm_equal(struct mei_cl *cl,* @dev: mei device * @hdr: message header */ -static inline void mei_irq_discard_msg (struct mei_device *dev,struct mei_msg_hdr *hdr) {/*
drivers/misc/mei/mei_dev.h +2 -0
@@ -702,6 +702,8 @@ bool mei_hbuf_acquire(struct mei_device *dev);bool mei_write_is_idle (struct mei_device *dev); +void mei_irq_discard_msg (struct mei_device *dev,struct mei_msg_hdr *hdr); +#if IS_ENABLED (CONFIG_DEBUG_FS )int mei_dbgfs_register (struct mei_device *dev,const char *name);void mei_dbgfs_deregister (struct mei_device *dev);
Signature · 1 line
2.8.0