lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Feb 2021 12:08:20 -0700
From:   Jordan Crouse <jcrouse@...eaurora.org>
To:     Akhil P Oommen <akhilpo@...eaurora.org>
Cc:     Rob Clark <robdclark@...il.com>,
        Jonathan Marek <jonathan@...ek.ca>,
        freedreno <freedreno@...ts.freedesktop.org>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>,
        Eric Anholt <eric@...olt.net>,
        Sharat Masetty <smasetty@...eaurora.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <linux-arm-msm@...r.kernel.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <dri-devel@...ts.freedesktop.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/msm/a6xx: fix for kernels without CONFIG_NVMEM

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 <jonathan@...ek.ca> 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 <jonathan@...ek.ca>
> >>---
> >>  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).

Jordan

> -Akhil.
> >
> >BR,
> >-R
> >
> >>          */
> >>-       if (PTR_ERR(cell) == -ENOENT)
> >>+       if (PTR_ERR(cell) == -ENOENT || PTR_ERR(cell) == -EOPNOTSUPP)
> >>                 return 0;
> >>         else if (IS_ERR(cell)) {
> >>                 DRM_DEV_ERROR(dev,
> >>--
> >>2.26.1
> >>
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ