Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1449085
| From | Yakir Yang <ykk@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver |
| Date | 2016-07-24 09:10 +0200 |
| Message-ID | <rYlHX-4XP-1@gated-at.bofh.it> (permalink) |
| References | <rUGhX-4y6-3@gated-at.bofh.it> <rUGhY-4y6-19@gated-at.bofh.it> <rXWqd-6Dj-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Doug,
On 07/23/2016 12:04 PM, Doug Anderson wrote:
> Yakir,
>
> On Wed, Jul 13, 2016 at 9:15 PM, Yakir Yang <ykk@rock-chips.com> wrote:
>> +static void psr_set_state(struct psr_drv *psr, enum psr_state state)
>> +{
>> + mutex_lock(&psr->state_mutex);
>> +
>> + if (psr->state == state) {
>> + mutex_unlock(&psr->state_mutex);
>> + return;
>> + }
>> +
>> + psr->state = state;
>> + switch (state) {
>> + case PSR_ENABLE:
>> + psr->set(psr->encoder, true);
>> + break;
>> +
>> + case PSR_DISABLE:
>> + case PSR_FLUSH:
>> + psr->set(psr->encoder, false);
>> + break;
>> + };
>> +
>> + mutex_unlock(&psr->state_mutex);
>> +}
>> +
>> +static void psr_flush_handler(unsigned long data)
>> +{
>> + struct psr_drv *psr = (struct psr_drv *)data;
>> +
>> + if (!psr || psr->state != PSR_FLUSH)
>> + return;
>> +
>> + psr_set_state(psr, PSR_ENABLE);
> As mentioned in a separate thread, this is probably not OK.
> psr_set_state() grabs a mutex and that might sleep. ...but
> psr_flush_handler() is a timer. I'm nearly certain that timers can't
> sleep.
>
> I believe this is the source of "sleeping function called from invalid
> context" that I've seen at times.
Thanks for your reported, i have wrote a patch[0] to fix this problem in
my v5. If you're happy to review, that would be great ;)
[0]: https://patchwork.kernel.org/patch/9244805/
- Yakir
>
> -Doug
>
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/4] Add PSR function support for Analogix/Rockchip DP Yakir Yang <ykk@rock-chips.com> - 2016-07-14 06:20 +0200
[PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Yakir Yang <ykk@rock-chips.com> - 2016-07-14 06:20 +0200
Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Sean Paul <seanpaul@chromium.org> - 2016-07-14 17:20 +0200
Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Yakir Yang <ykk@rock-chips.com> - 2016-07-15 03:50 +0200
Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Yakir Yang <ykk@rock-chips.com> - 2016-07-24 09:20 +0200
Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Doug Anderson <dianders@chromium.org> - 2016-07-23 06:10 +0200
Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver Yakir Yang <ykk@rock-chips.com> - 2016-07-24 09:10 +0200
[PATCH v4.1 1/4] drm/rockchip: vop: export line flag function Yakir Yang <ykk@rock-chips.com> - 2016-07-15 13:00 +0200
Re: [PATCH v4.1 1/4] drm/rockchip: vop: export line flag function Sean Paul <seanpaul@chromium.org> - 2016-07-15 15:10 +0200
Re: [PATCH v4.1 1/4] drm/rockchip: vop: export line flag function Yakir Yang <ykk@rock-chips.com> - 2016-07-16 04:40 +0200
[PATCH v4.1 3/4] drm/bridge: analogix_dp: add the PSR function support Yakir Yang <ykk@rock-chips.com> - 2016-07-15 13:00 +0200
Re: [PATCH v4.1 3/4] drm/bridge: analogix_dp: add the PSR function support Sean Paul <seanpaul@chromium.org> - 2016-07-15 15:20 +0200
Re: [PATCH v4.1 3/4] drm/bridge: analogix_dp: add the PSR function support Yakir Yang <ykk@rock-chips.com> - 2016-07-16 04:40 +0200
csiph-web