Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2884804rwb; Mon, 15 Aug 2022 13:17:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4PGa60W/jkYQcPAbt8zdcovUOzEtnZfrA4qiskIKv6WntopYjxOABh/i+ZCp87NXQ+4izM X-Received: by 2002:a50:baa1:0:b0:43e:5e95:3eda with SMTP id x30-20020a50baa1000000b0043e5e953edamr16113679ede.340.1660594639474; Mon, 15 Aug 2022 13:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594639; cv=none; d=google.com; s=arc-20160816; b=qui+/lFE1HQ7WD1YoO2wZpUPFThNMI0EV8rTjtaDna6dHpcfRHkEtJ4l5YkhUE8wFW XdZIvirKhhICKSv9fbsVvZmFz+OVTPBsl3+Lx+phHNc5+2Om7TF5WPsyiVjjXALhi42k IE1j9eTNMAWKy/H8FGpdbk1/VE+t94uI5R3MirZvt2oXRh9/F7vPjtcBWnRbOQQoGHkZ 8W30/7R6Nq+xf55T+awosCGm9sxgV5FEfImdaG5tMva7EfPrenePQzQvtEmsQPDqLHId SfJxvpkJcFE+BhCnikq3Yt2dtwpbr0UMCHROKGfnpPkSuPnoiNqR2R6zqY+HolEKw/2c lvgw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dCz6rVPXKNrCnFfo1wGOQ+NkZAxjGxWYyXJrn8Gr9rY=; b=NUzmwp/Pb3bxJZEorQWLXeBsRirS7tcqIJbpQXnmkM+vKndL0O8pWn5DR60kGlXrQJ 8kuyNbrE0voHZehjy+eLuZ2+dH5VWWdVaaQlqoiYyaYpewgdPZndRIT4mW/5z2HciGvM Rv+wewvwBQOcYr+YfJK9y4Rcj7iYeKBUUSk2HF+I74hFE71+BLfDGojkpkUqtXVxK1Go umCXkWyTXnE00r7sGtxVIvE6I0flr5x2VlscctRYSAdbhNJBczxgXu7IS64rh0H3/vap tBfKr1m7BoQFhGpBOkqDWx8WzQPW9kpdIHwsa6M87ZMjlJrziJPWEP6oCxeGB7X5DzFT /Siw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="gdfa/E1T"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf8-20020a1709077f0800b00730412fe4d5si10460066ejc.740.2022.08.15.13.16.53; Mon, 15 Aug 2022 13:17:19 -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=@linuxfoundation.org header.s=korg header.b="gdfa/E1T"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239847AbiHOSVE (ORCPT + 99 others); Mon, 15 Aug 2022 14:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240182AbiHOSTM (ORCPT ); Mon, 15 Aug 2022 14:19:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434532BB28; Mon, 15 Aug 2022 11:16:26 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 49DB8B8106C; Mon, 15 Aug 2022 18:16:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94C78C433C1; Mon, 15 Aug 2022 18:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587383; bh=SH+pC6vT7iDgd9abhCEoZEDCVetOpDBa2PhqZvIrB6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gdfa/E1TsaydFF6g8GWqIThyqT8hYj+Xyd4Gtft7jcUfFkXDRbREMM3ets+6jMM1e GyrvMavsMb6vV4FF8fw8eWkV1b//hHLMRmXB5CuU/cQUhDYCVVMIO5ZsSJd9OpTFqg mHsM9jMD3BmTpzh8UyJQB07ERvVxqYndgw/WlPso= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , hgoffin@amazon.com, Alex Deucher Subject: [PATCH 5.15 069/779] drm/amdgpu: fix check in fbdev init Date: Mon, 15 Aug 2022 19:55:13 +0200 Message-Id: <20220815180340.239813219@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Alex Deucher The new vkms virtual display code is atomic so there is no need to call drm_helper_disable_unused_functions() when it is enabled. Doing so can result in a segfault. When the driver switched from the old virtual display code to the new atomic virtual display code, it was missed that we enable virtual display unconditionally under SR-IOV so the checks here missed that case. Add the missing check for SR-IOV. There is no equivalent of this patch for Linus' tree because the relevant code no longer exists. This patch is only relevant to kernels 5.15 and 5.16. Fixes: 84ec374bd580 ("drm/amdgpu: create amdgpu_vkms (v4)") Cc: stable@vger.kernel.org # 5.15.x Cc: hgoffin@amazon.com Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c @@ -341,7 +341,8 @@ int amdgpu_fbdev_init(struct amdgpu_devi } /* disable all the possible outputs/crtcs before entering KMS mode */ - if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display) + if (!amdgpu_device_has_dc_support(adev) && !amdgpu_virtual_display && + !amdgpu_sriov_vf(adev)) drm_helper_disable_unused_functions(adev_to_drm(adev)); drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);