All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yakir Yang <ykk@rock-chips.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time
Date: Thu, 7 Apr 2016 11:07:55 +0800	[thread overview]
Message-ID: <5705CF0B.50904@rock-chips.com> (raw)
In-Reply-To: <20160406194152.GA28319@mwanda>

Hi Dan,

On 04/07/2016 03:41 AM, Dan Carpenter wrote:
> Hello Yakir Yang,
>
> The patch 7b4b7a8db439: "drm: bridge: analogix/dp: Fix the possible
> dead lock in bridge disable time" from Feb 15, 2016, leads to the
> following static checker warning:
>
> 	drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:875 analogix_dp_irq_thread()
> 	warn: bitwise AND condition is false here
>
> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
>     869  static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
>     870  {
>     871          struct analogix_dp_device *dp = arg;
>     872          enum dp_irq_type irq_type;
>     873
>     874          irq_type = analogix_dp_get_irq_type(dp);
>     875          if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is never true.  Maybe test_bit() for these?
Ah, yep, it's an error here. The enum value of DP_IRQ_TYPE_HP_CABLE_IN
is zero, so even if analogix_dp_get_irq_type return the CABLE_IN event, 
driver
could not send the drm hpd event rightly.

Good catch, would need to assign the new enum value, like

  enum dp_irq_type {
-       DP_IRQ_TYPE_HP_CABLE_IN,
-       DP_IRQ_TYPE_HP_CABLE_OUT,
-       DP_IRQ_TYPE_HP_CHANGE,
-       DP_IRQ_TYPE_UNKNOWN,
+       DP_IRQ_TYPE_HP_CABLE_IN  = BIT(0),
+       DP_IRQ_TYPE_HP_CABLE_OUT = BIT(1),
+       DP_IRQ_TYPE_HP_CHANGE    = BIT(2),
+       DP_IRQ_TYPE_UNKNOWN      = BIT(3),
  };


Thanks for pointing out, would send patch to fix that soon.

- Yakir
>
>     876              irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
>     877                  dev_dbg(dp->dev, "Detected cable status changed!\n");
>     878                  if (dp->drm_dev)
>     879                          drm_helper_hpd_irq_event(dp->drm_dev);
>     880          }
>     881
>     882          if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
>     883                  analogix_dp_clear_hotplug_interrupts(dp);
>     884                  analogix_dp_unmute_hpd_interrupt(dp);
>     885          }
>     886
>     887          return IRQ_HANDLED;
>     888  }
>
> regards,
> dan carpenter
>
>
>


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2016-04-07  3:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 19:41 drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time Dan Carpenter
2016-04-07  3:07 ` Yakir Yang [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=5705CF0B.50904@rock-chips.com \
    --to=ykk@rock-chips.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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.