未验证 提交 30d00cd2 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1063 i2c: hisi: Only handle the interrupt of the driver's transfer

Merge Pull Request from: @lujunhuaHW 
 
The controller may be shared with other port, for example the firmware.
Handle the interrupt from other sources will cause crash since some
data are not initialized. So only handle the interrupt of the driver's
transfer and discard others. 
 
Link:https://gitee.com/openeuler/kernel/pulls/1063 

Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
......@@ -334,6 +334,14 @@ static irqreturn_t hisi_i2c_irq(int irq, void *context)
struct hisi_i2c_controller *ctlr = context;
u32 int_stat;
/*
* Don't handle the interrupt if cltr->completion is NULL. We may
* reach here because the interrupt is spurious or the transfer is
* started by another port rather than us.
*/
if (!ctlr->completion)
return IRQ_NONE;
int_stat = readl(ctlr->iobase + HISI_I2C_INT_MSTAT);
hisi_i2c_clear_int(ctlr, int_stat);
if (!(int_stat & HISI_I2C_INT_ALL))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册