Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7291563pxb; Thu, 18 Feb 2021 06:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+3Y4cDlUoXruzy3qSQeLUEhwrYMqXVMi82R1BtT7zZdLEVwhuzLLpo5cG/BQmCMklb7o6 X-Received: by 2002:a17:907:3d8f:: with SMTP id he15mr4200248ejc.238.1613658697615; Thu, 18 Feb 2021 06:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613658697; cv=none; d=google.com; s=arc-20160816; b=yDaV8+kfurXblDXFbVFYdHSrmU1od3S43vlR08JScPErHJLjsCrsTuvE9ypDA4gIAY aj+V2w6u1cUbMHYvqhGymw5HdLIUDJfbQWavje4QOFthw8G6zW98HbDk4i3wAqi+6Ss4 69u8wE8xWAg/PwmyVgfyyDDh2CsYFUm4VDWG8tue5QvM+EiHtcmDXBxD1Mc81Txv9vEn 5rLAUPGv/yyjkWJa7ecxicaISo861zn+0e8g6segeNhR0ha19l6g6ovk3BXQH/bfnc7S 1pQXhAJHn6WlSAQCwFcFUOjRDQjAD2G/GViny33QTK+lSyx2yAGx4VKpfmY2GcwgTFTS jexw== 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 :to:subject:dmarc-filter:sender:dkim-signature; bh=WEzANxiP3GHuNQy3hHp2JvLyxuMJKQC5W5/UU/dl9I4=; b=nzod4EsPr5TgRb62rf+5TbE9wGAXXmwljdJyItYfP9ZVDOJWbUhfmea+tIC6mOMctr Y1h9lzC7VlNyZD2aVSda2d8Fc9hgSd1L99NUhyjZYSkrvFZlhy56uIDxQMbyltdbCddq o3VeYTZ00zcF8bC2fvdumBehQrZJhtzZKoh273Q1lIchRKI7xUJKIbYFHv0qsmPIlw7x C5l/MOQKb0PyhUEfb+3sZo7ETpAUmYpI0UXCN1oBl4gexKAThHVmaCkYIsQukX8A81OC 0V1Z2SGslUIw/LzGlxiihtreKzvW3x/HJdzV+ORRf9AsTzfbq13y0OO3fbUl2Ckm/HbM dUtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=DJopMOc6; 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 f20si3575743ejk.711.2021.02.18.06.31.12; Thu, 18 Feb 2021 06:31:37 -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=@mg.codeaurora.org header.s=smtp header.b=DJopMOc6; 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 S232084AbhBRO3B (ORCPT + 99 others); Thu, 18 Feb 2021 09:29:01 -0500 Received: from z11.mailgun.us ([104.130.96.11]:28746 "EHLO z11.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbhBRMaI (ORCPT ); Thu, 18 Feb 2021 07:30:08 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1613651359; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: To: Subject: Sender; bh=WEzANxiP3GHuNQy3hHp2JvLyxuMJKQC5W5/UU/dl9I4=; b=DJopMOc61YDOP/u+EUrNOdYJdhs6dIBmcGtHvMTXZ0LII51H9yQ2B3PE0h2qfcTff1m4abjW PPsQugxwa99g3mZ0eWvdGYAJyq4HGXJiU5i1c0WqtYR9uFgNoaQA5/3i2LLvPZGVaOEOksr6 Qe+lJ4AbYA4vuY9fhxoyrzS3zI8= X-Mailgun-Sending-Ip: 104.130.96.11 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 602e5d821e797edad8628fdf (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 18 Feb 2021 12:28:50 GMT Sender: akhilpo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D3187C43467; Thu, 18 Feb 2021 12:28:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.105] (unknown [117.217.236.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 03C19C433C6; Thu, 18 Feb 2021 12:28:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 03C19C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akhilpo@codeaurora.org Subject: Re: [PATCH] drm/msm/a6xx: fix for kernels without CONFIG_NVMEM To: Jonathan Marek , Rob Clark , 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 References: <20210216200909.19039-1-jonathan@marek.ca> <775436ba-c94a-ab22-d65b-b2391047ec65@codeaurora.org> <20210217190820.GA2229@jcrouse1-lnx.qualcomm.com> <74d1277e-295f-0996-91c3-05cfce8d3a0e@marek.ca> From: Akhil P Oommen Message-ID: Date: Thu, 18 Feb 2021 17:58:42 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <74d1277e-295f-0996-91c3-05cfce8d3a0e@marek.ca> 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 On 2/18/2021 2:05 AM, Jonathan Marek wrote: > On 2/17/21 3:18 PM, Rob Clark wrote: >> 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) Atleast on sc7180's gpu, using an unsupported FMAX breaks gmu. It won't be very obvious what went wrong when this happens! -Akhil. >> 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 ;-) >> > > There is a "imply" kconfig option which solves exactly this problem. > (you would "imply NVMEM" instead of "select NVMEM". then it would be > possible to disable NVMEM but it would get enabled by default) > >> BR, >> -R >> > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel