* re: drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time
@ 2016-04-06 19:41 Dan Carpenter
2016-04-07 3:07 ` Yakir Yang
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-04-06 19:41 UTC (permalink / raw)
To: ykk; +Cc: dri-devel
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?
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time
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
0 siblings, 0 replies; 2+ messages in thread
From: Yakir Yang @ 2016-04-07 3:07 UTC (permalink / raw)
To: Dan Carpenter; +Cc: dri-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-07 3:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.