Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3046428ybt; Mon, 22 Jun 2020 13:34:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZBIWRdvTNpiieef+5bgh6k7A7QTCby5z8jyLXfeo6HCZQIUEvHWabsmAmw+LHSYKdY0lK X-Received: by 2002:a17:906:a772:: with SMTP id fu18mr4733439ejb.324.1592858070115; Mon, 22 Jun 2020 13:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592858070; cv=none; d=google.com; s=arc-20160816; b=UEAGVz1+ykfpW6VYcmKcQeJdisdS950etO5HIFnSt9JN279izg+aOD4k7d3PQgX+Sg cbHOQ2AHX3iQjdj/uzstQFPjbya9Ha/VNWRzh5ZUhjVQEQmnF2t8zz5tKDZ8nBmSJcQ9 XTMpI0Bc6o+jabVNdLY3BPJVjJZI6KVuAEKXGZn3lbN/CVN9EKvYke1ecMhUQI0ln34J TqK5LihWdI/Cwl9D+RGmFSABOqKk9ttwkfBlyLBzuReCtTeTjhBmZZak/+V+yepvAZ8I IqSM69iGzuX1Ucwnro2re/JW531qN1XJf0kpc1jspUbnzvr2sZUpsZUZRlgroROd0cLp VsTw== 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 :message-id:date:subject:cc:to:from; bh=h8HniiSVoKsGZ/ERECfPVj/nc7IWNw6qhcYKMolA91Q=; b=RVcovwOKxXcKy2wzAENRb2NG4f4cM3TKcZ3bqGswe/gfvt0uWEicBQlmMBsTgKPe5X c7bLZjcNZ+7/8sTGIQ4ZFUhqW9aKUirPBYZGk24GOU4Ei7sTqqoI/zs1xmkBzUuWl0PG /9XNRZZE1gzxFOTWBlvm6/eIK7+YPHccP3L3SthTQ537xw6zHpFazcFQ7XrbNXOtvYeU VXM4y6r0kKOSsxPr8ZUyP/kRtvxxv9wgYEPqOkhhNi9SG6tbVy+KLlz/hknwcYSeo2gE UC3Ji1M+VR4Rkqf8TDUWwb/A+n5aqnnSXwRUa6NWnCetoW98A/r646l2rJvr5lwkz0hw eSCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay2si9242403edb.45.2020.06.22.13.34.06; Mon, 22 Jun 2020 13:34:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgFVUbf (ORCPT + 99 others); Mon, 22 Jun 2020 16:31:35 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41758 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728361AbgFVUbe (ORCPT ); Mon, 22 Jun 2020 16:31:34 -0400 Received: by mail-lj1-f195.google.com with SMTP id 9so20898726ljc.8; Mon, 22 Jun 2020 13:31:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=h8HniiSVoKsGZ/ERECfPVj/nc7IWNw6qhcYKMolA91Q=; b=kkHQvh6TZzt7nHJCyBC2Z1nAsqReS6OYsUKtq8UjPxrnTatF0GM6pQ5rRbSpLVU/5D wF+A3xzLkRJNrrOgM/o+b8YpFx0KskBf4PVrZS/595cRgQo5jNJxPTTcAVfD0uQzg5/Z QBWGnlBUhmR0aa1BpZ8hTNAFp2QEGwn3w6RiWATZm7U3mbfTobBVTzKl9UOR20yFRebW 40O09U6MmZJe1ztdJffDg227RmP7F6ec0gY+hyAsgRqTQjmE3zv1XfpSuVED4sFhsj5U PesTXpe2gCvGe3/dkY5m6+YogTzERld4ksuto7HS3zYcx+1u1BOFHf5Z0wrNTZBrxxJY SF0A== X-Gm-Message-State: AOAM533unRwAN4sOc1rIyDHgOWXKFRAwcNzG1d7d8UQjh+zUR1tvVVUQ q/CpOhmwBbaSbxM+btshO0c= X-Received: by 2002:a2e:9a08:: with SMTP id o8mr9066001lji.126.1592857892366; Mon, 22 Jun 2020 13:31:32 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id y143sm2577314lff.88.2020.06.22.13.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 13:31:31 -0700 (PDT) From: Denis Efremov To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: Denis Efremov , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] drm/radeon: fix fb_div check in ni_init_smc_spll_table() Date: Mon, 22 Jun 2020 23:31:22 +0300 Message-Id: <20200622203122.25749-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/radeon/ni_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index b57c37ddd164..c7fbb7932f37 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -2127,7 +2127,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev) if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_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 (clk_v & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT)) -- 2.26.2