It seems in my code disable_irq can't really disable the irq, i have follwoing code
rc = devm_request_threaded_irq(&client->dev, irq, NULL,
name_for_ask_question_irq_handler,
IRQF_ONESHOT | IRQF_TRIGGER_FALLING, client->name, data);
if (rc < 0) {
dev_err(&client->dev, "request irq failed \n");
return rc;
}
/* IRQ handler threadeded, this can (and will) sleep */
static irqreturn_t name_for_ask_question_irq_handler(int irq, void *dev)
{
struct touch_point_data *pdata = dev;
dev_err(&pdata->client->dev, "%s:%d irq handler \n", __func__, __LINE__);
return IRQ_HANDLED;
}
static ssize_t wakeup_i2c_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct touch_point_data *pdata = dev_get_drvdata(dev);
if (buf[0] == '1') {
disable_irq(pdata->client->irq);
gpiod_direction_output(pdata->gpiod_irq, 0);
udelay(100);
gpiod_direction_output(pdata->gpiod_irq, 1);
udelay(100);
gpiod_direction_output(pdata->gpiod_irq, 0);
udelay(100);
gpiod_direction_output(pdata->gpiod_irq, 1);
udelay(100);
gpiod_direction_input(pdata->gpiod_irq);
dev_err(&pdata->client->dev, "%s:%d disable irq \n", __func__, __LINE__);
} else if (buf[0] == '2') {
enable_irq(pdata->client->irq);
dev_err(&pdata->client->dev, "%s:%d enable irq \n", __func__, __LINE__);
}
return size;
}
and then i get following result:
i am confused, why disable_irq can't really mask the interrupt, it seems this funtion only delay the IRQ, and the irq_handler will still be called after enable_irq. Is there anyone know what happened?