From patchwork Wed Aug 18 17:13:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 498913 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp866651jab; Wed, 18 Aug 2021 10:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd45s5cXkPr7JU+vow9J1BWwHeAc0M5K0XP1eiUJ23VGtkSQqZWj36j2uDoK76FCp3oEsn X-Received: by 2002:a17:90a:3186:: with SMTP id j6mr10232748pjb.220.1629306809225; Wed, 18 Aug 2021 10:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629306809; cv=none; d=google.com; s=arc-20160816; b=MSHPUty0tac7E6prjSYc0EXmxs8JzkTtgEws3B+BqJNE736MprubY1D7+bgGPAxCEw GC/TobBajqYj72l1/wvKihrYIoz8xr1u/8D214jLYCnx6utZ0S3vocnV0CvBkwodOHTW ilADMiaV2orL9Zp3D26Agt0wjdYtVu9eXyJlgh93M+FyuBDwa6wNppP769AhhnBh3Jeg 4zr1Frr30ARjz+rfiWoDz5xsM6F39hllYwU/S9IjU+PKOwccq8fDEndOzsoCXPjvG9A6 FoAeEKrrv2z5Lx2pm9wvy5aPONydhYsXM1Y/+LWfGufGaDs4n5zEKow+L098Naej+s3O 0/WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :delivered-to; bh=oFid9F2eF9PqNhKCggNJ7cYgvwbKXWCYKt0nUIUymOs=; b=a3HwDk+OnMKifFiGFRmZ2DZWiJozd7vPbyEGGkykDn8YDx0erWl8YlXHdm8rOufRnB lzNHuFxfhHnCZWWZDa4g+IvMlv5GYqsq9R3QITvo8i281rxHjOOiH0XrfFUPtr4RflsG cWyyxj2nlm7j3QJSY7wvww29izeGqEqr+6eMWZ+WXvSXwUuzhs8QLU8YQ7ud/hjihKfr vHaYSrPZ/sVLdygfm5lrqYy4/GHdsjUhdFEDGUKgVimIbL7yrwkFSGEclaoYZGVXuHB3 FLeN15l/f7kSmB771IUu23t7MCf7Lu+iqPBDowzWPzWTtkUn91rctOYir3u8RlqXr1nV WeZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GsvHQgpj; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id r17si421174pld.291.2021.08.18.10.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GsvHQgpj; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C2EC6E873; Wed, 18 Aug 2021 17:13:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 68F416E873 for ; Wed, 18 Aug 2021 17:13:26 +0000 (UTC) Received: by mail-wr1-x42d.google.com with SMTP id z9so4595228wrh.10 for ; Wed, 18 Aug 2021 10:13:26 -0700 (PDT) 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=oFid9F2eF9PqNhKCggNJ7cYgvwbKXWCYKt0nUIUymOs=; b=GsvHQgpjaESYG5gtGcBAchUblwDnGBfCRa1Cbq88bnebOKDVZfNI47a7t8YHzfwXR0 Wg6/E8zJEbHXHlBrKwmkoHSuKaof9B2CRhFCK0Y6FxL52+93tX0E0kCuVKSzTQXsOx3L VADza4/83gBW+6u12EezFkqO52Ms5vQWwwdrsPKMbb/Tdaj06pMLwUOcdpk/CSEHMVR0 96PJ7L8+C3Knj82Xe7M4sVheHmHPjLn9tKND+G+STUu5ldE+650SpMm1t8HVAq/2MsKj Cxg1CUB4JG4OQwd6DzbvOosCxQAHzhuGKveOvF1noiFegFOaRoci9wlJDEgkZ000qc8A 91KA== 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=oFid9F2eF9PqNhKCggNJ7cYgvwbKXWCYKt0nUIUymOs=; b=P7RyHp25xJwcU36XAGlqrnAUOp77vsdf+lv4QHvDbO7PXvQq1W3SNwjCsqHfrEIShE QJ78gaoFf30uBfDcABbXPmPOcAPgiuQXjiYsAlYnDJUqbvOMN3fVJ4Yi9LJvTjT4OpLa A7e4dOWE3Frj8Vkx16FgYaliFq/BmVAzZ3zzmG+Y+CVsk+RWoQ3R0wZDnAgPslq7VsAX upWv/561mo2Ns+pe6Th20L3hTEtgwQYECp2c+ix5RIu7FPuvgG48oD9Z76Je2royhfgQ eAAHF+mp0HB/oKJ6xThh/o6EbjrXox2M0crl3FbMwA5YFvm+AZ3lj6bmlxRE41aXki1W ttpA== X-Gm-Message-State: AOAM530E1WR3NN3HVrP/qEPs1ZgtY7Cx15+i9px87yoQwE6WCY9SrY4F 5pZyLrHXI8gWHlrMMjfOeK4ypg== X-Received: by 2002:a5d:67c6:: with SMTP id n6mr12007908wrw.150.1629306805112; Wed, 18 Aug 2021 10:13:25 -0700 (PDT) Received: from xps7590.fritz.box ([2a02:2454:3e5:b700:a470:eb9f:53a5:20f8]) by smtp.gmail.com with ESMTPSA id p3sm414825wrr.21.2021.08.18.10.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:24 -0700 (PDT) From: Robert Foss To: a.hajda@samsung.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, xji@analogixsemi.com, pihsun@chromium.org, tzungbi@google.com, sam@ravnborg.org, hsinyi@chromium.org, drinkcat@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kernel test robot Subject: [PATCH v2 1/2] drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux() Date: Wed, 18 Aug 2021 19:13:17 +0200 Message-Id: <20210818171318.1848272-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The return value of sp_tx_rst_aux() is not propagated, which means both compiler warnings and potential errors not being handled. Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP") Reported-by: kernel test robot Signed-off-by: Robert Foss --- Changes since v1: - Instead of discarding the error, propagate it until it is handled properly drivers/gpu/drm/bridge/analogix/anx7625.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.30.2 Reviewed-by: Sam Ravnborg diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 14d73fb1dd15b..ea414cd349b5c 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -720,7 +720,7 @@ static int edid_read(struct anx7625_data *ctx, ret = sp_tx_aux_rd(ctx, 0xf1); if (ret) { - sp_tx_rst_aux(ctx); + ret = sp_tx_rst_aux(ctx); DRM_DEV_DEBUG_DRIVER(dev, "edid read fail, reset!\n"); } else { ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, @@ -735,7 +735,7 @@ static int edid_read(struct anx7625_data *ctx, if (cnt > EDID_TRY_CNT) return -EIO; - return 0; + return ret; } static int segments_edid_read(struct anx7625_data *ctx, @@ -785,7 +785,7 @@ static int segments_edid_read(struct anx7625_data *ctx, if (cnt > EDID_TRY_CNT) return -EIO; - return 0; + return ret; } static int sp_tx_edid_read(struct anx7625_data *ctx, @@ -887,7 +887,11 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, } /* Reset aux channel */ - sp_tx_rst_aux(ctx); + ret = sp_tx_rst_aux(ctx); + if (ret < 0) { + DRM_DEV_ERROR(dev, "Failed to reset aux channel!\n"); + return ret; + } return (blocks_num + 1); } From patchwork Wed Aug 18 17:13:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 498914 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp866716jab; Wed, 18 Aug 2021 10:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5F6T5Ip4j408SXC4yqVRsEHJ0UZ2V0oBQeVp54AJYDAeuVwvfdcxMk0dzhFViE4Ub2GbL X-Received: by 2002:a17:902:8606:b029:12c:2625:76cf with SMTP id f6-20020a1709028606b029012c262576cfmr8184590plo.17.1629306813868; Wed, 18 Aug 2021 10:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629306813; cv=none; d=google.com; s=arc-20160816; b=s6yGqP1R+bKkKAyW//ExuUfzE/0lUUjF4LfO/mHRHPrRvb3CZWGdvAJfepGm+7jzhr hMsUhE1C4dBb4mDbyGSQSDCBiJvYMooIWJRiZRmAETi1cQdv5dvuKLJnaue3oXEhhRMz /ZZY2/QvVWJMMPUNqO5RFXOJ3CedWtcSsvAYvlb2gBtepKoDA56Mtw25NKwMtdvDC+71 mll143KxbJUbibzUB3u/8jryrwJz3xPeDIx+xHMJio4fITVdQ8NK2sgYsD7sNnkCUQX3 gqpI34jhIHzHmBm6o1Q6NEFcO+RG/3DFdTsMB74c/UyYWlir64g2hpBjFlIAzAu6Gmvt z2HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=IaRyyULUugVp5yFwqWYagJQnO8Y3VTVs4NQVgDsWA90zVYXRjCRoYhIEWjFbkfHvjD IZ+jLJvVw/Vi4D5fvrMMA9gmza1AfvZLum9yjKAxI8YCJVlhvaPymBMlU3eGXMwCn9ha pHek4Tw4sSQADvk8aSY63CTeSBumNkmqW3OT7yZdQBRzUIWv2ycGet+jpGMPOx8CdQoJ BmHdj0RIbC2/6Ud/o7ZmYQMR54WCnN9Yg5K4tPlPmkakAclpbBshrLXEvjDgnCAjXMQz JA4qZ819VUcjsQBDbwgasjliXJvNKvNCPBPilZ/qLmuKEy701EKeyRrexMAMrot1RVdC ifYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PIOS5lfV; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id h7si442784pls.86.2021.08.18.10.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PIOS5lfV; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 992AF6E876; Wed, 18 Aug 2021 17:13:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05C5A6E873 for ; Wed, 18 Aug 2021 17:13:27 +0000 (UTC) Received: by mail-wr1-x433.google.com with SMTP id q10so4659967wro.2 for ; Wed, 18 Aug 2021 10:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=PIOS5lfVqZQr2EIMeZA5ubQx6UB/nEqDdg+/fw3aomNSZcT13tMnYoz+UIqXBDb6hq LbjTjXYx9ei9CZ8QrgFcEPWwOCqQ3XtbtRBUdQippNZGFaTaiaKYECYt17KNOPsa68+S gxHxVI4lvJ95gY382yCB32K4aidQiVFAiYsbXsMajVYG23sN7gBFlTqgd8jhGyOUdLOr hi2R8zoeWiTFrxtNgMcs6x9eatE2RgySYXH58fGdKep1g1vJ00d6l9dXimjCNfFD2uWz h0CUUdmtIUsahSWQhSAUJmuB/Wq7GsujSUEYNvkCLzJgCTvTQgOxVrfxPQTx4RUvmMim kM9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=PvzyhMQchYfwe65w70P0hQJ9C0SUDSCAbJKFLA6X4KDfJv8YWHue2WWUO/1hBRnFHv n5N6yuSl7GVx1b0vU/vYHJJIA9hGgwURvxfh/r7+TtP6ozzD9NasWuSmxSJXqvbxy1q/ wXDl2EvD1qIv2rUg4Dz6jBWUf+MTmMHxjx2cMAsb+63WjHoWUJb+qts/rPgHolzU2Fvz GLd9LaS3maDDjtb4XloQ3jc40wTfjV16ArcSYTEyqQV/QPAKSZbd9opxw3yDY6LKTYs8 Cddu1SHDktyVOCDM4R1EZ6mzP4HyciIYHshy/Yeu98IC9yXMZaiXjoFZ9rt9dKlq+X3x J11A== X-Gm-Message-State: AOAM533OSjP+JGSg1y8PoiEVfRK5bxf3XIJURlgiXcBTfaP2tTodOe/n OSVXyQ+b0UvN5ad6lgdSTf93YQ== X-Received: by 2002:a5d:620d:: with SMTP id y13mr11854422wru.45.1629306806404; Wed, 18 Aug 2021 10:13:26 -0700 (PDT) Received: from xps7590.fritz.box ([2a02:2454:3e5:b700:a470:eb9f:53a5:20f8]) by smtp.gmail.com with ESMTPSA id p3sm414825wrr.21.2021.08.18.10.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:25 -0700 (PDT) From: Robert Foss To: a.hajda@samsung.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, xji@analogixsemi.com, pihsun@chromium.org, tzungbi@google.com, sam@ravnborg.org, hsinyi@chromium.org, drinkcat@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/bridge: anx7625: Propagate errors from sp_tx_edid_read() Date: Wed, 18 Aug 2021 19:13:18 +0200 Message-Id: <20210818171318.1848272-2-robert.foss@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818171318.1848272-1-robert.foss@linaro.org> References: <20210818171318.1848272-1-robert.foss@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" During the sp_tx_edid_read() call the return value of sp_tx_edid_read() is ignored, which could cause potential errors to go unhandled. All errors which are returned by sp_tx_edid_read() are handled in anx7625_get_edid(). Signed-off-by: Robert Foss --- drivers/gpu/drm/bridge/analogix/anx7625.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.30.2 Reviewed-by: Sam Ravnborg diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index ea414cd349b5c..abc8db77bfd36 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -845,8 +845,11 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, if (g_edid_break == 1) break; - segments_edid_read(ctx, count / 2, - pblock_buf, offset); + ret = segments_edid_read(ctx, count / 2, + pblock_buf, offset); + if (ret < 0) + return ret; + memcpy(&pedid_blocks_buf[edid_pos], pblock_buf, MAX_DPCD_BUFFER_SIZE); @@ -863,8 +866,11 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, if (g_edid_break == 1) break; - segments_edid_read(ctx, count / 2, - pblock_buf, offset); + ret = segments_edid_read(ctx, count / 2, + pblock_buf, offset); + if (ret < 0) + return ret; + memcpy(&pedid_blocks_buf[edid_pos], pblock_buf, MAX_DPCD_BUFFER_SIZE);