Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp749413rwd; Wed, 31 May 2023 05:05:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qifKcjBlpoyLvYZC5jvvECMLbRbmxD3FPsoZBzqby3AGi4Y9QZoNROpQcq+KLCcWe1Wus X-Received: by 2002:a17:90a:fc89:b0:256:807d:c396 with SMTP id ci9-20020a17090afc8900b00256807dc396mr5257005pjb.45.1685534720785; Wed, 31 May 2023 05:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685534720; cv=none; d=google.com; s=arc-20160816; b=tHoxdHOv6ikeRyHMNzTIz01/Svn9CeP4voHfdONqbQ1EP0U4AO/qTbL5s57rzgRDMp 5YGz7l8L0fFgjsyL7pGKkbzTgmcny6FxO97Y6Yb4TSFHgPeqnfA97B5zdbU1Llw02ter CElpbDwwzOXifIxaamHxMqY5aZV/DJgOqoZCKRykNTUQetDkXPt3ixtjKrdJ05mWt95D u5o2wO9rkuik/0KNK65PgsMeHjs2HGyCCd+Htd5a47JPh8LIJPGnBtiBmZdgx0R0MUOZ MvbTjyGe3IFYztevlZvTl5D0fiPyD/G0v5f8vY0msYab3EpjGsnSMIOdGi6JtAGDLr9D 5cwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:content-language:references:cc:to:subject:reply-to :from:user-agent:mime-version:date:message-id:dkim-signature; bh=WEd36hy3ThKcCMH7ZROUO7i+4T8Tnu5cbXYxxpHoTZ4=; b=uTr8iOvwjpZkPr4jCcTCD+ys6afDQURyBMjWh34R7XcY1gVmX+UFi2ZWyh+uGB6UZP kB+wVsgvuthx0dfigA2c5sWgEyzbvXCkm8941pybES3v4/OCmktlXdqp9oPCVvk0oQs3 LYN1FHy+vAybibl85gGmWQ1IE1G3i75nuNgPd+Fo4abEQR9difHpl9CR9LxgbYJx4l+D KbtFJ4Cx3bHiCYmOC2Y0TmI9SvVaS1XLIAKC8Ziu3FJgacSizA1K4Fr98zKuKMY3BYod jrO3e8Qrdka2xofyygV/ccgjsAAZ6dYqCQdL9i5NPWlO1tPll1jz+jqZkh6NChG+tWyi +18g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HjcxddE0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iz17-20020a170902ef9100b001a6f0e81ec7si772052plb.237.2023.05.31.05.05.03; Wed, 31 May 2023 05:05:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HjcxddE0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235521AbjEaLzy (ORCPT + 99 others); Wed, 31 May 2023 07:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232702AbjEaLzx (ORCPT ); Wed, 31 May 2023 07:55:53 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9556E9D for ; Wed, 31 May 2023 04:55:51 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-309382efe13so4207221f8f.2 for ; Wed, 31 May 2023 04:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685534150; x=1688126150; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=WEd36hy3ThKcCMH7ZROUO7i+4T8Tnu5cbXYxxpHoTZ4=; b=HjcxddE0x6MCnxfyBMOC8XOYj6XdEjqr/ESEz9M5yOwpl4YJnPdYHvvV1iqIf3v21E O9ewxMjGP7NGtBImWjcISEUrHrio3Df39lB+Cqnmtp5B79ddpZXtXaD5GlsqmArbUBlD cCRJk8hnW+Le5/VATO8eqvi8km/jw3x43GUGivLxu8ziY5DzV3pJBce7bZnv4+U9U/7/ JrB56aFQdMRyP18ac2OjG/VKp1d6mGkc9dA3KW7fRBDyxRQIiMv4M7Mlt8tN5YJqWlFE Cgnd7NG5SIlBkYR23/fdurP7Y+irjhmM9aDCnSNeP6JSEef+q4nLMap55fEYOeeTsbGM 6QCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685534150; x=1688126150; h=content-transfer-encoding:in-reply-to:organization:content-language :references:cc:to:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WEd36hy3ThKcCMH7ZROUO7i+4T8Tnu5cbXYxxpHoTZ4=; b=gg2ZN5RgyXWhX6cRwkzpqOCk0SGV/xtJmgjzfzaStMH9doGMAW4lDcCDp9sOl9zNPy NdIDeWAEZEsbBa6qiYaXJXB11VyVFIWw5HGI16zPpgQgzSmKgM79duV365itSpp+Uu2E wul2vgsFwyjCDnqee2n6tNUhUAf9ms37Y09gHG/ONMQAMjLCteZ6R4tAYG6JAqz6HRZd KNtf/XbIrPFO98vgj/ot+OnJQq/kOTPQqc0cvBeUVq9I3pgvrSI+/IWUQWmrFHYoGpbP OEBaUVHVp9lLLQ75wB5oK/qyzB035Qumg3Y08xd16Hy0tu1DvRkpdWbfPl0uXYevLhFX mzFA== X-Gm-Message-State: AC+VfDyxDhQv5cCQkNX/Im9c1xvR0WFMwYeGGj8wBqmydRKn5EaZcefx VlMDM5GKSIKwvBXrzhCp7vqWyQ== X-Received: by 2002:a5d:448b:0:b0:306:3e96:6c5f with SMTP id j11-20020a5d448b000000b003063e966c5fmr4104805wrq.15.1685534149989; Wed, 31 May 2023 04:55:49 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:5c28:3ad5:fcda:7779? ([2a01:e0a:982:cbb0:5c28:3ad5:fcda:7779]) by smtp.gmail.com with ESMTPSA id i14-20020a5d558e000000b0030903371ef9sm6562204wrv.22.2023.05.31.04.55.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 May 2023 04:55:49 -0700 (PDT) Message-ID: Date: Wed, 31 May 2023 13:55:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 From: Neil Armstrong Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH] gpu: drm/panel: Optimize the workflow of s6d7aa0_lock To: Lu Hongfei , Artur Weber , Sam Ravnborg , David Airlie , Daniel Vetter , "open list:DRM PANEL DRIVERS" , open list Cc: opensource.kernel@vivo.com References: <20230531110717.36896-1-luhongfei@vivo.com> Content-Language: en-US Organization: Linaro Developer Services In-Reply-To: <20230531110717.36896-1-luhongfei@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 31/05/2023 13:07, Lu Hongfei wrote: > This patch optimized s6d7aa0_lock's workflow. > Once mipi_dsi_dcs_write_seq failed, s6d7aa0_lock return immediately > and no further actions will be taken. > > Fixes: 6810bb390282 ("drm/panel: Add Samsung S6D7AA0 panel controller driver") > > Signed-off-by: Lu Hongfei > --- > drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 30 ++++++++++++++----- > 1 file changed, 22 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c > index 102e1fc7ee38..f98df32d1c55 > --- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c > +++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c > @@ -69,15 +69,29 @@ static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock) > int ret = 0; > > if (lock) { > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0xa5, 0xa5); > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0xa5, 0xa5); > - if (ctx->desc->use_passwd3) > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0x5a, 0x5a); > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0xa5, 0xa5); > + if (ret < 0) > + return ret; mipi_dsi_dcs_write_seq() is a macro that already calls "return ret" on error, so this is wrong, and there's nothing wrong with the currently upstream driver. Neil > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0xa5, 0xa5); > + if (ret < 0) > + return ret; > + if (ctx->desc->use_passwd3) { > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0x5a, 0x5a); > + if (ret < 0) > + return ret; > + } > } else { > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0x5a, 0x5a); > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0x5a, 0x5a); > - if (ctx->desc->use_passwd3) > - mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0xa5, 0xa5); > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0x5a, 0x5a); > + if (ret < 0) > + return ret; > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD2, 0x5a, 0x5a); > + if (ret < 0) > + return ret; > + if (ctx->desc->use_passwd3) { > + ret = mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0xa5, 0xa5); > + if (ret < 0) > + return ret; > + } > } > > return ret;