Skip to content

Commit

Permalink
driver: input: sensor: fix unbalanced enable for some sensor irq
Browse files Browse the repository at this point in the history
[   31.190438] Unbalanced enable for IRQ 163
[   31.190481] ------------[ cut here ]------------
[   31.190495] WARNING: at kernel/irq/manage.c:513
[   31.190505] Modules linked in: bcmdhd
[   31.190525]
[   31.190544] CPU: 1 PID: 270 Comm: [email protected] Not tainted 4.4.93 torvalds#175
[   31.190561] Hardware name: Rockchip rk3368 xkp board (DT)
[   31.190575] task: ffffffc076ac2700 task.stack: ffffffc076b28000
[   31.190601] PC is at __enable_irq+0x34/0x74
[   31.190614] LR is at __enable_irq+0x34/0x74
...
[   31.198173] [<ffffff80080f5d84>] __enable_irq+0x34/0x74
[   31.198188] [<ffffff80080f5e30>] enable_irq+0x6c/0x94
[   31.198207] [<ffffff800868e11c>] sensor_enable+0x78/0x13c
[   31.198222] [<ffffff800868e8a8>] light_dev_ioctl+0x1a4/0x1d4
[   31.198240] [<ffffff80081c71d4>] do_vfs_ioctl+0x5e4/0x720
[   31.198254] [<ffffff80081c7370>] SyS_ioctl+0x60/0x88
[   31.198270] [<ffffff8008082930>] el0_svc_naked+0x24/0x28

Change-Id: Ieba4a76910fde7381ea4b8113cca20fa068fabbd
Signed-off-by: Zorro Liu <[email protected]>
  • Loading branch information
liuyx1314 authored and rkhuangtao committed Nov 16, 2017
1 parent 024b72d commit 2b5d85d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/input/sensors/sensor-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,7 @@ static int sensor_irq_init(struct i2c_client *client)
}

client->irq = irq;
if ((sensor->pdata->type == SENSOR_TYPE_GYROSCOPE) || (sensor->pdata->type == SENSOR_TYPE_ACCEL) || (sensor->pdata->type == SENSOR_TYPE_ANGLE))
disable_irq_nosync(client->irq);
if (((sensor->pdata->type == SENSOR_TYPE_LIGHT) || (sensor->pdata->type == SENSOR_TYPE_PROXIMITY)) && (!(sensor->ops->trig & IRQF_SHARED)))
disable_irq_nosync(client->irq);
if (((sensor->pdata->type == SENSOR_TYPE_TEMPERATURE) || (sensor->pdata->type == SENSOR_TYPE_PRESSURE)) && (!(sensor->ops->trig & IRQF_SHARED)))
disable_irq_nosync(client->irq);
disable_irq_nosync(client->irq);

dev_info(&client->dev, "%s:use irq=%d\n", __func__, irq);
} else if (!sensor->pdata->irq_enable) {
Expand Down

0 comments on commit 2b5d85d

Please sign in to comment.