• Heiko Stübner's avatar
    [media] rc: gpio-ir-recv: don't sleep in irq handler · 64657066
    Heiko Stübner authored
    Don't allow sleep when getting the gpio value in the irq-handler.
    On my rk3288 board this results in might_sleep warnings when receiving
    data like:
    
    BUG: sleeping function called from invalid context at drivers/gpio/gpiolib.c:1531
    in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/0
    CPU: 0 PID: 0 Comm: swapper/0 Tainted: P                4.1.0-rc5+ #2011
    Hardware name: Rockchip (Device Tree)
    [<c00189a0>] (unwind_backtrace) from [<c0013b04>] (show_stack+0x20/0x24)
    [<c0013b04>] (show_stack) from [<c0757970>] (dump_stack+0x8c/0xbc)
    [<c0757970>] (dump_stack) from [<c0053188>] (___might_sleep+0x238/0x284)
    [<c0053188>] (___might_sleep) from [<c0053264>] (__might_sleep+0x90/0xa4)
    [<c0053264>] (__might_sleep) from [<c02ff4ac>] (gpiod_get_raw_value_cansleep+0x28/0x44)
    [<c02ff4ac>] (gpiod_get_raw_value_cansleep) from [<bf0363c4>] (gpio_ir_recv_irq+0x24/0x6c [gpio_ir_recv])
    [<bf0363c4>] (gpio_ir_recv_irq [gpio_ir_recv]) from [<c008a78c>] (handle_irq_event_percpu+0x164/0x550)
    [<c008a78c>] (handle_irq_event_percpu) from [<c008abc4>] (handle_irq_event+0x4c/0x6c)
    [<c008abc4>] (handle_irq_event) from [<c008df88>] (handle_edge_irq+0x128/0x150)
    [<c008df88>] (handle_edge_irq) from [<c0089edc>] (generic_handle_irq+0x30/0x40)
    [<c0089edc>] (generic_handle_irq) from [<c02fc4cc>] (rockchip_irq_demux+0x158/0x210)
    [<c02fc4cc>] (rockchip_irq_demux) from [<c0089edc>] (generic_handle_irq+0x30/0x40)
    [<c0089edc>] (generic_handle_irq) from [<c008a058>] (__handle_domain_irq+0x98/0xc0)
    [<c008a058>] (__handle_domain_irq) from [<c00094a4>] (gic_handle_irq+0x4c/0x70)
    [<c00094a4>] (gic_handle_irq) from [<c0014684>] (__irq_svc+0x44/0x5c)
    Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    64657066
gpio-ir-recv.c 6.02 KB