All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-samsung-soc@vger.kernel.org,
	Tomasz Stanislawski <t.stanislaws@samsung.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: drm: exynos: mixer: fix using usleep() in atomic context
Date: Mon, 01 Dec 2014 17:16:17 +0100	[thread overview]
Message-ID: <7454d0630d95195d41c3906637e223af@math.uni-bielefeld.de> (raw)
In-Reply-To: <20141201155447.GE11943@ulmo.nvidia.com>

On 2014-12-01 16:54, Thierry Reding wrote:
> On Sun, Nov 30, 2014 at 01:35:25AM +0100, tjakobi@math.uni-bielefeld.de 
> wrote:
>> From: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> 
>> This patch fixes calling usleep_range() after taking reg_slock
>> using spin_lock_irqsave(). The mdelay() is used instead.
>> Waiting in atomic context is not the best idea in general.
>> Hopefully, waiting occurs only when Video Processor fails
>> to reset correctly.
>> 
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_mixer.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
>> b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index a41c84e..cc7cccc 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -632,7 +632,7 @@ static void vp_win_reset(struct mixer_context 
>> *ctx)
>>  		/* waiting until VP_SRESET_PROCESSING is 0 */
>>  		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
>>  			break;
>> -		usleep_range(10000, 12000);
>> +		mdelay(10);
>>  	}
>>  	WARN(tries == 0, "failed to reset Video Processor\n");
>>  }
> 
> I can't see a reason why you would need to hold the lock around this
> code. Perhaps a better way to fix this would be to drop the lock before
> calling vp_win_reset()?
> 
> Thierry

Hmm, I'm pretty new to spinlocks (only have worked with the usual mutex 
stuff in userspace), but wouldn't that mean that it is then possible for 
mixer_win_reset to execute while a (previous) vp_win_reset is still 
running?

With best wishes,
Tobias

  reply	other threads:[~2014-12-01 16:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30  0:35 drm/exynos: some small forgotten patch tjakobi
2014-11-30  0:35 ` drm: exynos: mixer: fix using usleep() in atomic context tjakobi
2014-12-01 15:54   ` Thierry Reding
2014-12-01 16:16     ` Tobias Jakobi [this message]
2014-12-17  7:54       ` Thierry Reding
2014-12-21 15:04         ` Inki Dae
2015-01-21 22:46           ` Tobias Jakobi
2015-01-22  7:47             ` Seung-Woo Kim
2014-12-09 12:09 ` drm/exynos: some small forgotten patch Inki Dae
2014-12-09 15:36   ` Tobias Jakobi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7454d0630d95195d41c3906637e223af@math.uni-bielefeld.de \
    --to=tjakobi@math.uni-bielefeld.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=t.stanislaws@samsung.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.