“da9143c1cc91b9b81a9d62a3dcd1b16487513e0e”上不存在“git@gitcode.net:RobotFutures/Paddle.git”
提交 9d04ee11 编写于 作者: A Alexander Usyskin 提交者: Greg Kroah-Hartman

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.

Cc: <stable@vger.kernel.org> #4.2+
Signed-off-by: NAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6a8d648c
...@@ -380,8 +380,10 @@ int mei_amthif_irq_read_msg(struct mei_cl *cl, ...@@ -380,8 +380,10 @@ int mei_amthif_irq_read_msg(struct mei_cl *cl,
dev = cl->dev; 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; return 0;
}
ret = mei_cl_irq_read_msg(cl, mei_hdr, cmpl_list); ret = mei_cl_irq_read_msg(cl, mei_hdr, cmpl_list);
if (ret) if (ret)
......
...@@ -76,7 +76,6 @@ static inline int mei_cl_hbm_equal(struct mei_cl *cl, ...@@ -76,7 +76,6 @@ static inline int mei_cl_hbm_equal(struct mei_cl *cl,
* @dev: mei device * @dev: mei device
* @hdr: message header * @hdr: message header
*/ */
static inline
void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr) void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr)
{ {
/* /*
......
...@@ -702,6 +702,8 @@ bool mei_hbuf_acquire(struct mei_device *dev); ...@@ -702,6 +702,8 @@ bool mei_hbuf_acquire(struct mei_device *dev);
bool mei_write_is_idle(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) #if IS_ENABLED(CONFIG_DEBUG_FS)
int mei_dbgfs_register(struct mei_device *dev, const char *name); int mei_dbgfs_register(struct mei_device *dev, const char *name);
void mei_dbgfs_deregister(struct mei_device *dev); void mei_dbgfs_deregister(struct mei_device *dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册