Re: [PATCH v4 2/4] drm/rockchip: add an common abstracted PSR driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yakir,

On Wed, Jul 13, 2016 at 9:15 PM, Yakir Yang <ykk@xxxxxxxxxxxxxx> 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.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux