Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4433059ioa; Wed, 27 Apr 2022 03:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSexjSBqKoY+9iB5OSAEb+8r+p8LmcN1TDu1jaEmrdLSixBGc3HO5CjcpxfmsCH7vaX8CU X-Received: by 2002:a17:902:d1cd:b0:15d:1483:6ed6 with SMTP id g13-20020a170902d1cd00b0015d14836ed6mr15646024plb.58.1651056805370; Wed, 27 Apr 2022 03:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651056805; cv=none; d=google.com; s=arc-20160816; b=re/NwfrdAuZ0kJxe7tbi1LG4f9IhSYUL3mcmtbhN8Zt3Mi2eePksAw6DNy3xmcyLGj ktxfBqJI2WsD2dmxvsktsJxzboFfLihQw3KlY2sNqtj+ACqmnFdxjUvrWrgQwXXPU2YB UgFUsymGzYxcWAFR7ChK8ctff8/tUUj2R0fX7rawnpGS86zBkD5SQgXDhplIT69fQab/ 0V0S42R6TfjtG4dxVzmqgJKJfpZO13SZarET05HuAlWESdW04xmED/yLKU8tsYH11jxd /kaT+rApYmL6HWUP0gIRNNZHMVF/+URPYsGQYHZqBW0RaVXvBgZ9qwuiKnFAfHtPnFNP 9dGg== 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=jz/npbxg2nv+hRamHSNA1HBAJbQ5i7P+Ytrig20hegY=; b=Evi4cyVLYlpsc0RghtoXGA+WSTSjMvqePoIckDByZUTKMmvwIi8mWLyernvHYKu4Vu 7ZKzjo3TzwXDaIySoEZIl/77MMTqTGky8DGCoU6cSfCQwc8ELwrlkEMORT73bgft84jE d3EP/REYH7Ga/suLe0H9B5Tt334si3aoiNfzP3FZjWOj36EmRhM+IX4FUFW+RjVhcn2i YukyYkG+hb6QFvo0kfEm9zKdSDmAszrjUXr9t730jUEDsIpCUteGGgj5ry3uKVy17wbR qE3OqLm6n6ltSXxSrmDgJraO2rHhHRkV/mZC0xQmOp47h1dqsevK47u+9auwEtjoH0b9 L4Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZwZXenHQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f19-20020a631013000000b003ab3da7b5aasi1083780pgl.389.2022.04.27.03.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:53:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZwZXenHQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 192252C99FC; Wed, 27 Apr 2022 02:58:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346764AbiDZJWg (ORCPT + 99 others); Tue, 26 Apr 2022 05:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345815AbiDZI5o (ORCPT ); Tue, 26 Apr 2022 04:57:44 -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 13D7538BF; Tue, 26 Apr 2022 01:42:44 -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 CBD90B81CED; Tue, 26 Apr 2022 08:42:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EF93C385A0; Tue, 26 Apr 2022 08:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962561; bh=u4sbI5XwVnMsxy9SXjtwcoKdZpij0eoP3VcDQagwUCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwZXenHQrKvWIhD4C/4kLCQMeDmsjSUGeAohHCmYNS8EOLXZ3mfqa7iffv62tQPzq nNzVPvGxre/6ihKxQBEKSrwVJuw1Vjx8ZzrUxeyqRVzIsqrmQ+X/cfHsImVwE9r7tB AtnlF8Oel9Qz5+IDVM62H+pb1lpzajeSH3HsQdKI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Anthony Koo , Rodrigo Siqueira , Nicholas Kazlauskas , Alex Deucher , "Limonciello, Mario" Subject: [PATCH 5.17 003/146] drm/amd/display: Only set PSR version when valid Date: Tue, 26 Apr 2022 10:19:58 +0200 Message-Id: <20220426081750.156293191@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081750.051179617@linuxfoundation.org> References: <20220426081750.051179617@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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: Nicholas Kazlauskas commit 1210b17dd4ece454d68a9283f391e3b036aeb010 upstream. [Why] DMCUB will hang if we send a PSR unsupported set version command. This can occur if we fall-through into the default case in the switch statement for PSR version. [How] Add an unsupported check after the switch statement. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: "Limonciello, Mario" Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c @@ -138,6 +138,10 @@ static bool dmub_psr_set_version(struct cmd.psr_set_version.psr_set_version_data.version = PSR_VERSION_UNSUPPORTED; break; } + + if (cmd.psr_set_version.psr_set_version_data.version == PSR_VERSION_UNSUPPORTED) + return false; + cmd.psr_set_version.psr_set_version_data.cmd_version = DMUB_CMD_PSR_CONTROL_VERSION_1; cmd.psr_set_version.psr_set_version_data.panel_inst = panel_inst; cmd.psr_set_version.header.payload_bytes = sizeof(struct dmub_cmd_psr_set_version_data);