Message ID | 20231014-adv7511-cec-irq-crash-fix-v1-1-3389486c8373@bang-olufsen.dk |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp2620429vqb; Sat, 14 Oct 2023 11:58:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiacoMUTLpXMlzL09crPbd4C6kMmGVvQEjbbfUQRI4zCYd6VUw+78AL0Zl2IfrgS5fKXY8 X-Received: by 2002:a05:6a20:43a6:b0:16c:b514:a4bc with SMTP id i38-20020a056a2043a600b0016cb514a4bcmr24349497pzl.4.1697309903332; Sat, 14 Oct 2023 11:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697309903; cv=none; d=google.com; s=arc-20160816; b=uZ6Z6Q3eUlv3hRcgZRxFaco4eEcj8NehMr6mdqDQEp8LOKbP6m0wEHQq9mviXjVi6G iLYYQEMc1Xc/hcjS7eJM4noKTUpyDcoXIS30dSBq0dPh7ZdxZB3iF2A3OcC5NprQxRgk IUUBnudlL74PYc/oOJA9fCPFkq6qI0KrL6/qok7lOemMqpstQJCdz5gsvAmeaRHWHL2H pEMiYTPG5daOdMoHw6uXNWr9CvciqmbXq2f/u7+xk+MtIT2UFHVu1WIMZmzyRPHp31Kl BlATSIe1YitrHOiXqDwUfSWY/PJ+oXxK06pDjNv8Od+qSi4Eiv8FWrrBb5XzE/hD4q9D cl9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=tIlXDMVoyF2wOerT2pUZ66SV7AxP60ec1UuPn6vb9Es=; fh=S7N9+5zJMe6R/S/nVTOvlvFc0A1/72GgvdJ8iow7oK0=; b=sxUEFDJF3VpLtKekQllkX5pCV/JaaQZnXA127LLnhEjsSl61+aIyCXmq0qUKOp91Mb Z8UJkcprpqqAHJKoi9bWtFHY8LqMp9VFbr72RY3N/nC0kOaPk5SXbuJZAwTMESAOzRj3 dF73iv2E+aHrWy/qCVovxMxfUMFbweXEflWmODPiBMS2AagelCtup/EtOupmuxHqCwwl aPW9orK7aKdS9AxBskkV83n5CCDM7M/y/vSoHAfHB8GRaywAVM3klA57bHAbAgaeKXeg o/rd8AXHjIPZVfkAoscLPdQxHb9wwIQu1GdbRuSgRmVizwNHhNFOINfvbM+80e/xlvmA YDWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pqrs.dk header.s=google header.b=Iygpm4uf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u32-20020a631420000000b00565dd108fd4si6855146pgl.115.2023.10.14.11.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 11:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@pqrs.dk header.s=google header.b=Iygpm4uf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8D7C18096BAF; Sat, 14 Oct 2023 11:58:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233208AbjJNSqU (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Sat, 14 Oct 2023 14:46:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbjJNSqS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 14 Oct 2023 14:46:18 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A53CE for <linux-kernel@vger.kernel.org>; Sat, 14 Oct 2023 11:46:15 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-99de884ad25so514700266b.3 for <linux-kernel@vger.kernel.org>; Sat, 14 Oct 2023 11:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; t=1697309174; x=1697913974; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=tIlXDMVoyF2wOerT2pUZ66SV7AxP60ec1UuPn6vb9Es=; b=Iygpm4ufPnV1SrVov1/WohDpC/5TvXpnZDY8onEHX51cCSTaC72er3caFu9GuwN0iQ Gnsk+2QU/+zRH3i2h/Sm4nxJj6+haH/0/di6/BiCDIfVM1WXN1uwkFfO0dQZzaSwjJwZ EjzqSgftwGCPsX74K6/9tRcbrMRDcRZqjXuAjpcPpJ2yUbEWiX3551a0O4wt4sXMvCoU Xk2owSRX7nWg9YAy8bnVg/nlE5+4/7JZhdVmj9pZ/9Wy+bpPfTRREtTolnEEhngDJ/3s U0Co0t4sZJo6z5NZ8cHi5wu1LBa+gddBwmpkGPHYp+trRmyVXNADQQxopzM3kvoUkwnV rcTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697309174; x=1697913974; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tIlXDMVoyF2wOerT2pUZ66SV7AxP60ec1UuPn6vb9Es=; b=d8N+0xkhiIeFwbM7sfixHtoY7RFfCq85yoyumGr3C1wDw4fBzxcgr3yffpQz7hGPSI knpDcrXBDclSSZ/zT6DcTOxbm19FeK4/tfyXyHLrq/hvup98MJ/ItEFfx0VZf3vmlm9s FWYrli9MKswxwxzUcPNHkXf6SlLG2UqiYgXUVb77dyoMQxtBJkLp9GiP9IOijEkACrYN BBMVwXMXyUCPhcklQcYOO5+ZLOUvSpR3OZCbZNtBx2dVUF88u4OcV79RmY4uok8shMM+ +V82n0vy9PCTgYuFeUU6qV9gDLdXXC1L0VbsIzwJViZlfRuMJBi8tjtYXEJJxiWh8jCt +hzQ== X-Gm-Message-State: AOJu0Ywwrx6CUwT9XhOObkXcRP10MmQB6j+HqOmbDs7sh8lWXUMxWLf6 NIEWNdLPQoG6BwgkYNgfHbkJlg== X-Received: by 2002:a17:906:478a:b0:9be:7de2:927a with SMTP id cw10-20020a170906478a00b009be7de2927amr2183584ejc.74.1697309174209; Sat, 14 Oct 2023 11:46:14 -0700 (PDT) Received: from capella.localdomain (80.71.142.18.ipv4.parknet.dk. [80.71.142.18]) by smtp.gmail.com with ESMTPSA id hz14-20020a1709072cee00b009b654ba498csm1235222ejc.90.2023.10.14.11.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 11:46:13 -0700 (PDT) From: =?utf-8?q?Alvin_=C5=A0ipraga?= <alvin@pqrs.dk> Date: Sat, 14 Oct 2023 20:46:12 +0200 Subject: [PATCH] drm/bridge: adv7511: fix crash on irq during probe MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231014-adv7511-cec-irq-crash-fix-v1-1-3389486c8373@bang-olufsen.dk> X-B4-Tracking: v=1; b=H4sIAPPhKmUC/x2MSQqEQAwAvyI5T6Djin5l8NAkUXNxSYMI4t9tP FZB1Q1J3TTBUNzgelqybc1AvwJ4ieusaJIZylBWFKjGKGfXECEro/mB7DEtONmF7STSh74S7iL kfnfN+nv/x+d5AS+DayNrAAAA To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Archit Taneja <architt@codeaurora.org>, Hans Verkuil <hans.verkuil@cisco.com> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mads Bligaard Nielsen <bli@bang-olufsen.dk>, =?utf-8?q?Alvin_=C5=A0ipraga?= <alsi@bang-olufsen.dk> X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 14 Oct 2023 11:58:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779758428745277938 X-GMAIL-MSGID: 1779758428745277938 |
Series |
drm/bridge: adv7511: fix crash on irq during probe
|
|
Commit Message
Alvin Šipraga
Oct. 14, 2023, 6:46 p.m. UTC
From: Mads Bligaard Nielsen <bli@bang-olufsen.dk> Moved IRQ registration down to end of adv7511_probe(). If an IRQ already is pending during adv7511_probe (before adv7511_cec_init) then cec_received_msg_ts could crash using uninitialized data: Unable to handle kernel read from unreadable memory at virtual address 00000000000003d5 Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP Call trace: cec_received_msg_ts+0x48/0x990 [cec] adv7511_cec_irq_process+0x1cc/0x308 [adv7511] adv7511_irq_process+0xd8/0x120 [adv7511] adv7511_irq_handler+0x1c/0x30 [adv7511] irq_thread_fn+0x30/0xa0 irq_thread+0x14c/0x238 kthread+0x190/0x1a8 Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Mads Bligaard Nielsen <bli@bang-olufsen.dk> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- base-commit: a48e2cc92835fa1d9b373b804b2173c779387b8e change-id: 20231014-adv7511-cec-irq-crash-fix-6fdd9093dc7a
Comments
Hello Alvin, On Sat, Oct 14, 2023 at 08:46:12PM +0200, Alvin Šipraga wrote: > From: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > > Moved IRQ registration down to end of adv7511_probe(). > > If an IRQ already is pending during adv7511_probe > (before adv7511_cec_init) then cec_received_msg_ts > could crash using uninitialized data: > > Unable to handle kernel read from unreadable memory at virtual address 00000000000003d5 > Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP > Call trace: > cec_received_msg_ts+0x48/0x990 [cec] > adv7511_cec_irq_process+0x1cc/0x308 [adv7511] > adv7511_irq_process+0xd8/0x120 [adv7511] > adv7511_irq_handler+0x1c/0x30 [adv7511] > irq_thread_fn+0x30/0xa0 > irq_thread+0x14c/0x238 > kthread+0x190/0x1a8 > > Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Isn't the issue older than that ? > Signed-off-by: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> With the Fixes: tag updated, Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index d518de88b5c3..71022cb8abe4 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -1291,17 +1291,6 @@ static int adv7511_probe(struct i2c_client *i2c) > > INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work); > > - if (i2c->irq) { > - init_waitqueue_head(&adv7511->wq); > - > - ret = devm_request_threaded_irq(dev, i2c->irq, NULL, > - adv7511_irq_handler, > - IRQF_ONESHOT, dev_name(dev), > - adv7511); > - if (ret) > - goto err_unregister_cec; > - } > - > adv7511_power_off(adv7511); > > i2c_set_clientdata(i2c, adv7511); > @@ -1325,6 +1314,17 @@ static int adv7511_probe(struct i2c_client *i2c) > > adv7511_audio_init(dev, adv7511); > > + if (i2c->irq) { > + init_waitqueue_head(&adv7511->wq); > + > + ret = devm_request_threaded_irq(dev, i2c->irq, NULL, > + adv7511_irq_handler, > + IRQF_ONESHOT, dev_name(dev), > + adv7511); > + if (ret) > + goto err_unregister_audio; > + } > + > if (adv7511->type == ADV7533 || adv7511->type == ADV7535) { > ret = adv7533_attach_dsi(adv7511); > if (ret) >
Hi Laurent, Thanks for the quick review! On Mon, Oct 16, 2023 at 11:14:44AM +0300, Laurent Pinchart wrote: > Hello Alvin, > > On Sat, Oct 14, 2023 at 08:46:12PM +0200, Alvin Šipraga wrote: > > From: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > > > > Moved IRQ registration down to end of adv7511_probe(). > > > > If an IRQ already is pending during adv7511_probe > > (before adv7511_cec_init) then cec_received_msg_ts > > could crash using uninitialized data: > > > > Unable to handle kernel read from unreadable memory at virtual address 00000000000003d5 > > Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP > > Call trace: > > cec_received_msg_ts+0x48/0x990 [cec] > > adv7511_cec_irq_process+0x1cc/0x308 [adv7511] > > adv7511_irq_process+0xd8/0x120 [adv7511] > > adv7511_irq_handler+0x1c/0x30 [adv7511] > > irq_thread_fn+0x30/0xa0 > > irq_thread+0x14c/0x238 > > kthread+0x190/0x1a8 > > > > Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") > > Isn't the issue older than that ? I don't think so. The stacktrace shows the crash is in CEC handling code, which was added in the blamed commit. A static analysis of adv7511_irq_process() suggests that the only other place where data could be uninitialized is if the hpd_work is scheduled: if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder) schedule_work(&adv7511->hpd_work); ... but this has a check on bridge.encoder, which seems to have been introduced in a similar fix here: | commit a1d0503d26ea2ef04f3f013d379e8f4d29c27127 | Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | Date: Thu May 14 00:31:07 2015 +0300 | | drm: adv7511: Fix crash in IRQ handler when no encoder is associated | | The ADV7511 is probed before its slave encoder init function associates | it with an encoder. This creates a time window during which hot plug | detection interrupts can occur with an encoder, resulting in a crash in | the IRQ handler. | | Fix this by ignoring hot plug detection IRQs when no encoder is | associated yet. | | Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | Acked-by: Lars-Peter Clausen <lars@metafoo.de> | | diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c | index b728523e194f..2aaa3c88999e 100644 | --- a/drivers/gpu/drm/i2c/adv7511.c | +++ b/drivers/gpu/drm/i2c/adv7511.c | @@ -438,7 +438,7 @@ static int adv7511_irq_process(struct adv7511 *adv7511) | regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0); | regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1); | | - if (irq0 & ADV7511_INT0_HDP) | + if (irq0 & ADV7511_INT0_HDP && adv7511->encoder) | drm_helper_hpd_irq_event(adv7511->encoder->dev); | | if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) { So assuming that is the case, I am not sure which Fixes: tag I ought to otherwise use. What do you think? > > > Signed-off-by: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > > Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> > > With the Fixes: tag updated, > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Kind regards, Alvin
Hi Laurent, This is a friendly ping to get your feedback on my reply below. I don't think the Fixes tag is incorrect here. Please could you take another look and let me know if I can resend with your Reviewed-by? Kind regards, Alvin On Mon, Oct 16, 2023 at 10:42:27AM +0200, Alvin Šipraga wrote: > Hi Laurent, > > Thanks for the quick review! > > On Mon, Oct 16, 2023 at 11:14:44AM +0300, Laurent Pinchart wrote: > > Hello Alvin, > > > > On Sat, Oct 14, 2023 at 08:46:12PM +0200, Alvin Šipraga wrote: > > > From: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > > > > > > Moved IRQ registration down to end of adv7511_probe(). > > > > > > If an IRQ already is pending during adv7511_probe > > > (before adv7511_cec_init) then cec_received_msg_ts > > > could crash using uninitialized data: > > > > > > Unable to handle kernel read from unreadable memory at virtual address 00000000000003d5 > > > Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP > > > Call trace: > > > cec_received_msg_ts+0x48/0x990 [cec] > > > adv7511_cec_irq_process+0x1cc/0x308 [adv7511] > > > adv7511_irq_process+0xd8/0x120 [adv7511] > > > adv7511_irq_handler+0x1c/0x30 [adv7511] > > > irq_thread_fn+0x30/0xa0 > > > irq_thread+0x14c/0x238 > > > kthread+0x190/0x1a8 > > > > > > Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") > > > > Isn't the issue older than that ? > > I don't think so. The stacktrace shows the crash is in CEC handling code, which > was added in the blamed commit. A static analysis of adv7511_irq_process() > suggests that the only other place where data could be uninitialized is if the > hpd_work is scheduled: > > if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder) > schedule_work(&adv7511->hpd_work); > > ... but this has a check on bridge.encoder, which seems to have been introduced > in a similar fix here: > > | commit a1d0503d26ea2ef04f3f013d379e8f4d29c27127 > | Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > | Date: Thu May 14 00:31:07 2015 +0300 > | > | drm: adv7511: Fix crash in IRQ handler when no encoder is associated > | > | The ADV7511 is probed before its slave encoder init function associates > | it with an encoder. This creates a time window during which hot plug > | detection interrupts can occur with an encoder, resulting in a crash in > | the IRQ handler. > | > | Fix this by ignoring hot plug detection IRQs when no encoder is > | associated yet. > | > | Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > | Acked-by: Lars-Peter Clausen <lars@metafoo.de> > | > | diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c > | index b728523e194f..2aaa3c88999e 100644 > | --- a/drivers/gpu/drm/i2c/adv7511.c > | +++ b/drivers/gpu/drm/i2c/adv7511.c > | @@ -438,7 +438,7 @@ static int adv7511_irq_process(struct adv7511 *adv7511) > | regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0); > | regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1); > | > | - if (irq0 & ADV7511_INT0_HDP) > | + if (irq0 & ADV7511_INT0_HDP && adv7511->encoder) > | drm_helper_hpd_irq_event(adv7511->encoder->dev); > | > | if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) { > > So assuming that is the case, I am not sure which Fixes: tag I ought to > otherwise use. What do you think? > > > > > > Signed-off-by: Mads Bligaard Nielsen <bli@bang-olufsen.dk> > > > Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> > > > > With the Fixes: tag updated, > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > Kind regards, > Alvin
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index d518de88b5c3..71022cb8abe4 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -1291,17 +1291,6 @@ static int adv7511_probe(struct i2c_client *i2c) INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work); - if (i2c->irq) { - init_waitqueue_head(&adv7511->wq); - - ret = devm_request_threaded_irq(dev, i2c->irq, NULL, - adv7511_irq_handler, - IRQF_ONESHOT, dev_name(dev), - adv7511); - if (ret) - goto err_unregister_cec; - } - adv7511_power_off(adv7511); i2c_set_clientdata(i2c, adv7511); @@ -1325,6 +1314,17 @@ static int adv7511_probe(struct i2c_client *i2c) adv7511_audio_init(dev, adv7511); + if (i2c->irq) { + init_waitqueue_head(&adv7511->wq); + + ret = devm_request_threaded_irq(dev, i2c->irq, NULL, + adv7511_irq_handler, + IRQF_ONESHOT, dev_name(dev), + adv7511); + if (ret) + goto err_unregister_audio; + } + if (adv7511->type == ADV7533 || adv7511->type == ADV7535) { ret = adv7533_attach_dsi(adv7511); if (ret)