Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED641C77B6E for ; Fri, 14 Apr 2023 10:15:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B344110ECC7; Fri, 14 Apr 2023 10:15:55 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1DC0710ECB8 for ; Fri, 14 Apr 2023 10:15:54 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19A2A62E90; Fri, 14 Apr 2023 10:15:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A3AAC433EF; Fri, 14 Apr 2023 10:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681467352; bh=n1MF/+Zl1HcpJDYupreCKHbSzMG3zCXIVmAO73u8PBE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XBgq51UWrVJndkhIDlgYKxQdYdLrv7WdtbQ2ZBJBidTew6j4DMefRmyg/YKdQaNHW rPpGheotimyJg+/5qmzEuG/vUltX982a2VfjmArmM+Iu60uLG9lgmEjTU3juWqsHQA Y6sJeH5W7XgaUhLSQhD4IwkvEua1Hc9632Y0pALqmUaByFplhIEMN7k5rfe5La2Qbd 0J3z1iSjH4WJdMO39aX+KpCQ1q/eAbsMvr3x1SNDRBMy92rG0oUfzazH8mhAaKHoDv qqQyI60Y267+TmADrlxipIA1njI7c8QLy3bgozOIGyWdg4m/if7MM/Wij8aRQJTDo7 VEUxjpEn43Vbg== Message-ID: <4d8479f20ef30866fcf73f3602f1237376110764.camel@kernel.org> Subject: Re: [PATCH] drm: make drm_dp_add_payload_part2 gracefully handle NULL state pointer From: Jeff Layton To: "Lin, Wayne" , Alex Deucher , Jani Nikula Date: Fri, 14 Apr 2023 06:15:50 -0400 In-Reply-To: References: <20230413111254.22458-1-jlayton@kernel.org> <87edooarpq.fsf@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Deucher, Alexander" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 2023-04-14 at 04:40 +0000, Lin, Wayne wrote: > [Public] >=20 > Hi Jeff, >=20 > Thanks. I might need more information to understand why we can't retrieve > the drm atomic state. Also , "Failed to create MST payload for port" indi= cates > error while configuring DPCD payload ID table. Could you help to provide = log > with KMS + ATOMIC + DP debug on please? Thanks in advance! >=20 > Regards, > Wayne >=20 Possibly. I'm not that familiar with display driver debugging. Can you send me some directions on how to crank up that sort of debug logging? Note that this problem is _very_ intermittent too: I went about 2 weeks between crashes, and then I got 3 in one day. I'd rather not run with a lot of debug logging for a long time if that's what this is going to require, as this is my main workstation. The last time I got this log message, my proposed patch did prevent the box from oopsing, so I'd really like to see it go in unless it's just categorically wrong for the caller to pass down a NULL state pointer to drm_dp_add_payload_part2. > > -----Original Message----- > > From: Alex Deucher > > Sent: Thursday, April 13, 2023 8:59 PM > > To: Jani Nikula ; Lin, Wayne > > > > Cc: Jeff Layton ; David Airlie ; > > Daniel Vetter ; Deucher, Alexander > > ; linux-kernel@vger.kernel.org; dri- > > devel@lists.freedesktop.org > > Subject: Re: [PATCH] drm: make drm_dp_add_payload_part2 gracefully > > handle NULL state pointer > >=20 > > + Wayne > >=20 > > On Thu, Apr 13, 2023 at 8:31=E2=80=AFAM Jani Nikula > > wrote: > > >=20 > > > On Thu, 13 Apr 2023, Jeff Layton wrote: > > > > I've been experiencing some intermittent crashes down in the displa= y > > > > driver code. The symptoms are ususally a line like this in dmesg: > > > >=20 > > > > amdgpu 0000:30:00.0: [drm] Failed to create MST payload for por= t > > > > 000000006d3a3885: -5 > > > >=20 > > > > ...followed by an Oops due to a NULL pointer dereference. > > > >=20 > > > > The real bug is probably in the caller of this function, which is > > > > passing it a NULL state pointer, but this patch at least keeps my > > > > machine from oopsing when this occurs. > > >=20 > > > My fear is that papering over this makes the root cause harder to fin= d. > > >=20 > > > Cc: Harry, Alex > > >=20 > > >=20 > > > BR, > > > Jani. > > >=20 > > >=20 > > > >=20 > > > > Link: https://bugzilla.redhat.com/show_bug.cgi?id=3D2184855 > > > > Signed-off-by: Jeff Layton > > > > --- > > > > drivers/gpu/drm/display/drm_dp_mst_topology.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > >=20 > > > > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c > > > > b/drivers/gpu/drm/display/drm_dp_mst_topology.c > > > > index 38dab76ae69e..87ad406c50f9 100644 > > > > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c > > > > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c > > > > @@ -3404,7 +3404,8 @@ int drm_dp_add_payload_part2(struct > > > > drm_dp_mst_topology_mgr *mgr, > > > >=20 > > > > /* Skip failed payloads */ > > > > if (payload->vc_start_slot =3D=3D -1) { > > > > - drm_dbg_kms(state->dev, "Part 1 of payload creation f= or %s > > failed, skipping part 2\n", > > > > + drm_dbg_kms(state ? state->dev : NULL, > > > > + "Part 1 of payload creation for %s failed= , > > > > + skipping part 2\n", > > > > payload->port->connector->name); > > > > return -EIO; > > > > } > > >=20 > > > -- > > > Jani Nikula, Intel Open Source Graphics Center --=20 Jeff Layton