Unverified Commit 57e15e4b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3531 Fix kernel panic occurs during ISO installation on the 20.03 SP3/SP4

Merge Pull Request from: @cloudyyy1234 
 
For description	about the feature, see the following issue:
https://gitee.com/openeuler/kernel/issues/I8QL7I


 
 
Link:https://gitee.com/openeuler/kernel/pulls/3531

 

Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 5baa16e5 6e276f55
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -320,6 +320,13 @@ static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr)
		    max_write == 0)
			break;
	}

	/*
	 * Disable the TX_EMPTY interrupt after finishing all the messages to
	 * avoid overwhelming the CPU.
	 */
	if (ctlr->msg_tx_idx == ctlr->msg_num)
		hisi_i2c_disable_int(ctlr, HISI_I2C_INT_TX_EMPTY);
}

static irqreturn_t hisi_i2c_irq(int irq, void *context)
@@ -327,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 (e.g. firmware) 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))
@@ -345,7 +360,11 @@ static irqreturn_t hisi_i2c_irq(int irq, void *context)
		hisi_i2c_read_rx_fifo(ctlr);

out:
	if (int_stat & HISI_I2C_INT_TRANS_CPLT || ctlr->xfer_err) {
	/*
	 * Only use TRANS_CPLT to indicate the completion. On error cases we'll
	 * get two interrupts, INT_ERR first then TRANS_CPLT.
	 */
	if (int_stat & HISI_I2C_INT_TRANS_CPLT) {
		hisi_i2c_disable_int(ctlr, HISI_I2C_INT_ALL);
		hisi_i2c_clear_int(ctlr, HISI_I2C_INT_ALL);
		complete(ctlr->completion);