Skip to content

Commit 45a4ff6

Browse files
nikhildevshatwarmartinezjavier
authored andcommitted
drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable
When removing the tidss driver, there is a warning reported by kernel about an unhandled interrupt for mhdp driver. [ 43.238895] irq 31: nobody cared (try booting with the "irqpoll" option) ... [snipped backtrace] [ 43.330735] handlers: [ 43.333020] [<000000005367c4f9>] irq_default_primary_handler threaded [<000000007e02b601>] cdns_mhdp_irq_handler [cdns_mhdp8546] [ 43.344607] Disabling IRQ #31 This happens because as part of cdns_mhdp_bridge_hpd_disable, driver tries to disable the interrupts. While disabling the SW_EVENT interrupts, it accidentally enables the MBOX interrupts, which are not handled by the driver. Fix this with a read-modify-write to update only required bits. Use the enable / disable function as required in other places. Signed-off-by: Nikhil Devshatwar <[email protected]> Reviewed-by: Swapnil Jakhade <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Aradhya Bhatia <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c932ced commit 45a4ff6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@
5454
#include "cdns-mhdp8546-hdcp.h"
5555
#include "cdns-mhdp8546-j721e.h"
5656

57+
static void cdns_mhdp_bridge_hpd_enable(struct drm_bridge *bridge)
58+
{
59+
struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
60+
61+
/* Enable SW event interrupts */
62+
if (mhdp->bridge_attached)
63+
writel(readl(mhdp->regs + CDNS_APB_INT_MASK) &
64+
~CDNS_APB_INT_MASK_SW_EVENT_INT,
65+
mhdp->regs + CDNS_APB_INT_MASK);
66+
}
67+
68+
static void cdns_mhdp_bridge_hpd_disable(struct drm_bridge *bridge)
69+
{
70+
struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
71+
72+
writel(readl(mhdp->regs + CDNS_APB_INT_MASK) |
73+
CDNS_APB_INT_MASK_SW_EVENT_INT,
74+
mhdp->regs + CDNS_APB_INT_MASK);
75+
}
76+
5777
static int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp)
5878
{
5979
int ret, empty;
@@ -749,9 +769,7 @@ static int cdns_mhdp_fw_activate(const struct firmware *fw,
749769
* MHDP_HW_STOPPED happens only due to driver removal when
750770
* bridge should already be detached.
751771
*/
752-
if (mhdp->bridge_attached)
753-
writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT,
754-
mhdp->regs + CDNS_APB_INT_MASK);
772+
cdns_mhdp_bridge_hpd_enable(&mhdp->bridge);
755773

756774
spin_unlock(&mhdp->start_lock);
757775

@@ -1740,8 +1758,7 @@ static int cdns_mhdp_attach(struct drm_bridge *bridge,
17401758

17411759
/* Enable SW event interrupts */
17421760
if (hw_ready)
1743-
writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT,
1744-
mhdp->regs + CDNS_APB_INT_MASK);
1761+
cdns_mhdp_bridge_hpd_enable(bridge);
17451762

17461763
return 0;
17471764
aux_unregister:
@@ -2212,23 +2229,6 @@ static struct edid *cdns_mhdp_bridge_get_edid(struct drm_bridge *bridge,
22122229
return cdns_mhdp_get_edid(mhdp, connector);
22132230
}
22142231

2215-
static void cdns_mhdp_bridge_hpd_enable(struct drm_bridge *bridge)
2216-
{
2217-
struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
2218-
2219-
/* Enable SW event interrupts */
2220-
if (mhdp->bridge_attached)
2221-
writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT,
2222-
mhdp->regs + CDNS_APB_INT_MASK);
2223-
}
2224-
2225-
static void cdns_mhdp_bridge_hpd_disable(struct drm_bridge *bridge)
2226-
{
2227-
struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
2228-
2229-
writel(CDNS_APB_INT_MASK_SW_EVENT_INT, mhdp->regs + CDNS_APB_INT_MASK);
2230-
}
2231-
22322232
static const struct drm_bridge_funcs cdns_mhdp_bridge_funcs = {
22332233
.atomic_enable = cdns_mhdp_atomic_enable,
22342234
.atomic_disable = cdns_mhdp_atomic_disable,

0 commit comments

Comments
 (0)