Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3685799rwe; Mon, 17 Apr 2023 01:48:30 -0700 (PDT) X-Google-Smtp-Source: AKy350apSZt4ELekXiyfSsw3YRDOACYdVYljvf8lqDZswqmdbjIlxLM0FZX0RtbRLF3UEEjX2nX9 X-Received: by 2002:a05:6a00:148a:b0:63b:5d84:5d03 with SMTP id v10-20020a056a00148a00b0063b5d845d03mr18925048pfu.25.1681721310270; Mon, 17 Apr 2023 01:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681721310; cv=none; d=google.com; s=arc-20160816; b=GjLnFTM+c4XS2y4KioMgwNu6fU53PTMDIBjrcGyVbjJMPZ+6eEr5OLQgyTUGua3Hwi XYz+ys8hptfxmfjchz5R3kLas55064YyJpmuga+86PcxQ+p/7Cyo/1GZsP5RbvstH+2b IfgxwI6spbX/kThmHUV4nH77aKCS6kp2dgd8XcyFSmsbkrPj1LZSE7TvbaD8Hk5vsZEv rcPG3VDHhV0iW+dIkisjgy+IMvmeJ+Qj/3U5YIyUo8jqtSTUCZ9NOK5fqEWAx9cnul70 lp6HcIg5g5c/V3Wh2o9WSH/7JzCRuZmbGKQFZ+QnSAPy3Qp38OTz1pnc61FS8Hq+HhNk gfMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=NPLW0MdyDHAg/VEj3ryTIPM3p7D1rIwUmsDF52s2H5E=; b=nPoOi91ZexuAYZoXotLwYcG0h/IhKbP7oARqHyX4W1/tBUTyNglX5TP+9XsB/PpQH3 g1tk5ZJazvZrHZSyvhG3KiMr8UhWe9rNCFWmg+jk2i9bZeo7ETklpzCedvxsyJUkI6xh vqlp5e5GF0NGS0keAWbOPhlxzIPbTgOiu6J14dXWY39Wqru62j86C531Xpp8Vg51TWGW gc86CBjjA5kFdqeavYfD3rHGBXCTjRbuJzqxq08Na+vqhNIOeg8sfE1Clgz7m3bEYREn YGJYYahdcoOX9QR0hywJv71UXQpVbIsilmF6wX0wwDI0Bd0oA0Gcq8ncvZskMATMBBIg SycA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c7qXXfZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a63ba04000000b00508b12a837bsi11652300pgf.156.2023.04.17.01.48.16; Mon, 17 Apr 2023 01:48:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c7qXXfZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbjDQIo4 (ORCPT + 99 others); Mon, 17 Apr 2023 04:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjDQIoy (ORCPT ); Mon, 17 Apr 2023 04:44:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FA21E49 for ; Mon, 17 Apr 2023 01:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681721093; x=1713257093; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=KV/N/E6kXh6FygL9ZMy5fr2iCnJHqBytPmQ8FHRLomc=; b=c7qXXfZZwiPUe27P7DIHmoXDkzqKCJw7g2MTHq6sYpbx9DqJPPoOu/CT 8n373oOnj9Cz6BL8TUU1/fJqXrqIvaDuHEbQbx1nY1WwSMEGYJhCxRY+P eqDX8ZTgwe1Tlay3Xr2LC4JnFPrSsLjx+kTRhIIgLPc4gD1kxAF9VpKfk lnsSvPoUU29dd8uvYWivtBKhLMuunn3pY5ZaXgviy5wwvWj0xG00pe1IS 7LWfmt+w9aK8toGuP434rxr4JeecdSxanRpRh1IB1EKCV213PvWPsPcQf DnFQj8iPnl/72m2RrSa67a4ZTeyHKxdvsvA979ABFN3hyYfe2Zhzcts4+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="343595720" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="343595720" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:44:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="640887252" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="640887252" Received: from habramov-mobl4.ger.corp.intel.com (HELO localhost) ([10.252.47.83]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:44:49 -0700 From: Jani Nikula To: Lyude Paul , Jeff Layton , "Lin, Wayne" , Alex Deucher Cc: 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 In-Reply-To: <7a1b00f02b125bd65824b18ea09509efe3cf777d.camel@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230413111254.22458-1-jlayton@kernel.org> <87edooarpq.fsf@intel.com> <4d8479f20ef30866fcf73f3602f1237376110764.camel@kernel.org> <878reug394.fsf@intel.com> <7a1b00f02b125bd65824b18ea09509efe3cf777d.camel@redhat.com> Date: Mon, 17 Apr 2023 11:44:47 +0300 Message-ID: <874jpegao0.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Apr 2023, Lyude Paul wrote: > On Fri, 2023-04-14 at 13:35 +0300, Jani Nikula wrote: >> On Fri, 14 Apr 2023, Jeff Layton wrote: >> > 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 ret= rieve >> > > the drm atomic state. Also , "Failed to create MST payload for port"= indicates >> > > error while configuring DPCD payload ID table. Could you help to pro= vide log >> > > with KMS + ATOMIC + DP debug on please? Thanks in advance! >> > >=20 >> > > Regards, >> > > Wayne >> > >=20 >> >=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? >> >=20 >> > 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. >> >=20 >> > 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. >>=20 >> Cc: Lyude. >>=20 >> Looks like the state parameter was added in commit 4d07b0bc4034 >> ("drm/display/dp_mst: Move all payload info into the atomic state") and >> its only use is to get at state->dev for debug logging. >>=20 >> What's the plan for the parameter? Surely something more than that! :) > > I don't think there was any plan for that, or at least I certainly don't = even > remember adding that D:. It must totally have been by mistake and snuck by > review, if that's the only thing that we're using it for I'd say it's > definitely fine to just drop it entirely I guess we could use two patches then, first replace state->dev with mgr->dev as something that can be backported as needed, and second drop the state parameter altogether. Jeff, up for it? At least the first one? BR, Jani. > >>=20 >> Instead of "state ? state->dev : NULL" I guess we could use mgr->dev >> like the other logging calls do. It's papering over the NULL parameter >> too, but perhaps in a slightly cleaner way... >>=20 >>=20 >> BR, >> Jani. >>=20 >>=20 >> >=20 >> > > > -----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 d= isplay >> > > > > > driver code. The symptoms are ususally a line like this in dme= sg: >> > > > > >=20 >> > > > > > amdgpu 0000:30:00.0: [drm] Failed to create MST payload fo= r port >> > > > > > 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 t= o find. >> > > > >=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 creat= ion for %s >> > > > failed, skipping part 2\n", >> > > > > > + drm_dbg_kms(state ? state->dev : NULL, >> > > > > > + "Part 1 of payload creation for %s f= ailed, >> > > > > > + skipping part 2\n", >> > > > > > payload->port->connector->name); >> > > > > > return -EIO; >> > > > > > } >> > > > >=20 >> > > > > -- >> > > > > Jani Nikula, Intel Open Source Graphics Center >>=20 --=20 Jani Nikula, Intel Open Source Graphics Center