From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FCB54B5AE for ; Mon, 12 Aug 2024 14:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723474483; cv=none; b=KSDM1RW0fnwey02XHaKpBWvAQVRGoqBQn2P/FJO+mbopaa4+ogx5oeQmpcWMTLvkXCUKJ4PV202Y1tTUXzW9NmuAH+rLZ545K4mY4kJ9L8uFPDxc19xURuFwWeCJkPtORok/cNDhwYfDXc63+o6OZM3GXvblWlx7IjDq8MFcGJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723474483; c=relaxed/simple; bh=iInqt93pKsbNczXAs5NwKA5/sEDy3oRQNb+rQqIgPrc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=YjdX7bXx5IwNUvV/mcyXjYHbrKqispdu/5tYtzP+wOnpiDp7X9h3ZuijSbi4Mvs9258gOq0r/hNGpoWuvrIfWlTUxvDxs6jtnfMi12s/MXPwrprpy5d7vzE2wqCCuL96ORCYjZsYNfBbMDC43OjPI5tEcD/dxWg4vFSFZHqBAgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M7EbJVYf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="M7EbJVYf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9235C32782; Mon, 12 Aug 2024 14:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723474483; bh=iInqt93pKsbNczXAs5NwKA5/sEDy3oRQNb+rQqIgPrc=; h=Subject:To:Cc:From:Date:From; b=M7EbJVYf3FEMiSwe4ozZEA78+09ceAkx6i/bPMFksLd+NjYILy0eYlCvcsHYaGDqX N/GX07rkM9oq/pB/PUA7+N/ckzVz3bAPWnAKYKQyPX1mL0Zpgo6xKmGWuInFf7x06N W8A7fGpv/xUaw1WYwsW3KZH0tdZVmo7MYNv3QbEE= Subject: FAILED: patch "[PATCH] drm/amd/display: Add null check in" failed to apply to 5.4-stable tree To: natanel.roizenman@amd.com,alexander.deucher@amd.com,aurabindo.pillai@amd.com,daniel.wheeler@amd.com,nicholas.kazlauskas@amd.com Cc: From: Date: Mon, 12 Aug 2024 16:51:59 +0200 Message-ID: <2024081258-chaps-hydrated-1cfb@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x 899d92fd26fe780aad711322aa671f68058207a6 # git commit -s git send-email --to '' --in-reply-to '2024081258-chaps-hydrated-1cfb@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: 899d92fd26fe ("drm/amd/display: Add null check in resource_log_pipe_topology_update") 5db346c256bb ("drm/amd/display: update pipe topology log to support subvp") 012fe0674af0 ("drm/amd/display: Add logging resource checks") 09a4ec5da92c ("drm/amd/display: Refactor dc_state interface") abd26a3252cb ("drm/amd/display: Add dml2 copy functions") ed6e2782e974 ("drm/amd/display: For cursor P-State allow for SubVP") f583db812bc9 ("drm/amd/display: Update FAMS sequence for DCN30 & DCN32") ddd5298c63e4 ("drm/amd/display: Update cursor limits based on SW cursor fallback limits") 7966f319c66d ("drm/amd/display: Introduce DML2") 6e2c4941ce0c ("drm/amd/display: Move dml code under CONFIG_DRM_AMD_DC_FP guard") 13c0e836316a ("drm/amd/display: Adjust code style for hw_sequencer.h") 1288d7020809 ("drm/amd/display: Improve x86 and dmub ips handshake") ad3b63a0d298 ("drm/amd/display: add new windowed mpo odm minimal transition sequence") 177ea58bef72 ("drm/amd/display: reset stream slice count for new ODM policy") c0f8b83188c7 ("drm/amd/display: disable IPS") 93a66cef607c ("drm/amd/display: Add IPS control flag") dc01c4b79bfe ("drm/amd/display: Update driver and IPS interop") 83b5b7bb8673 ("drm/amd/display: minior logging improvements") 15c6798ae26d ("drm/amd/display: add seamless pipe topology transition check") c06ef68a7946 ("drm/amd/display: Add check for vrr_active_fixed") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 899d92fd26fe780aad711322aa671f68058207a6 Mon Sep 17 00:00:00 2001 From: Natanel Roizenman Date: Wed, 3 Apr 2024 16:52:48 -0400 Subject: [PATCH] drm/amd/display: Add null check in resource_log_pipe_topology_update [WHY] When switching from "Extend" to "Second Display Only" we sometimes call resource_get_otg_master_for_stream on a stream for the eDP, which is disconnected. This leads to a null pointer dereference. [HOW] Added a null check in dc_resource.c/resource_log_pipe_topology_update. CC: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Aurabindo Pillai Signed-off-by: Natanel Roizenman Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 6831b0151705..bb43c62e959a 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2302,6 +2302,10 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state) otg_master = resource_get_otg_master_for_stream( &state->res_ctx, state->streams[stream_idx]); + + if (!otg_master) + continue; + resource_log_pipe_for_stream(dc, state, otg_master, stream_idx); } if (state->phantom_stream_count > 0) {