Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4730787imm; Wed, 30 May 2018 10:49:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJY30CkL62zoielDD+HCtrtjRkhusuV3uNpLP00XUUAcRSTvbR5R7k1Fx69FtAekbYaBcRy X-Received: by 2002:aa7:83c7:: with SMTP id j7-v6mr3681196pfn.50.1527702583493; Wed, 30 May 2018 10:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527702583; cv=none; d=google.com; s=arc-20160816; b=b3+2MRDsyErNB6jrNJZOyEvGqzL1afeXy15D4KtMbsKdfWBWx2i2Tn1MGA0Mosc+BN 6lDOv3XkVbF++uoZqBPw7RJQp2tZBor2xqbqK1tsZnm5JBqfLKyZey/EehTrY3Jq74LK gMyrnV/LdFD3RuE76J6Ck/Lp3oC365bu3naj7Z/ZtIxnVWsbfuXDpRvTB9FEQPAEFNad nb+At+2cOD/MEbwwn0WKvPTNhXe7CO4/Jo1Ww5meZc5WVkyt8LDeLkpz1ZkfWo5mP7/B QbKCIsOX6MiQge/QHVWMD6ZC94p+EYDV4ypyRAwsPRFw/1JHjQncrchA85ncsgxVYvI4 la1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CRLLcbjnpDA3AxlL/Q+7da07PgJn15T+0lZg2gRNfIQ=; b=fK95zOfidmHv5SN/dpKOSg6OMjyYks6HLf7++Icgh9DvFW4bjrF5AmeScYmHagpuda bIfAJ5tqrTXUP8f3P0HMWrhQJgcGZwp2UNiLynX54ckh9BeQ1C4+gwV+mhrWvDQ7YOK7 cfW1h/4piVnL1mVjY2iZw9L+VVlqE00GVrGpIomUI9fJNjZpekR3g2+dnBkiqKMEsTag MXHMOIOxwkouJo7g1QzgoCIqse7v5r4dGU1ASsLywwS3t0qVe4LD2Z4k5dQzhxaCs2pT xK0ZMEeM8Ih3y9XoTID0lrgrMbg7mQspWyGdwLUZRTOg9q1oUz3y7rluYHuvJJrK4+ex Skbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oCSv0Bfk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23-v6si33947162pll.54.2018.05.30.10.49.29; Wed, 30 May 2018 10:49:43 -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=@chromium.org header.s=google header.b=oCSv0Bfk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932092AbeE3RtF (ORCPT + 99 others); Wed, 30 May 2018 13:49:05 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:44360 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbeE3RtE (ORCPT ); Wed, 30 May 2018 13:49:04 -0400 Received: by mail-yw0-f196.google.com with SMTP id p14-v6so6289959ywm.11 for ; Wed, 30 May 2018 10:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CRLLcbjnpDA3AxlL/Q+7da07PgJn15T+0lZg2gRNfIQ=; b=oCSv0BfkIg2nNL9YBS5PMo2pBiArm5ulMarwBU4Rd8WLw16UxLsJER/EmdJTW8HLts HmRmF1xna39FFJjSKeJcoS0O6+KXsjnE+m4M3nRlGjMLqT5NuTrUcHgroOIVZ0JF9PYl y8lwdDXCJ2GW9UkokrrxPwIf/r6XFwBuWWJjU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CRLLcbjnpDA3AxlL/Q+7da07PgJn15T+0lZg2gRNfIQ=; b=sqC9TxQPVJm7nmExE0ADXehl0HG3DSq2v0D4h77p72oJH2MpcTvKLEhBvQEa1+VhG9 ivLgm9Lra7tBO9+Y83Ilg102pc8BdSW40vCd5hpyzxaGy4IAa1ihAHr6bbGs+AVdxFr+ azpGVDoFyYcW9DIlXk8I8qtfdVKwO04prJuCRibssbN4muhuUC6c/9CBEnYekhmGGufq iG56JgeawuM2lJeEoQdl+MDuuq56UlXFdRBiqQRsn/Z2X/ci4z8OAAC3Bdbp7sYKywKu WlFVxNHQeKMl0WapsPtIpKnmekAxNknv1GPKd1iiNZ99UQH2jkGCUj/BxpSo1kFbbSF7 wO2Q== X-Gm-Message-State: ALKqPweDbaqfxv9ONaJtAkuOFOq4giAFv4UMXaxT6S3aifm2HYDMZ6I+ kHUAQwyIGDWrP1AXs5uDGeR1pA== X-Received: by 2002:a81:3b03:: with SMTP id i3-v6mr1928142ywa.469.1527702543334; Wed, 30 May 2018 10:49:03 -0700 (PDT) Received: from localhost ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id u17-v6sm912532ywu.16.2018.05.30.10.49.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 May 2018 10:49:02 -0700 (PDT) Date: Wed, 30 May 2018 13:49:02 -0400 From: Sean Paul To: Neil Armstrong Cc: architt@codeaurora.org, a.hajda@samsung.com, jernej.skrabec@siol.net, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense Message-ID: <20180530174902.GN3373@art_vandelay> References: <1527673438-20643-1-git-send-email-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527673438-20643-1-git-send-email-narmstrong@baylibre.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 11:43:58AM +0200, 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 : > > 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 Thanks for your patch, Neil. I've applied it to -misc-fixes and will send it to Dave in hope it can sneak into 4.17. Sean > --- > 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 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- Sean Paul, Software Engineer, Google / Chromium OS