Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp889576ybh; Tue, 21 Jul 2020 10:15:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwToFwPT1ywpmIPwLK3ngqlWWrH3DwlLjp1QD+W6ofSBd70ASvUjf3ciTBmjJ9vSQneVBX3 X-Received: by 2002:a17:906:ce43:: with SMTP id se3mr25793640ejb.543.1595351740155; Tue, 21 Jul 2020 10:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595351740; cv=none; d=google.com; s=arc-20160816; b=mM0l3rPr2DkIE/l0EZaS2kG+cbQLYom1lJA8JKKXJN+nMN+6Ha9GlPa95BRTfzPMbw 18oJA5T8+5YZCUSoNUf76W54GfAyyjbGZmEIMkVk1zzZ/dYyeLb1uGx8a4P0YIQ5xPS+ liZHau3IpHerDD2rR0w1c7R4DT+DnpqlOt176wgEIPEhMFO5r06COp6tnkuAr+i2gKyA cW9pv2XgJnP8S7f/OjMkzabJG0hwk7ul7X4nHqJ5gvvTewwnfMQn64iSI8KbTcjt3X2W OnEJCpJ/oimFEiQecZULmO+6Km2ZNfONVHNOnCVVcrNQFfWL4VJY70jo25jIE7Hwbsu9 M2Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=li6Ai+i2GC9C2OTaxMc0Mm8uFP4T7o+Xp3gc7X+SoOc=; b=u2byIfoIQKRsT5AnPC+Z6GYOTTUytWE0l6zSjP/4t+AMZWeQ0JMf3UZ0KBVbYpDp3p +MDExSlOcEoMW5QzF5wF/GAf0uNItaV98v0+SdaMg9lzDPXLeICAU57HwKgonGxvo2J2 FkUWFftg6edsL5W7KhXAr2hsoHCaO8AUZ425WJzAcidgXXQnyimx321b91hnqWUL7JXr VXkbZjUG3MWdcb6ZTlXXpOBdyW2faybclfcj2BHwmaJ5sroE9h1Tt7Qq2ayVJFbI3CyA nGm2mCpaMjoeanp5mD/HvZVYkdFFnUxT6f0mHxCzlwY4cxmdU6w4cEI52xOPmDFIXwSb wL2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBLL6J3+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si3407762eju.726.2020.07.21.10.15.16; Tue, 21 Jul 2020 10:15:40 -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=@gmail.com header.s=20161025 header.b=CBLL6J3+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730065AbgGURMc (ORCPT + 99 others); Tue, 21 Jul 2020 13:12:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbgGURMb (ORCPT ); Tue, 21 Jul 2020 13:12:31 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04982C061794 for ; Tue, 21 Jul 2020 10:12:31 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id a14so7089196wra.5 for ; Tue, 21 Jul 2020 10:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=li6Ai+i2GC9C2OTaxMc0Mm8uFP4T7o+Xp3gc7X+SoOc=; b=CBLL6J3+4BY47pbGZDKfS3eUO0MuL+xxmDwYvkPLz+F0w7xObrTNc4OCTQJ77r+PZc PkcbMxfQBkNxnJjFM/d/avBDGMSIm4x6knuvfkMPQepOuywO2A7Phgg0HcvmVaoGqS9r uY6esEnIkMOUODqmMoAURXJArcolQUBL5vokt043mskZU6k5nicicHp6Non51tsyiWbi bAsdGtuT0/xhIBHD/vXN+cjudpAJlhCf9jdhqmMX2mYhMBxZazqDsJuTfdSWwFFxu0Et Ky+4GrQATUHqiPJ1Yy+N9iAGQYGaLgE+0CvZurAkFuiDYyTUYv/1Z1cJ+iSs8CDFU6rc GkGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=li6Ai+i2GC9C2OTaxMc0Mm8uFP4T7o+Xp3gc7X+SoOc=; b=lFjUXOzyFsdY0v2V55ajIp5L6a5sTw2s1S3q+qrze7lovESUkH6IBEG/DxHO157SBM Z7ohnKFoOR8vqIsbnMtLvo5tv0SRvQJFuk45wpR8AlGC6TDafLqiZWn7PS0K3j3a9MaV nNMwlkHUBfE8HkKqqBntaOXKtm4tjnDlWRw72ceGy2Z5GrgpbrPIBav9YjF52ytIJqYY H8m5aDa66GlFQcL7pd9QMyTQWz0IkuB/4YKTbG+QVVRY1DWqzHJ1X8iHKbsbg2ZKnUvP jarIGSglQmEd5nZb0iDWChCdoOlqilbM3l1B7OWbuNMdXVdMufiayU/m+WbwPweojNDG 0qkQ== X-Gm-Message-State: AOAM530virVxNzLNtt/DpZ+ywi/eol5kJ6n34+xFQcIDeTH+2auck65n i9BzPGG7QPPQ2Ypxrug3WX3CvBMdk29BzOxX0Hs= X-Received: by 2002:a5d:618e:: with SMTP id j14mr1345774wru.374.1595351549684; Tue, 21 Jul 2020 10:12:29 -0700 (PDT) MIME-Version: 1.0 References: <20200717070958.41489-1-qiuwenbo@phytium.com.cn> In-Reply-To: <20200717070958.41489-1-qiuwenbo@phytium.com.cn> From: Alex Deucher Date: Tue, 21 Jul 2020 13:12:17 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/powerplay: fix a crash when overclocking Vega M To: Qiu Wenbo Cc: Evan Quan , amd-gfx list , "David (ChunMing) Zhou" , Chen Wandun , David Airlie , YueHaibing , LKML , Maling list - DRI developers , Eric Huang , Daniel Vetter , Alex Deucher , yu kuai , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Fri, Jul 17, 2020 at 8:23 AM Qiu Wenbo wrote: > > Avoid kernel crash when vddci_control is SMU7_VOLTAGE_CONTROL_NONE and > vddci_voltage_table is empty. It has been tested on Intel Hades Canyon > (i7-8809G). > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=208489 > Fixes: ac7822b0026f ("drm/amd/powerplay: add smumgr support for VEGAM (v2)") > Signed-off-by: Qiu Wenbo > --- > drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > index 3da71a088b92..0ecc18b55ffb 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > @@ -644,9 +644,6 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr, > > /* sclk is bigger than max sclk in the dependence table */ > *voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT; > - vddci = phm_find_closest_vddci(&(data->vddci_voltage_table), > - (dep_table->entries[i - 1].vddc - > - (uint16_t)VDDC_VDDCI_DELTA)); > > if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control) > *voltage |= (data->vbios_boot_state.vddci_bootup_value * > @@ -654,8 +651,13 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr, > else if (dep_table->entries[i - 1].vddci) > *voltage |= (dep_table->entries[i - 1].vddci * > VOLTAGE_SCALE) << VDDC_SHIFT; > - else > + else { > + vddci = phm_find_closest_vddci(&(data->vddci_voltage_table), > + (dep_table->entries[i - 1].vddc - > + (uint16_t)VDDC_VDDCI_DELTA)); > + > *voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT; > + } > > if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control) > *mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE; > -- > 2.27.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx