Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1237110pxa; Thu, 20 Aug 2020 06:25:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpLMT4hbvsbGLsTrjFx7Wklrx44QRGMNYbT2nbNrOGVYuzkfcp1QSE9+f4NYXavDt/cbWi X-Received: by 2002:a05:6402:c12:: with SMTP id co18mr2860165edb.297.1597929944538; Thu, 20 Aug 2020 06:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597929944; cv=none; d=google.com; s=arc-20160816; b=AzXRHtg/EFAoehIoJbyfe6YxJ/Ds5OoZ3PFwy6iNHYyRN+YzO3B16Dj4RQXPQpBLs9 r4ErYuAu9G9e6sd9Dtr2MvJUw7xyCLcS7gYx/+RZUhgBAun8L0slYBuloE+ia55QrfpI nNDCrj5vxGEwfdnyXI8ol20QiRzQ1HwLjw00LMnDbMM+xL5KiXf90M+ZLRwCFQtbFwz5 1NXDIuu6KcezWzcaqV0oS6QuRWwQJw0Rn97SvMgJH14iF4R2zQbLtbCUINkVjyvX8fKo hJBa5LNx6UAnHhDujUoBNxk5ogBhqgdJECWHaH5YR1Q+XUUT6ihhiv1tgZp0MpCEyROV 3P/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vHyrxSohqEZWE5rSmnUtwZbkhGVTyPVVPNivkACNJaI=; b=MN5GnogdNw93YWmn3cDEEGr8Qcbxn0bDRQ3BL65m7ZhffTUnmZPfl5ibGFO7bj44vA MoPy3iLfFZto1DnywGjnLNjiGmAEAZ0kA8DRkOUO7gUK/bRntyc23erIyaYW1NFIuoxO tD6dQ4HX/PCrkr/Tj+HMKu+7xpMdPDqowzYpKaKoGjDEYZG3Ez/u5JbjrDwtmZKfFvHJ PflRRlPWVUc7+pdsCorp6fMic9lOKz1X0nfk6dCiR3H1PC4JYhJLLQdN7RYo8AIisUvy OapB2YxlBV7ggjGJ24U9q1WwVJhjwfVsmoT45xS8ps65fc1VLYqHrrqOx3AzDcgLFBpB a5BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JLOJZ+PG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si168652edl.4.2020.08.20.06.25.20; Thu, 20 Aug 2020 06:25:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JLOJZ+PG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730396AbgHTNYu (ORCPT + 99 others); Thu, 20 Aug 2020 09:24:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:46214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728254AbgHTJeO (ORCPT ); Thu, 20 Aug 2020 05:34:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 940AB22B4B; Thu, 20 Aug 2020 09:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916054; bh=90I3GdQGDaQgZKt5Eh4N77gz17r57rFxkqm5Bi0gq9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JLOJZ+PG4/v+b2J+97umFHb+GJ07PVoKb9iEWMNQyD/+LnG3OBOoM/AXCDe3rI1Xr z7UFAb5/n61hz7fhSJ7oD9pXkA+jmXT5C6d9Ub+iwlBcOoCdFM+gnFFjYJG2/H1+k7 cWoLKFbrhPRfBUMIXvLbzDy0gp/tTox2sTj5HUBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Efremov , Alex Deucher Subject: [PATCH 5.8 220/232] drm/radeon: fix fb_div check in ni_init_smc_spll_table() Date: Thu, 20 Aug 2020 11:21:11 +0200 Message-Id: <20200820091623.447066807@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Denis Efremov commit f29aa08852e1953e461f2d47ab13c34e14bc08b3 upstream. clk_s is checked twice in a row in ni_init_smc_spll_table(). fb_div should be checked instead. Fixes: 69e0b57a91ad ("drm/radeon/kms: add dpm support for cayman (v5)") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/ni_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -2124,7 +2124,7 @@ static int ni_init_smc_spll_table(struct if (p_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_SHIFT)) ret = -EINVAL; - if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT)) + if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT)) ret = -EINVAL; if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT))