All of lore.kernel.org
 help / color / mirror / Atom feed
From: liuxinliang <z.liuxinliang@hisilicon.com>
To: John Stultz <john.stultz@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Rongrong Zou <zourongrong@gmail.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sean Paul <seanpaul@chromium.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [RFC][PATCH] drm: kirin: Add a mutex to avoid fb initialization race
Date: Sat, 25 Feb 2017 09:22:02 +0800	[thread overview]
Message-ID: <58B0DC3A.4060707@hisilicon.com> (raw)
In-Reply-To: <CALAqxLVsO7JP+j1wSy_mM_Rf5S7Hx4Dueco6LD4qcqdDMAjv2A@mail.gmail.com>



On 2017/2/25 5:33, John Stultz wrote:
> On Thu, Feb 23, 2017 at 5:55 PM, liuxinliang
> <z.liuxinliang@hisilicon.com> wrote:
>> Hi John,
>>
>> On 2017/2/23 8:56, John Stultz wrote:
>>> In some cases I've been seeing a race where two framebuffers
>>> would be initialized, as kirin_fbdev_output_poll_changed()
>>> might get called quickly in succession, resulting in the fb
>>> initialization happening twice. This could cause the system
>>
>> I might understand this race. This because two places call
>> drm_helper_hpd_irq_event might cause the race:
>> One place is here
>> static int kirin_drm_kms_init(struct drm_device *dev)
>> {
>> ...
>>      /* force detection after connectors init */
>>      (void)drm_helper_hpd_irq_event(dev);
>> ...
>> }
>>
>> another is the adv7533 interrupt thread handler
>> static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
>> {
>> ...
>>      if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder)
>>          drm_helper_hpd_irq_event(adv7511->connector.dev);
>> ...
>> }
>>
>> right?
>>
>> I don't get a better way to fix this yet , I like to put fb_lock into
>> kirin_drm_private.
> Ok. I've moved the mutex to the kirin_drm_private structure.
>
> Anything else you'd like to see before I resend?

Thanks, no more then.


Best,
-xinliang

>
> thanks
> -john
>
> .
>

      reply	other threads:[~2017-02-25  1:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  0:56 [RFC][PATCH] drm: kirin: Add a mutex to avoid fb initialization race John Stultz
2017-02-23  0:56 ` John Stultz
2017-02-24  1:55 ` liuxinliang
2017-02-24  1:55   ` liuxinliang
2017-02-24 21:33   ` John Stultz
2017-02-24 21:33     ` John Stultz
2017-02-25  1:22     ` liuxinliang [this message]

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=58B0DC3A.4060707@hisilicon.com \
    --to=z.liuxinliang@hisilicon.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john.stultz@linaro.org \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=puck.chen@hisilicon.com \
    --cc=seanpaul@chromium.org \
    --cc=zourongrong@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.