From patchwork Wed Jan 11 15:40:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9510487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64B9860231 for ; Wed, 11 Jan 2017 15:41:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E4E627FBB for ; Wed, 11 Jan 2017 15:41:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42B6528487; Wed, 11 Jan 2017 15:41:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07AFB28601 for ; Wed, 11 Jan 2017 15:40:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8B936E950; Wed, 11 Jan 2017 15:40:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1BCE6E94F; Wed, 11 Jan 2017 15:40:47 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 4613848-1500050 for multiple; Wed, 11 Jan 2017 15:40:37 +0000 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Wed, 11 Jan 2017 15:40:38 +0000 Date: Wed, 11 Jan 2017 15:40:38 +0000 From: Chris Wilson To: Dave Hansen Subject: Re: [Intel-gfx] 4.10-rc2 oops in DRM connector code Message-ID: <20170111154038.GK18077@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Dave Hansen , Daniel Vetter , Jani Nikula , David Airlie , intel-gfx , dri-devel , Linux Kernel Mailing List References: <20170109101516.y3acaev5ujbjugwl@phenom.ffwll.local> <16a1e734-667c-5d9a-c418-555b1f13e446@intel.com> <20170110103157.xuz7mefbv3fw5hlc@phenom.ffwll.local> <30c171a4-e144-778e-4fe2-d342602c3940@intel.com> <20170111074338.rapmbctzne2da6vm@phenom.ffwll.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: intel-gfx , Linux Kernel Mailing List , dri-devel , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jan 11, 2017 at 07:24:45AM -0800, Dave Hansen wrote: > On 01/10/2017 11:43 PM, Daniel Vetter wrote: > > On Tue, Jan 10, 2017 at 08:52:47AM -0800, Dave Hansen wrote: > >> On 01/10/2017 02:31 AM, Daniel Vetter wrote: > >>> commit e73ab00e9a0f1731f34d0620a9c55f5c30c4ad4e > >>> Author: Daniel Vetter > >>> Date: Sun Dec 18 14:35:45 2016 +0100 > >>> > >>> drm: prevent double-(un)registration for connectors > >>> > >>> Lack of that would perfectly explain that oops ... Otherwise still no idea > >>> what's going wrong. > >> No... That's not in mainline as far as I can see. Should I test with > >> it applied? > > Hm, I guess failed to cc: stable that one properly, iirc we decided the > > race fix is too academic and can't be hit in reality ;-) > > > > Testing would be great. Probably conflicts because we extracted > > drm_connector.c only recently, but running s/drm_connector\.c/drm_crtc.c/ > > over the diff and then applying with some fudge should take care of that. > > It doesn't apply to mainline, with or without the substitution you suggest. I was hoping that the locking was the real cause here and would be an easy fix to apply. I did have a look at trying to reorder the DP-MST worker with driver registration. Hacky to say the least. -Chris From 30ac9092e934295f12775f03d73170fc480b7fc8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 10 Jan 2017 10:46:25 +0000 Subject: [PATCH] dp-mst-register --- drivers/gpu/drm/i915/intel_dp.c | 12 +++++++++++- drivers/gpu/drm/i915/intel_dp_mst.c | 9 ++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f0f44cdbe4b4..fc10eb2c8563 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4762,7 +4762,17 @@ intel_dp_connector_register(struct drm_connector *connector) intel_dp->aux.name, connector->kdev->kobj.name); intel_dp->aux.dev = connector->kdev; - return drm_dp_aux_register(&intel_dp->aux); + ret = drm_dp_aux_register(&intel_dp->aux); + if (ret) + return ret; + + if (intel_dp->mst_mgr.cbs) { + intel_dp->can_mst = true; + if (intel_dp->attached_connector) + intel_dp->attached_connector->base.status = intel_dp_long_pulse(intel_dp->attached_connector); + } + + return 0; } static void diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index c93c1999a494..f0a664041dbc 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -582,16 +582,19 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba struct drm_device *dev = intel_dig_port->base.base.dev; int ret; - intel_dp->can_mst = true; + intel_dp->can_mst = false; intel_dp->mst_mgr.cbs = &mst_cbs; /* create encoders */ intel_dp_create_fake_mst_encoders(intel_dig_port); - ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev->dev, &intel_dp->aux, 16, 3, conn_base_id); + ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev->dev, + &intel_dp->aux, 16, 3, + conn_base_id); if (ret) { - intel_dp->can_mst = false; + intel_dp->mst_mgr.cbs = NULL; return ret; } + return 0; } -- 2.11.0