Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4286088imm; Wed, 30 May 2018 02:45:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLwbI86lLQoZqZ5HC9A2n0dg7hBQjHmj6hBnYEW4vuR/xBXLIkDObh8Z5hXt6Wxp+J+whIA X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr2190324plj.253.1527673514291; Wed, 30 May 2018 02:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527673514; cv=none; d=google.com; s=arc-20160816; b=QPFeCCugJdfEijXsRfkFV6xxkTTChJaT00bY/HsjZE/ANJocxpv8miAjWW8KHKbxYY 45+u+rblklF47KzatPjxGq/mEll2LvH2wK2ktFZa93Q2g09ivNMlLO/0uEt7Zr4Mxr/W OgwIiFQepjtC2wPd+mJtiHEcQ2YJJjMoBb/x2AtYcZnIqaw3mvQuzTY3yAU5B4ogumtY WS1FxZYYgkteusxlKWdBvPACmwRXiF29x0mJ3PVh/BXu4NbAze9g2qXE4Ozqa4aCBQ4C 06arTcBc73fSuXqj4s+efwbcrhKn8gx3uyFzNZLxhqhnh1ImLz+MmZditx6qlMOVSAdQ DlHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WTx2LYIONvvv+6i2Jq2cMpW30+S6nBMV/wBCGZQHiK4=; b=gIhB++1YYmMNun2TzVzzOAifg3ro9BOU95lAuAH9MKVt/Jcz/LsIFjLJKqbwU156hw ziryHRxHqYgYkCqbuXhbBkT9JmOUaa9jHtMrpAOvdsUwwN+WjiUFNaQEioEjP3oJyEKg zGQWTyUSQ2tBSpZLPsm1YWQHOsZnrIECQkqdMs8Y6Y7BNnAG0JGtfCg8Q4yy4y5dZIAR wPfRJJkgZn58ouEurNdoxfasukn+0n8407h5JvMGus20Rrr7v5EaeAIiIcpYuBXl6ALe KFrEioa3RS2AtcemAx3yBHbBnMDQu3khMG0av0wuPSyQeVNZefR5ccVfkiUwXpnIHkNh 5AeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fp3bgK0r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si9524856pgq.65.2018.05.30.02.44.59; Wed, 30 May 2018 02:45:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fp3bgK0r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968916AbeE3JoG (ORCPT + 99 others); Wed, 30 May 2018 05:44:06 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35892 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965077AbeE3JoC (ORCPT ); Wed, 30 May 2018 05:44:02 -0400 Received: by mail-wr0-f194.google.com with SMTP id f16-v6so13496216wrm.3 for ; Wed, 30 May 2018 02:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=WTx2LYIONvvv+6i2Jq2cMpW30+S6nBMV/wBCGZQHiK4=; b=fp3bgK0r2CU/3ClXwNb8NlULAw30cjtTam8Don0EVyKAx9rwqINu2lZz315FV4Ta7+ 3AwgfXb+7I0NmNXfKAAhSwQStWKVF49E39cCHTDiOtf54ci/qFaFakUP2YYHeN2171lJ TigXhAcefF3ck9vEMK822yTrQsH3fdCs/r0NuG6ML2vr3iyXnN8VfF1gnjBAAZTzS+kN BC4tHVyIllhh0/fzo26pTgpkhCGopfZjqdSq+1+UeOAPZ7I+xlvaI9RrmdjeaKsR+elv kdYhHKIMQlDPOfoNgKlLl9LWnB37wIzoNvbBvUJfL/yUv2mdjj4hGxGxNRV4iPuX4yq/ vksg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WTx2LYIONvvv+6i2Jq2cMpW30+S6nBMV/wBCGZQHiK4=; b=CAy1G4UTSfM0s4mZEOlxtSdCByscoH31R04NxyLTAauRMoxBXVR0cpWj9OGsgq+qw9 BgMNW0FKJPtjH70TGQJAqJ/9RJ64paZydVICIatF/U5RIGb9MFa4Dcw/tNgB6yw4KsVm J3pTQMlxBUPTak9bF0whsGGsfal2xUq1oU8UrtEEewyMz7vjr65HMKDJesVJ0VzLRdYj X3JqYAd6sI3RTmocn3Fe5BBNJqKytS7nJENuK9nykeX21ayu1tU6pZyQtr6rYaoGeTeg jLnzK6v6+hvYubahOJkE02nACdRhAmXAZJsZC2jsgkPm5+qi2Dhu9Tltg2aVS0zBUAA5 vKww== X-Gm-Message-State: ALKqPwfWzHC23xWruTmoYtO8luuyqB8dqDDTox0mc8tk54MKgScQUB4y LhakutdD6e0AlfBS3mEsegkkzg== X-Received: by 2002:adf:9025:: with SMTP id h34-v6mr1611275wrh.123.1527673440863; Wed, 30 May 2018 02:44:00 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id b15-v6sm31000437wri.14.2018.05.30.02.43.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 May 2018 02:44:00 -0700 (PDT) From: Neil Armstrong To: architt@codeaurora.org, a.hajda@samsung.com, jernej.skrabec@siol.net Cc: Neil Armstrong , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense Date: Wed, 30 May 2018 11:43:58 +0200 Message-Id: <1527673438-20643-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dw_hdmi_setup_rx_sense exported function should not use struct device to recover the dw-hdmi context using drvdata, but take struct dw_hdmi directly like other exported functions. This caused a regression using Meson DRM on S905X since v4.17-rc1 : Internal error: Oops: 96000007 [#1] PREEMPT SMP [...] CPU: 0 PID: 124 Comm: irq/32-dw_hdmi_ Not tainted 4.17.0-rc7 #2 Hardware name: Libre Technology CC (DT) [...] pc : osq_lock+0x54/0x188 lr : __mutex_lock.isra.0+0x74/0x530 [...] Process irq/32-dw_hdmi_ (pid: 124, stack limit = 0x00000000adf418cb) Call trace: osq_lock+0x54/0x188 __mutex_lock_slowpath+0x10/0x18 mutex_lock+0x30/0x38 __dw_hdmi_setup_rx_sense+0x28/0x98 dw_hdmi_setup_rx_sense+0x10/0x18 dw_hdmi_top_thread_irq+0x2c/0x50 irq_thread_fn+0x28/0x68 irq_thread+0x10c/0x1a0 kthread+0x128/0x130 ret_from_fork+0x10/0x18 Code: 34000964 d00050a2 51000484 9135c042 (f864d844) ---[ end trace 945641e1fbbc07da ]--- note: irq/32-dw_hdmi_[124] exited with preempt_count 1 genirq: exiting task "irq/32-dw_hdmi_" (124) is an active IRQ thread (irq 32) Fixes: eea034af90c6 ("drm/bridge/synopsys: dw-hdmi: don't clobber drvdata") Signed-off-by: Neil Armstrong Tested-by: Koen Kooi --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 15 ++++----------- drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +- include/drm/bridge/dw_hdmi.h | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index ec8d000..3c136f2b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2077,7 +2077,7 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) return ret; } -void __dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) +void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) { mutex_lock(&hdmi->mutex); @@ -2103,13 +2103,6 @@ void __dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) } mutex_unlock(&hdmi->mutex); } - -void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense) -{ - struct dw_hdmi *hdmi = dev_get_drvdata(dev); - - __dw_hdmi_setup_rx_sense(hdmi, hpd, rx_sense); -} EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) @@ -2145,9 +2138,9 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) */ if (intr_stat & (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) { - __dw_hdmi_setup_rx_sense(hdmi, - phy_stat & HDMI_PHY_HPD, - phy_stat & HDMI_PHY_RX_SENSE); + dw_hdmi_setup_rx_sense(hdmi, + phy_stat & HDMI_PHY_HPD, + phy_stat & HDMI_PHY_RX_SENSE); if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) cec_notifier_set_phys_addr(hdmi->cec_notifier, diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index a393095..c9ad456 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -529,7 +529,7 @@ static irqreturn_t dw_hdmi_top_thread_irq(int irq, void *dev_id) if (stat & HDMITX_TOP_INTR_HPD_RISE) hpd_connected = true; - dw_hdmi_setup_rx_sense(dw_hdmi->dev, hpd_connected, + dw_hdmi_setup_rx_sense(dw_hdmi->hdmi, hpd_connected, hpd_connected); drm_helper_hpd_irq_event(dw_hdmi->encoder.dev); diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index dd2a8cf..ccb5aa8 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -151,7 +151,7 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder, const struct dw_hdmi_plat_data *plat_data); -void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense); +void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense); void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate); void dw_hdmi_audio_enable(struct dw_hdmi *hdmi); -- 2.7.4