Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1593224rdb; Mon, 8 Jan 2024 04:32:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUudT7SQ65neyKFhR/q+5uCEYV+cF+TjmoRUZUAFuGvfvWmZJBEoaHsoqR2M7VCSe727KJ X-Received: by 2002:a05:620a:490f:b0:782:41bf:6ef0 with SMTP id vy15-20020a05620a490f00b0078241bf6ef0mr4138206qkn.27.1704717149777; Mon, 08 Jan 2024 04:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704717149; cv=none; d=google.com; s=arc-20160816; b=Y4olWOHA4WMmy0Jekn+m2Zc3lb5UU5ZCsBcMHjz0mzjQoTaNp0BFLNnV2MPV0Z1+E6 4d+6OTtG/7HGLLDmZ2wByKPaI9hSLEnPO5wRKX/87d5aaInzYLphQ1DnDkbRQj9HdqDA pV5EI5+end3beLC3ky7X83Rn5tuVCXrW/4NZIS0CNDdwVysTNeQaZ95bVmkkq6gRELoX mBFYSjCCUYh50FRIElf4NTx2MJKbVZgBtxVkjFyJ6ziVcqQ1o+RxXbzp+nE5BJ0neSM0 wrjLYwqfawH7Kt1YR/VSVFVwpFtCUF3PAC01o6i6vyzunQpA68F9dBg8e599Hn9But4l qJug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PrywFl4dF4zHWfpUuWsgH0JV5G1AwceviCKHYw54S3k=; fh=4UPMIIE1PbkKCI97F1LAop2RjRlzPuax3iNfZF9CJpM=; b=VpIMAJKh3LbbqFMXERykapE8uRr0D5xXf0drKhTbWylqJGDTyU+Dvb4KclQmMkuvkp qaN3O6jKVQlTeoRhUKwBvGaZgfT9fks+A29JPtaRTvS5nnopVfEstwluhoblLpEp4pDi GpM6oRIO69M9k1hk8p7VV/EFle/sjAr1NbJmlKEnKmEHf9YhC/A1MXoDu8lK5XwvJ/gg QbsBwFdnIfdBKrrRjFmAcYE3HrULGo0a2VDd0AlwdA0fC/ohdd04YHRnplSH67RPkmB4 Fc9Do+CNzxTDWK3Kg1DNnqR5NOVp1RA96iDX1+A7KIN4TYuKbWG3g37JhfaiaNei5Sq4 vePQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gy9/q2L4"; spf=pass (google.com: domain of linux-kernel+bounces-19508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pa22-20020a05620a831600b00783224e3044si1901226qkn.533.2024.01.08.04.32.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 04:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gy9/q2L4"; spf=pass (google.com: domain of linux-kernel+bounces-19508-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8800C1C22528 for ; Mon, 8 Jan 2024 12:32:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85F7E40C12; Mon, 8 Jan 2024 12:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gy9/q2L4" X-Original-To: linux-kernel@vger.kernel.org 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 B584840C05; Mon, 8 Jan 2024 12:28:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4795C433C8; Mon, 8 Jan 2024 12:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704716925; bh=tij3zoxBMK+MBVN+7nMEI60sbQV6NDv5rjGx+xkKnhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gy9/q2L4G1iTSF7sVMeTCQKGdE0wdl07eYAO/TOZd5wqxSHzDlj56ljqesaafP56j Wf6SwNRtFHoiYMjoKRi3sDzCzLCIAM3+kOmvb2buGZJfQaWKSDC60FwECR9HHMhTGQ dT3bgGYhFxzMvvk1X1S4JE9Nk/xqk/tZ5O2OJMOcgkFzdIlys5SfbuHSSHJbuThGiX uzGZ0CW70eRvxUeCVJRvmh80w9Gapp4Ww7wY30SPf8XyGioVe9vQMpRot90oFZUhCe t1iXL+ZpO1+yEX/voQDbsyokCtlthBDXiFQh5G/UzU5NSHt61brQ1077hL40ljS0OW OtC0wzEhJksfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dave Airlie , Dave Airlie , Sasha Levin , kherbst@redhat.com, lyude@redhat.com, dakr@redhat.com, daniel@ffwll.ch, bskeggs@redhat.com, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.1 5/5] nouveau: fix disp disabling with GSP Date: Mon, 8 Jan 2024 07:28:16 -0500 Message-ID: <20240108122823.2090312-5-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240108122823.2090312-1-sashal@kernel.org> References: <20240108122823.2090312-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.71 Content-Transfer-Encoding: 8bit From: Dave Airlie [ Upstream commit 7854ea0e408d7f2e8faaada1773f3ddf9cb538f5 ] This func ptr here is normally static allocation, but gsp r535 uses a dynamic pointer, so we need to handle that better. This fixes a crash with GSP when you use config=disp=0 to avoid disp problems. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 65c99d948b686..ae47eabd5d0bd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -359,7 +359,7 @@ nvkm_disp_oneinit(struct nvkm_engine *engine) if (ret) return ret; - if (disp->func->oneinit) { + if (disp->func && disp->func->oneinit) { ret = disp->func->oneinit(disp); if (ret) return ret; @@ -461,8 +461,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, spin_lock_init(&disp->client.lock); ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine); - if (ret) + if (ret) { + disp->func = NULL; return ret; + } if (func->super) { disp->super.wq = create_singlethread_workqueue("nvkm-disp"); -- 2.43.0