Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp252993imm; Wed, 30 May 2018 23:01:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLS6fN+bTnFEgp2qA+PvPoZxwarO19PDGwsrnWbgsaeu2vWChNtXMCWYHhbkF+C7gBbUxUY X-Received: by 2002:a17:902:bd8f:: with SMTP id q15-v6mr5514559pls.161.1527746492826; Wed, 30 May 2018 23:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527746492; cv=none; d=google.com; s=arc-20160816; b=efwQRh0eO/PP6vk2fd3wxViW1sw5PTuUit83/32+A0PMGfqc+YOTnFBceA9cQVA6v1 noIriSrCaUuQrycl+xptwGVIvanatdWpqb1FCht9WzJ3Fq1PccdBWv4kGy3SdxbUuLFR xG8xdgcFvZKfBBJRQcoKkEtccNxC5cQ0wcVASc0IUT1iYWXMvsfbqHc1YRkevHIRmpmh oLazDkV61kAszLRN3yClPiwv5hZnYnmRfWBTrgF69nTuS7/Zzfd+yemvXTgsg6QDtKk+ 9EmHfgUIH2+lVUnppFETMPrhL57dIC8un+B/6B+ingPiRUIytqUv+y+gXV3E1X4dGFRM boww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=5qfz+tzCqvxptArmdNjyYURKb6rvdGmwKcVNqX92aEg=; b=Nany+PKe6Rru46gf5h59suAGxAbmR+BY2FKWSr4BIeeeunNrokG+lh5SboiB+T3FoW slqy5y/hrqELdkZBwSdYI8NFNbI41sNVUEOk6h6ccmsUwpdGnnV/c/bZWlXJJG863+Vj cKHqwFtfn27dRufBGY7rfCB9DN583PtZAw2qkFn98aAMG4bNsI8aGF2udiSL+YVUqf5Z ga1RJdoB6JIkdmsJw2aZRgp6QNTi1VFb6vIyiSGOtnDfFnfpqFNiUzbm/kMpz4MYMwJ6 Mih14cFDVf/twicFRW5gulrvSxNzPUzRwFcY0GDEcqud7PVJ0qonJvsrjiUzRIaBynoV s5FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oPxS5S80; dkim=pass header.i=@codeaurora.org header.s=default header.b=bWbVx7sr; 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 x3-v6si19946338plr.307.2018.05.30.23.01.18; Wed, 30 May 2018 23:01:32 -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=@codeaurora.org header.s=default header.b=oPxS5S80; dkim=pass header.i=@codeaurora.org header.s=default header.b=bWbVx7sr; 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 S1753893AbeEaGA4 (ORCPT + 99 others); Thu, 31 May 2018 02:00:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52770 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbeEaGAx (ORCPT ); Thu, 31 May 2018 02:00:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A6949605A4; Thu, 31 May 2018 06:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527746452; bh=weKDaFqmH/VOy1cVttB+rRP+0zg9HNNlBf2IKy3Xh38=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oPxS5S80mLB3rwvnUN5VhdifDVuKWLqwy0KMfAXrxf8l8CwWU5Q5EQ5pype4dXLJG um9mUm2+sXF7UUXnDbAPy++uPF08eCIDJs6r4XUHs5NLJ8g39DSALgJ24VMreFUKl+ USsq/MfztQO0/b2FOQ85E6Gad/WumTLaKWwU83rs= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.144] (unknown [182.74.96.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8C0076050D; Thu, 31 May 2018 06:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527746451; bh=weKDaFqmH/VOy1cVttB+rRP+0zg9HNNlBf2IKy3Xh38=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=bWbVx7srbD9UsBmO9MQw8fK9+i50UdHqqAblOxqUsXyy5JS/27TPzlblvIK23LmGM 62+4NbtHYQbWHD/6WnTDCrASm0u4mmJjvtblhdwEdMarof2CgagHnqbF9MjFXXrete T9vZsrFX3udVqjDM2EuO6wwHIkA88EWHnWgss8wU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8C0076050D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense To: Neil Armstrong , a.hajda@samsung.com, jernej.skrabec@siol.net Cc: dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1527673438-20643-1-git-send-email-narmstrong@baylibre.com> From: Archit Taneja Message-ID: Date: Thu, 31 May 2018 11:30:41 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1527673438-20643-1-git-send-email-narmstrong@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 30 May 2018 03:13 PM, Neil Armstrong wrote: > 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 : Reviewed-by: Archit Taneja > > 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); >