Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp254195pxb; Fri, 15 Jan 2021 02:21:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUywCQrukjXtS5OXBKppx36vWyKhGqUQr0O1pY2ivLHaZFY97KAU/w6G28J6F9983U1Acz X-Received: by 2002:a05:6402:30ac:: with SMTP id df12mr9427603edb.175.1610706109017; Fri, 15 Jan 2021 02:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610706109; cv=none; d=google.com; s=arc-20160816; b=LAQ1Fgi/IAFgYJMQezObhcp16O1ai804zecIncmhQ7dEe7kL7eOux105j7QIwul5fy bSaB+IQovnAtM1kSxXnuSegTtNbvTEHoQJauieH5+2bSrlP8hwDe7kTSZCVjiHEO/2x/ 7qwjqAosBqOtUzCyDVHpTw3/lW9u1dA1Xaf23NyrnnkO7RmgwVUa7L+k5oEaSEgWRayg dkEVZU7XTS9/RJxG6IA4EI1xK/psyG14+R522dTfBiW/65SSmwA464d+ftCCMVeACGcC jpuFa+dGcX85hBLd2S7looHd8dQjWeHd/NYeqEaDpfypPNO29/RN2l6U4SPuhz05f3Z3 tgSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=nSp8rhE3uReHV79L7sMajdHQ/hnTpNyRkZfLWK49IrQ=; b=KS2riZmtFTKTyqXm50kllnOCh0/5IeHnEv/g2/qZ3VQoYMpdCh29tZp/x6cXTmTfuF by7Sk6B88WBVteCN0keamUnUP5jHzZC06twwt/ksDxpGavZWfh5ykwiZJDPT3r3u6XML KzTruPcBM49SYXjxL6kKVbsoflhmZV8ez9mg4HKQYqGLszPGWTCJ98O1KMJpkpMQTtu7 8+r6q8KdXmq5svABZwHJEdFtbHerjTTRrBe/GH+MaoB8kcLvqwacsrA5jF3VcAVXzXiB 1szU4sUUQvtLhJEBaY24lngHlQ2lfOr//fmyHm0LT9wCdb4/VuLtwN41yQ9Zh1ORoYmI qEKg== 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 do7si3458591ejc.585.2021.01.15.02.21.25; Fri, 15 Jan 2021 02:21:49 -0800 (PST) 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 S1726045AbhAOKSc (ORCPT + 99 others); Fri, 15 Jan 2021 05:18:32 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:57720 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbhAOKSb (ORCPT ); Fri, 15 Jan 2021 05:18:31 -0500 Received: from [192.168.1.41] ([92.131.99.25]) by mwinf5d49 with ME id GyGn240180Ys01Y03yGoD2; Fri, 15 Jan 2021 11:16:49 +0100 X-ME-Helo: [192.168.1.41] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 15 Jan 2021 11:16:49 +0100 X-ME-IP: 92.131.99.25 Subject: Re: [PATCH][next] drm/amdgpu: Add missing BOOTUP_DEFAULT to profile_name[] To: Colin Ian King , Dan Carpenter Cc: Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , David Airlie , Daniel Vetter , Xiaojian Du , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210111114638.16530-1-colin.king@canonical.com> <20210112100706.GF5083@kadam> <51efd2a7-f2cf-dc28-4b86-5e89d13564ca@canonical.com> <01121c1c-5e7c-9d47-2400-c7644f6b8254@canonical.com> From: Christophe JAILLET Message-ID: <2e688654-cbac-ea86-b248-c863a2dc6747@wanadoo.fr> Date: Fri, 15 Jan 2021 11:16:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <01121c1c-5e7c-9d47-2400-c7644f6b8254@canonical.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/01/2021 à 11:10, Colin Ian King a écrit : > On 15/01/2021 10:07, Christophe JAILLET wrote: >> Le 15/01/2021 à 10:37, Colin Ian King a écrit : >>> On 12/01/2021 10:07, Dan Carpenter wrote: >>>> On Mon, Jan 11, 2021 at 11:46:38AM +0000, Colin King wrote: >>>>> From: Colin Ian King >>>>> >>>>> A recent change added a new BOOTUP_DEFAULT power profile mode >>>>> to the PP_SMC_POWER_PROFILE enum but omitted updating the >>>>> corresponding profile_name array.  Fix this by adding in the >>>>> missing BOOTUP_DEFAULT to profile_name[]. >>>>> >>>> >>>> Still not enough to prevent the array overflow.  It needs POWERSAVE as >>>> well. >>> >>> Thanks for checking, but there is a 1-to-1 relation ship now: >>> >>> enum PP_SMC_POWER_PROFILE { >>>          PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT = 0x0, >>>          PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x1, >>>          PP_SMC_POWER_PROFILE_POWERSAVING  = 0x2, >>>          PP_SMC_POWER_PROFILE_VIDEO        = 0x3, >>>          PP_SMC_POWER_PROFILE_VR           = 0x4, >>>          PP_SMC_POWER_PROFILE_COMPUTE      = 0x5, >>>          PP_SMC_POWER_PROFILE_CUSTOM       = 0x6, >>>          PP_SMC_POWER_PROFILE_COUNT, >>> }; >>> >>> vs >>> >>>          static const char *profile_name[] = { >>>                                          "BOOTUP_DEFAULT", >>>                                          "3D_FULL_SCREEN", >>>                                          "POWER_SAVING", >> >> This line has been added yesterday in commit f727ebeb589d. >> So Dan was right when he sent his patch, but some else fixed it. > > Ah, my bad for not seeing that. :-/ However, I wonder if this commit is complete. The description of the commit is about 5 modes, but 6 are listed in PP_SMC_POWER_PROFILE. In the hunk: +static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_FULLSCREEN3D, WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO, WORKLOAD_PPLIB_VIDEO_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR, WORKLOAD_PPLIB_VR_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE, WORKLOAD_PPLIB_COMPUTE_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM, WORKLOAD_PPLIB_CUSTOM_BIT), +}; It would look logical to have something like: + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_POWERSAVING, WORKLOAD_PPLIB_POWER_SAVING_BIT), Not sure at all if correct. Just my 2c, CJ > >> >> CJ >> >>>                                          "VIDEO", >>>                                          "VR", >>>                                          "COMPUTE", >>>                                          "CUSTOM"}; >>> >>> >>> unless I'm missing something because I've not had enough coffee. >>> >>> Colin >>> >>>> >>>> regards, >>>> dan carpenter >>>> >>> >>> >> > >