From patchwork Tue Mar 30 01:34:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 411674 Delivered-To: patches@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4069615jai; Mon, 29 Mar 2021 18:34:15 -0700 (PDT) X-Received: by 2002:a17:902:d895:b029:e6:f007:5bc with SMTP id b21-20020a170902d895b02900e6f00705bcmr31154037plz.76.1617068054884; Mon, 29 Mar 2021 18:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617068054; cv=none; d=google.com; s=arc-20160816; b=XGZHztwEuFtvG9KnYiolCskcTcGXVe8UtK6inlS4cRTwpFKnefhhQaJTp9bKVqefoN 2k8L4TafHc5Xq5QMt3NIW4/lTglD3vCh4ehNUYRV/2ile2msbbSelImdtKNT/ggp1WNO g+b8hUlYYyUTebZMj8DOHhMSh1GNSj74tAhNahPyGad+RUIDzZEJ+/TErEe7nKBsuasy gYOUbKsRPjJ9MsdOBIeZfvOHePlxyk/z3HH71zwjRj711eizVtpoUO9PeUoBVFsmJvH7 mZ9pVYkc+fgrjIcFxW/K5AinlYUZYScx2V9VsDDV1K6bjTtKZZ+YnLb99rUo3cAAD6FN FwVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=8A8If7oybmQFoEyCFbbgw0aizc2xKMTrL9mIp4UPDLA=; b=M4FPJwb8IiSj+EP0SbhmLJ4q2RXFdJVaTcTtrkmIOFLIaDTVEbrcHhEHqTJ5nZAiaL o6JDbBR7EViyTbjpPpiWsOxG5x4pxzGmdztwpETyaqLB52osayOjAlqI3gBYDIHPqYd4 6+iCRAUlNW9RneQOJbYGEtj/Xhea4PPViF3iiuC14G2oqALVPR8LzoVIFMZg1s01A0Dx bwOc/HH4DVChgOYm3IL+mjRSr2lGkSxKbBorMjcFRZuD09s2K9YnsSj3wdvzxCUGjQPq GzFYJzpoX6FbeG/DbyAmKpmsySsZsueUgRFAzCsVd7Bvzh7nn1sXeLEtYYX24PTb7WfK 0IAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jitl4f2X; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id n65sor577327pji.42.2021.03.29.18.34.14 for (Google Transport Security); Mon, 29 Mar 2021 18:34:14 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jitl4f2X; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8A8If7oybmQFoEyCFbbgw0aizc2xKMTrL9mIp4UPDLA=; b=jitl4f2XQUctjdUPCCbZajr3dY4HcAUyftf12BZnk9gT+ExyOyrfn1aeoQJ97WZv0F OziPeisSf7nfUL7Vir9BOCH2pJ0XxVwB1H8xsIXQFZDnO6OkQaoxXASHwwKGvO2wAjMm FPgUiUBYn8zXhTWWhrZ1y2FlZIk7LUO6kXJ4vzAp+pxcg48qeGgblFHxoorxNK5OTqDa Ar76TxInftkgSBm46CJTsBm13wEPwKxMK42wjPYLc84bsm3TsVTGaSD88tANdPWVNzT/ 34zNyPZ5NkE8fqvKkZ/LalogOaGJB456iDWehYkIyhzq495DhRaEeJd5KxIRH928s9LT Cyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8A8If7oybmQFoEyCFbbgw0aizc2xKMTrL9mIp4UPDLA=; b=tLmRuevnb4zpCGfq7xBZ4+xm0IZfKsmcA/cv1QoBoW1MgS9vR4nGBRQOTr7XFFknyn XCBK5GiOzwQIhSDxVOXe1NALmdZW+K6dha4f+onzsm+vjEazJTI44ph4Y55n+sOpR3ec TjOZt8BvY3KnZw6czP0t/zKBC0A2Sp9nTyz+ZkXtJKpLSo+yLSL3gHwrJeRIDeLw+z90 co3RS0F1bbFNlRU4umy5yB3dK0kRPZB1lyKyOC7F7r/xDFs51a7z2lgarMYTpQGww6vX HZZxC8FyJX+qMel1y0KjDY4FjkKV3I3J4aBPbfzN9VxXEyQNRTFUG5aEScq9O7lsO6EN NEDw== X-Gm-Message-State: AOAM533y6d0+XtWxREGUgc/O/7FFIu5VvPVV3aJVkDRGmuLbEdOjBuns bEf7Qn99lhL+alIjJrHHJrklBkgu X-Google-Smtp-Source: ABdhPJzYWn5sEsuZHqydzJcwoR+ebQ0R+EoGQlVFKwWjvoaLyMtIay73TxhsG1977KSK5uO/wF6Mig== X-Received: by 2002:a17:90a:a603:: with SMTP id c3mr1821365pjq.107.1617068054533; Mon, 29 Mar 2021 18:34:14 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id k27sm16752258pfg.95.2021.03.29.18.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 18:34:13 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rob Clark , Sean Paul , Jordan Crouse , Eric Anholt , Douglas Anderson , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Bjorn Andersson , YongQin Liu Subject: [PATCH] drm/msm: Fix removal of valid error case when checking speed_bin Date: Tue, 30 Mar 2021 01:34:08 +0000 Message-Id: <20210330013408.2532048-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Commit 7bf168c8fe8c ("drm/msm: Fix speed-bin support not to access outside valid memory"), reworked the nvmem reading of "speed_bin", but in doing so dropped handling of the -ENOENT case which was previously documented as "fine". That change resulted in the db845c board display to fail to start, with the following error: adreno 5000000.gpu: [drm:a6xx_gpu_init] *ERROR* failed to read speed-bin (-2). Some OPPs may not be supported by hardware Thus, this patch simply re-adds the ENOENT handling so the lack of the speed_bin entry isn't fatal for display, and gets things working on db845c. Cc: Rob Clark Cc: Sean Paul Cc: Jordan Crouse Cc: Eric Anholt Cc: Douglas Anderson Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: Bjorn Andersson Cc: YongQin Liu Reported-by: YongQin Liu Fixes: 7bf168c8fe8c ("drm/msm: Fix speed-bin support not to access outside valid memory") Signed-off-by: John Stultz --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 690409ca8a186..cb2df8736ca85 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1406,7 +1406,13 @@ static int a6xx_set_supported_hw(struct device *dev, struct a6xx_gpu *a6xx_gpu, int ret; ret = nvmem_cell_read_u16(dev, "speed_bin", &speedbin); - if (ret) { + /* + * -ENOENT means that the platform doesn't support speedbin which is + * fine + */ + if (ret == -ENOENT) { + return 0; + } else if (ret) { DRM_DEV_ERROR(dev, "failed to read speed-bin (%d). Some OPPs may not be supported by hardware", ret);