Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1409210

Re: [PATCH] gpio: core: Do not call get_direction in atomic context for sleeping gpio

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] gpio: core: Do not call get_direction in atomic context for sleeping gpio
Date 2016-05-30 17:20 +0200
Message-ID <rEx90-5Uj-17@gated-at.bofh.it> (permalink)
References <rCkIX-3Ps-79@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 3:18 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:

> When adding the gpiochip, the GPIO HW drivers' callback get_direction()
> get called in atomic context. Some of the GPIO HW drivers can sleep when
> accessing the register and hence it can create the sleeping call in
> atomic context.
>
> Call get_direction() in non-atomic context from gpiochip_add() if GPIO
> HW driver is having sleepable callback i.e. chip->can_sleep = 1.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
>
> ---
> This is found when implementing the get_direction() of max77620 on 20160520
> linux-next.

I chose to send a new patch just moving the lock release before the
direction check. I just sent it with you as Reported-by.

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] gpio: core: Do not call get_direction in atomic context for sleeping gpio Laxman Dewangan <ldewangan@nvidia.com> - 2016-05-24 15:40 +0200
  Re: [PATCH] gpio: core: Do not call get_direction in atomic context  for sleeping gpio Linus Walleij <linus.walleij@linaro.org> - 2016-05-30 17:20 +0200

csiph-web