Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3397473ybp; Sun, 6 Oct 2019 11:02:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz79Tz7oECGE+O+quvYJzp3cul5rdVnVDSvQm1qatPAdWvgy5m47ybjtTL5u0M2gsKbTJOt X-Received: by 2002:a50:d903:: with SMTP id t3mr25041790edj.117.1570384966304; Sun, 06 Oct 2019 11:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384966; cv=none; d=google.com; s=arc-20160816; b=KDGemkmMLcyA892wKcgfKdjBvi+u6YDedRSZlR1ZYuTl3bmf19arEGxR3h2aiGgeMF CuuWDjyoErxvTPuUMqtMjm13P/sxj1mI75paD3JC7GqdNdM2uxjj/+DQpYiuGGxVmyH+ V8ubXc81Q0IcTGIU0HMJRCAfZtGvNk8jvWLsGYdRVaR2Zg96jJtFpognP4Crk/JBGbz+ 8CtvwYKvpjYSiZ9sAnS7M+/TgnD1aXCDGmRj/G19P8ZX/c9sBqiRfjEqc5hQgB5DYgOo 5oToH4HdsJ57u8jdJH5om70I8d5Ns645beJV1HmbSY4oqAi8ioHi4A6C/BXBxJGP8EeC 7bgA== 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=eLvWsMXiMPiy8phM9EQ9w3nl/eegIQBU5HnYCielnrY=; b=xqBQbMPHJL+5ZM3i/V8BNXZRL0vaWyYz6mccaIxOc03cWJdIoPNQfMsUYN5kvhvsf2 uOcOUNmwJpkV83bfrL76Bz2OB4ZwbO1B6+dU3gTsbZmPKM0AZ99HyM/8gCRJnJ5e3m6J /w2bCfNoTeL+Qg71ou5kne5668g3REywPI/8civz+hFsFnBuKk/k2sU079nNtKI1GEkQ Yu6Biq5aDGDbt/qCtSxv77SxYgtRhoqWhPPkObQhpNIpxUTGMabFi0uFWcvRfyVkNAs3 Q0lLZgrXBpSp2xbe+sL1r4xdu1wm66gIgcSHWpxjsGW+pka4Jp4DNCPRoEw6SI6qGAn5 ItdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VjM9RUMv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si5979457ejr.204.2019.10.06.11.02.22; Sun, 06 Oct 2019 11:02:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VjM9RUMv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729196AbfJFSA2 (ORCPT + 99 others); Sun, 6 Oct 2019 14:00:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbfJFR3G (ORCPT ); Sun, 6 Oct 2019 13:29:06 -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 850362080F; Sun, 6 Oct 2019 17:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570382946; bh=xnovLF+3uh2WwoA52FYSiy8zjjoMSiF+mmojNkCbgjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjM9RUMvED/iaajAv48wE9aLIWUKDzV26puuXRlzTL5mSrcYL7P9fJv43urtbqZVb hh+rHSnwFKstIjjDWUS84/VNX2GM34YFaypMhhXdA1+83121l16njd24SUKLwjHSk7 7HxyrLCek4jp2AaU+Lz0fXa/WLJ2WFwd+quDHOfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maarten Lankhorst , Mark Menzynski , Karol Herbst , Ben Skeggs , Sasha Levin Subject: [PATCH 4.19 029/106] drm/nouveau/volt: Fix for some cards having 0 maximum voltage Date: Sun, 6 Oct 2019 19:20:35 +0200 Message-Id: <20191006171138.932176677@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@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: Mark Menzynski [ Upstream commit a1af2afbd244089560794c260b2d4326a86e39b6 ] Some, mostly Fermi, vbioses appear to have zero max voltage. That causes Nouveau to not parse voltage entries, thus users not being able to set higher clocks. When changing this value Nvidia driver still appeared to ignore it, and I wasn't able to find out why, thus the code is ignoring the value if it is zero. CC: Maarten Lankhorst Signed-off-by: Mark Menzynski Reviewed-by: Karol Herbst Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/volt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/volt.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/volt.c index 7143ea4611aa3..33a9fb5ac5585 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/volt.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/volt.c @@ -96,6 +96,8 @@ nvbios_volt_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, info->min = min(info->base, info->base + info->step * info->vidmask); info->max = nvbios_rd32(bios, volt + 0x0e); + if (!info->max) + info->max = max(info->base, info->base + info->step * info->vidmask); break; case 0x50: info->min = nvbios_rd32(bios, volt + 0x0a); -- 2.20.1