Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1023334ybe; Wed, 4 Sep 2019 11:17:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzx8+0YOuyKy7pdAmS0XwuuImY4ywFuMzCBORB6IlxjGAgIZH+y3cIUR/gurxWtqxGO2Jm X-Received: by 2002:a17:902:b598:: with SMTP id a24mr20640707pls.5.1567621060847; Wed, 04 Sep 2019 11:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621060; cv=none; d=google.com; s=arc-20160816; b=SPIZXodQdQr/0M120b0o+CDl5zupYS9+PXMTxrLg3z5F7qqJbuMEiD3WrWZhMiDLWB 7kIJDjK7ZghwXV0X/yffHoqtqs+6sKwo2uXztOaMKq2Id3ORXDaTriW0RKx0mro6tC06 6mbwAajIWNUIF9F+VTvB9ukHY4o8lXG94Ic7tSmjjSON0BZriQCsnyDGOlqmjsbZhMTJ EhcJR4wbWr93+c5FyNyrLeI+lX38rYNwTIHXEMmoxt7EEdA5vWoj0ZbibttMCVY+JoPJ pR5nAWG+1Hq60ifezmUPmSsZ4v2SM+JxFIdKcQxDswSuRXDva1273TcaMKwWt7JodnfS shxA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8emq1wXz33zEu9HlFn5PAEYdEdu3uUkKwv5z9Z5s440=; b=NpnssPTn3R7VnOv7UbhCLQVEs1j881obSluO6YfK2ogMxVVeKbMAQwndmVYBdOWEIy iCj+Wg2YzKQ+S0jPimnAhJr/YyoRKkXqmVWUv4Gxd3n8I4s/+vqFueV5bqFUt6wJ8SH3 SsQfLGDArFjj8Lpm70I+kp0o/cJ+2oZmH9nYkzNYgmgPoEPf+mIRWojLIb3x1aB32JKj SrtP2juH4BVbTQeLJOijX3VG2XBcUIm5+8VksOMZHp3Le5ifl3gcz862j5BPqksGvU0t 1us2vL76/qou17O6B8ezb8+tZiVHV6wHB4al5BnVABErz+Y/YxVQmj8+R2m5e7pml/dV sZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N98X+QH5; 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 b6si11936156pfr.225.2019.09.04.11.17.25; Wed, 04 Sep 2019 11:17:40 -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=@kernel.org header.s=default header.b=N98X+QH5; 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 S2390374AbfIDSP6 (ORCPT + 99 others); Wed, 4 Sep 2019 14:15:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390424AbfIDSPL (ORCPT ); Wed, 4 Sep 2019 14:15:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5E7422DBF; Wed, 4 Sep 2019 18:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620910; bh=91bzfqjuA0AykFYNiVsjGg8ity7Xp6cKp0uQxd9sGB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N98X+QH5nILcbdJTqf6S2xEBc1maiKFdCV/d+YQQKI5Q2EsB9baZvrpOJ6WnsvbvP ZiHDTEsZFiQEwgs9A3udWwjAlO9/1tGyZ7AuTYy3NyrsXCPu6y6Cj1+X+pfFS4Qlss 8nby828UVy4aUz5x+RHIA5K/ut4OazjVndL1hL2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , sunpeng.li@amd.com, Daniel Vetter , Sean Paul , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Sasha Levin Subject: [PATCH 5.2 139/143] drm/i915: Do not create a new max_bpc prop for MST connectors Date: Wed, 4 Sep 2019 19:54:42 +0200 Message-Id: <20190904175319.881236425@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1b9bd09630d4db4827cc04d358a41a16a6bc2cb0 ] We're not allowed to create new properties after device registration so for MST connectors we need to either create the max_bpc property earlier, or we reuse one we already have. Let's do the latter apporach since the corresponding SST connector already has the prop and its min/max are correct also for the MST connector. The problem was highlighted by commit 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors") which results in the following spew: [ 1330.878941] WARNING: CPU: 2 PID: 1554 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xa0/0xb0 [drm] ... [ 1330.879008] Call Trace: [ 1330.879023] drm_property_create+0xba/0x180 [drm] [ 1330.879036] drm_property_create_range+0x15/0x30 [drm] [ 1330.879048] drm_connector_attach_max_bpc_property+0x62/0x80 [drm] [ 1330.879086] intel_dp_add_mst_connector+0x11f/0x140 [i915] [ 1330.879094] drm_dp_add_port.isra.20+0x20b/0x440 [drm_kms_helper] ... Cc: stable@vger.kernel.org Cc: Lyude Paul Cc: sunpeng.li@amd.com Cc: Daniel Vetter Cc: Sean Paul Fixes: 5ca0ef8a56b8 ("drm/i915: Add max_bpc property for DP MST") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20190820161657.9658-1-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza Reviewed-by: Lyude Paul Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/intel_dp_mst.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 8839eaea83715..d89120dcac67d 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -535,7 +535,15 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo intel_attach_force_audio_property(connector); intel_attach_broadcast_rgb_property(connector); - drm_connector_attach_max_bpc_property(connector, 6, 12); + + /* + * Reuse the prop from the SST connector because we're + * not allowed to create new props after device registration. + */ + connector->max_bpc_property = + intel_dp->attached_connector->base.max_bpc_property; + if (connector->max_bpc_property) + drm_connector_attach_max_bpc_property(connector, 6, 12); return connector; -- 2.20.1