cec: ceca interrupt cost long time [1/1]

PD#SWPL-6068

Problem:
ceca isr cost long time, and delayed vdin vs.

Solution:
move function to tasklet

Verify:
txlx

Change-Id: I861dd2ba145a64a88ad126abc00944d2358914c8
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
This commit is contained in:
Yong Qin
2019-06-26 19:27:27 +08:00
committed by Luke Go
parent 1cdf89a3d2
commit 6b1df50cfd
2 changed files with 17 additions and 8 deletions

View File

@@ -143,6 +143,7 @@ static struct cec_msg_last *last_cec_msg;
static struct dbgflg stdbgflg;
static int phy_addr_test;
static struct tasklet_struct ceca_tasklet;
/* from android cec hal */
enum {
@@ -2189,29 +2190,36 @@ static void cec_task(struct work_struct *work)
queue_delayed_work(cec_dev->cec_thread, dwork, CEC_FRAME_DELAY);
}
static irqreturn_t ceca_isr(int irq, void *dev_instance)
static void ceca_tasklet_pro(unsigned long arg)
{
unsigned int intr_stat = 0;
struct delayed_work *dwork;
dwork = &cec_dev->cec_work;
intr_stat = cec_intr_stat();
CEC_INFO_L(L_2, "ceca_isr 0x%x\n", intr_stat);
if (intr_stat & AO_CEC_TX_INT) { /* aocec tx intr */
intr_stat = ao_cec_intr_stat();
CEC_INFO_L(L_2, "ceca_tsklet 0x%x\n", intr_stat);
if (intr_stat & AO_CEC_TX_INT) {
/* cec a tx intr */
ceca_tx_irq_handle();
return IRQ_HANDLED;
return;
} else if (intr_stat & AO_CEC_RX_INT) {
/* cec a rx intr */
if ((-1) == ceca_rx_irq_handle(rx_msg, &rx_len))
return IRQ_HANDLED;
return;
complete(&cec_dev->rx_ok);
/* check rx buffer is full */
new_msg = 1;
mod_delayed_work(cec_dev->cec_thread, dwork, 0);
}
}
static irqreturn_t ceca_isr(int irq, void *dev_instance)
{
tasklet_schedule(&ceca_tasklet);
return IRQ_HANDLED;
}
/*
static void check_wake_up(void)
{
@@ -3731,7 +3739,8 @@ static int aml_cec_probe(struct platform_device *pdev)
}
INIT_DELAYED_WORK(&cec_dev->cec_work, cec_task);
queue_delayed_work(cec_dev->cec_thread, &cec_dev->cec_work, 0);
tasklet_init(&ceca_tasklet, ceca_tasklet_pro,
(unsigned long)cec_dev);
scpi_get_wakeup_reason(&cec_dev->wakeup_reason);
CEC_ERR("wakeup_reason:0x%x\n", cec_dev->wakeup_reason);
scpi_get_cec_val(SCPI_CMD_GET_CEC1,

View File

@@ -19,7 +19,7 @@
#define __AO_CEC_H__
#define CEC_DRIVER_VERSION "2019/6/13:early suspend not report pw status\n"
#define CEC_DRIVER_VERSION "2019/6/26: ceca int cost long time\n"
#define CEC_FRAME_DELAY msecs_to_jiffies(400)
#define CEC_DEV_NAME "cec"