Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6785445pxb; Wed, 17 Feb 2021 13:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJx99/I7b5cWcJWdGMt6mnAntUGQ9TnnN2+V5Sqzq50URxVWqoEPXkhz2aHQt5/reYVyD0HU X-Received: by 2002:a17:906:1f85:: with SMTP id t5mr918711ejr.530.1613597162399; Wed, 17 Feb 2021 13:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613597162; cv=none; d=google.com; s=arc-20160816; b=mluYCF7Sql+lC+uUejTZ3/nLVe1tbtc9gueDTUghfxneIhxSWwDBm2FijD5dh7hA9O fiOL+abizZa1dXYPDxMT1LXzUGgUSMfOcduriFKAzy/qQHUE3CfRYqF0Rae3iMnGbagE xkDxNMfW/nG9Q/MNltrl8FBoIGw8xfNnP+655MXoF3eAiKmkWLQ/CC5cuy+5jYkquwXH extr7EGEVWkwRxtMyft9bXmgkNjrW43Dei95TxEtksU9Do3mz9ogFJP0dspRF5zdOS4s 8Lm7db3PVFkCcwTieqfv3MDtER34y+fkegCYN0JmSDvhcOfINFhuvNWlMHaJxGwFmAzq oyEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/SfDLUSdiw9Q0zmXjgq53DuIhtEZQNoVI4O6RzhHV5s=; b=y3i/LwGc1dzczZk3xTxYnJM2RpDo8tmXuOywg7MUb1lmSplUakP53npBRYUMWZk3S+ 24lf8MPxQKsm2dU6lZZx9izrbO95CQioMkhGQtH9BQyGCeJkZT63/4n3rj+AH0wJR4nW 1VHmlJ52qVR3JOKaWXmzzqeG9609rA5NcOuKbtRGZfAPPIC3x6ot0zeGf68W11VSSLTA vZn9/g8L1SiRDJUe4z8279LjEeRocsdnKjH63oENPZPUAiv4ypmtzsHgGz1lj0wTcVcG StVaB2FUZm/d04b00480wIIuuoFgjg9yVoy6oDQQMew9xd9a4e6seK6cQCZ3V5u/0NiA hR3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RL1PZzFJ; 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 cz4si987957edb.543.2021.02.17.13.25.38; Wed, 17 Feb 2021 13:26:02 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RL1PZzFJ; 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 S233900AbhBQUP5 (ORCPT + 99 others); Wed, 17 Feb 2021 15:15:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233561AbhBQUP4 (ORCPT ); Wed, 17 Feb 2021 15:15:56 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A718BC061574; Wed, 17 Feb 2021 12:15:15 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id l12so18753793wry.2; Wed, 17 Feb 2021 12:15:15 -0800 (PST) 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; bh=/SfDLUSdiw9Q0zmXjgq53DuIhtEZQNoVI4O6RzhHV5s=; b=RL1PZzFJ8Zfu/C4DugYCVVvJS/urwTb+nyGS57REvMlnC8ygsGGEPLIz/CuZmxVs9h 1rkXlPTFYfa1sVHKWXhM2IMyvXzX0rdAzR3HaB1jXAW88P04jqjJq1nJtk8L1O+fIuMU 01AdzJGMnJTaCW78pDhbWXDVAg14icUpLEukHf8m1FZ94SEYKyN2skCTSwAHWcwWWbRl gy2zAEk0VqEj8hjp20jS3NK0fD3/zv35CS/oJpjLg+8mWUfMNKQCg8PRtBX+zp5mvUyG ImPNQnUXJLRwjlz9Hhhrcj7H0PpBHjm4IK/dwdCM2X7Q/4+4X95hmNWsWvVrxK8c0niF sumQ== 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; bh=/SfDLUSdiw9Q0zmXjgq53DuIhtEZQNoVI4O6RzhHV5s=; b=nw3T7o3JLxGzuJrg4IGp7+TkR4Muv9a6M79SUXq16m5cCq7hdnbzpVGp1+jVzFuSYu dEaz7WdSJ0Zo3P88qrN++dWR+ymuaGdW9ziOtdfbqHnWwyp9sat22DPSC2QNoUCZ1EHm uTPe2CVvim8wTLPXs3un4D6CYCs4rn821FYZtvyTYdbzTMqAJoZG08EsuuhWtXLBtvh9 1RhB/wQjHPsD7o+iUawGafhojiq9WinmNHnVuqLghdI+AQ1Mov271E5Z29f+dCdpiGLW jOcRLiK0W3pqE/LdZZYeOmQnywLl2A+SpaoMPFCuFbydPCl6z8LgRvF09LFc3QD6sLY1 pYxQ== X-Gm-Message-State: AOAM533c0PPoIaZY7m/c0n05wjVtJHofrEmOrbmAGzV/5x6dRwgQMBBD HqYimIvxqa4wva/Sa2OYcTM19MTRECHWGXD+D5Q7sEnwS+0= X-Received: by 2002:a5d:4ecf:: with SMTP id s15mr902647wrv.132.1613592914278; Wed, 17 Feb 2021 12:15:14 -0800 (PST) MIME-Version: 1.0 References: <20210216200909.19039-1-jonathan@marek.ca> <775436ba-c94a-ab22-d65b-b2391047ec65@codeaurora.org> <20210217190820.GA2229@jcrouse1-lnx.qualcomm.com> In-Reply-To: <20210217190820.GA2229@jcrouse1-lnx.qualcomm.com> From: Rob Clark Date: Wed, 17 Feb 2021 12:18:07 -0800 Message-ID: Subject: Re: [PATCH] drm/msm/a6xx: fix for kernels without CONFIG_NVMEM To: Akhil P Oommen , Rob Clark , Jonathan Marek , freedreno , Sean Paul , David Airlie , Daniel Vetter , Sai Prakash Ranjan , Eric Anholt , Sharat Masetty , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 17, 2021 at 11:08 AM Jordan Crouse wrote: > > On Wed, Feb 17, 2021 at 07:14:16PM +0530, Akhil P Oommen wrote: > > On 2/17/2021 8:36 AM, Rob Clark wrote: > > >On Tue, Feb 16, 2021 at 12:10 PM Jonathan Marek wrote: > > >> > > >>Ignore nvmem_cell_get() EOPNOTSUPP error in the same way as a ENOENT error, > > >>to fix the case where the kernel was compiled without CONFIG_NVMEM. > > >> > > >>Fixes: fe7952c629da ("drm/msm: Add speed-bin support to a618 gpu") > > >>Signed-off-by: Jonathan Marek > > >>--- > > >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 6 +++--- > > >> 1 file changed, 3 insertions(+), 3 deletions(-) > > >> > > >>diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>index ba8e9d3cf0fe..7fe5d97606aa 100644 > > >>--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>@@ -1356,10 +1356,10 @@ static int a6xx_set_supported_hw(struct device *dev, struct a6xx_gpu *a6xx_gpu, > > >> > > >> cell = nvmem_cell_get(dev, "speed_bin"); > > >> /* > > >>- * -ENOENT means that the platform doesn't support speedbin which is > > >>- * fine > > >>+ * -ENOENT means no speed bin in device tree, > > >>+ * -EOPNOTSUPP means kernel was built without CONFIG_NVMEM > > > > > >very minor nit, it would be nice to at least preserve the gist of the > > >"which is fine" (ie. some variation of "this is an optional thing and > > >things won't catch fire without it" ;-)) > > > > > >(which is, I believe, is true, hopefully Akhil could confirm.. if not > > >we should have a harder dependency on CONFIG_NVMEM..) > > IIRC, if the gpu opp table in the DT uses the 'opp-supported-hw' property, > > we will see some error during boot up if we don't call > > dev_pm_opp_set_supported_hw(). So calling "nvmem_cell_get(dev, "speed_bin")" > > is a way to test this. > > > > If there is no other harm, we can put a hard dependency on CONFIG_NVMEM. > > I'm not sure if we want to go this far given the squishiness about module > dependencies. As far as I know we are the only driver that uses this seriously > on QCOM SoCs and this is only needed for certain targets. I don't know if we > want to force every target to build NVMEM and QFPROM on our behalf. But maybe > I'm just saying that because Kconfig dependencies tend to break my brain (and > then Arnd has to send a patch to fix it). > Hmm, good point.. looks like CONFIG_NVMEM itself doesn't have any other dependencies, so I suppose it wouldn't be the end of the world to select that.. but I guess we don't want to require QFPROM I guess at the end of the day, what is the failure mode if you have a speed-bin device, but your kernel config misses QFPROM (and possibly NVMEM)? If the result is just not having the highest clk rate(s) available, that isn't the end of the world. But if it makes things not-work, that is sub-optimal. Generally, especially on ARM, kconfig seems to be way harder than it should be to build a kernel that works, if we could somehow not add to that problem (for both people with a6xx and older gens) that would be nice ;-) BR, -R