From patchwork Sun Feb 22 10:38:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 5861631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D2549F169 for ; Sun, 22 Feb 2015 10:37:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45BA420603 for ; Sun, 22 Feb 2015 10:37:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 327C720601 for ; Sun, 22 Feb 2015 10:37:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9027B6E2E5; Sun, 22 Feb 2015 02:37:06 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B4776E2E6 for ; Sun, 22 Feb 2015 02:37:06 -0800 (PST) Received: by mail-wg0-f41.google.com with SMTP id b13so20648964wgh.0 for ; Sun, 22 Feb 2015 02:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=Ohxxf6rWuCzcYkKk18FIyZ7/dcNszZkBUtyr6w4QHgI=; b=MMPCt/6Xc5jKeziwvtFP9fCFYMTV7QLWQb9d+UrONKYCfaTUKvc3IOD3EBvhwHKYv5 zyiBv04AZVCIMdrZRmlyTkpJTuWv5kOexlCAWOHPRc0vRzts+JpnWitxFkqhTsDmRxdK HKsdajNqdjjFD/zm823d9xiY7NEa8LVmJ1nfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ohxxf6rWuCzcYkKk18FIyZ7/dcNszZkBUtyr6w4QHgI=; b=gZ8kdOkAX7b3aq0bkvCpBF+GvubuCkLrYrv649Up8T6H/RQL19izfqUpxEm6OrWSkt C0Tcwp7CO/PS8rfuISUfbaxxHQwNAGYtys12As71pOcrC4l3c4DZhWdKJpk5IdoPRsgd 6/PXF6qiLFjk4NQANRitOA8EqMe48V5lddN3V27uOslwwtMbghxcJ5/2aMpn/HRoaojy BZ8z+Wj9q4cfKWdkVyopKahAvCC27i+AjNg27xyMrCnGsupcKwWbkqFCCXH3fgxnxc2v DbHlKHszH7QPnsx+NOGymTQNYb8d5dgVNzHpFICEmzF/zjC3NE8Q7srSIlKGSK1h02t+ cqnQ== X-Gm-Message-State: ALoCoQkyoIoohOy7x5ljcx/nephv5O0k7cUIz4jgdno9XF1LRiR1wnOQmkPnGEf7jH+fW8TrFEJv X-Received: by 10.180.8.10 with SMTP id n10mr10608967wia.79.1424601425119; Sun, 22 Feb 2015 02:37:05 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by mx.google.com with ESMTPSA id y14sm37389666wjr.39.2015.02.22.02.37.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Feb 2015 02:37:04 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm: Fix deadlock due to getconnector locking changes Date: Sun, 22 Feb 2015 11:38:36 +0100 Message-Id: <1424601516-19267-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.4 Cc: Marc Finet , Daniel Vetter , Intel Graphics Development , 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In daniel@phenom:~/linux/src$ git show ccfc08655 commit ccfc08655d5fd5076828f45fb09194c070f2f63a Author: Rob Clark Date: Thu Dec 18 16:01:48 2014 -0500 drm: tweak getconnector locking We need to extend the locking to cover connector->state reading for atomic drivers, but the above commit was a bit too eager and also included the fill_modes callback. Which on i915 on old platforms using load detection needs to acquire modeset locks, resulting in a deadlock on output probing. Reported-by: Marc Finet Cc: Marc Finet Cc: robdclark@gmail.com Signed-off-by: Daniel Vetter Reviewed-by: Rob Clark Tested-by: Marc Finet --- drivers/gpu/drm/drm_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index b15d720eda4c..ce5f1193ecd6 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2180,7 +2180,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id); mutex_lock(&dev->mode_config.mutex); - drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); connector = drm_connector_find(dev, out_resp->connector_id); if (!connector) { @@ -2210,6 +2209,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, out_resp->mm_height = connector->display_info.height_mm; out_resp->subpixel = connector->display_info.subpixel_order; out_resp->connection = connector->status; + + drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); encoder = drm_connector_get_encoder(connector); if (encoder) out_resp->encoder_id = encoder->base.id;