Received: by 10.213.65.68 with SMTP id h4csp771756imn; Tue, 13 Mar 2018 22:32:08 -0700 (PDT) X-Google-Smtp-Source: AG47ELt6E434xsQaFbF+GSgTetStMu2R5ferj5S2i5aymDKvTGB1Ymw2Py4w4uIS2MJOWFZo+Htr X-Received: by 2002:a17:902:7b90:: with SMTP id w16-v6mr2850398pll.26.1521005528024; Tue, 13 Mar 2018 22:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521005527; cv=none; d=google.com; s=arc-20160816; b=MfqFTyf+3rf12IkTaMJhAL3PQhySFOPUqJpFoSXa5tUgilbAc2KZJbT3Qb6OYMnDCj Ljqe9amUTnlbrkI9t9zOO6/Ka8UFfp5hPKYH6C6YITvjUyhFiA+fVkGLp29wT6YTfH0A 7uXFU3QNdpUa3B6cYNlX5J9QWwa9QpRDbrLw1j9WPFBMzVQoif2W/91KqSVXrRVlmvw3 ++ZYaEm3DC25sd23DIZeUsAgCvwBubDkkXtXbTYIf/P8zfKNKhSy8as5xYn5T/1k5WSp VzI6vrm91jvHx6WozdLOYABakaBnLjItcRJ5AljaxUTTehOVgwaKLlWuuNvX06fWRFl5 moOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=QcoEOYhKEgXMpkjZ8bkY6Lh+89qs/5h/Ws9gGMEDdPc=; b=fJp5kIZnlpv2oFxg8a3BON8pTlJCcDUq7igmsurT+AUxrnGuCq23YqwsTcisL9AmP7 TdQDvz5OK3q+oafXyUMNnEiWTUGtJeBr2wTLRPTlY25eu8luY3stJGtwVGjX8KsO7y1Y LNQFLrvw7CkbWr4QRWM2BA+sMO0v5xm15BSgW4o2k5aoLbX3Pu33u+TaE7FBEt+MUXe8 3eV/yffQG0P4pSiMlAIniCVAkuFoZbuR0Q00dirrH2BH7JtmKpgIvmBt95tR3teNqbnZ guNQ3RndjjUG7+7nTP+Uq34/w6Z0pNsnoWOdnu4m/UxZZZspoFy85r9j8+cL8MKcahjk 44Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kowsyxPx; dkim=pass header.i=@codeaurora.org header.s=default header.b=Bi2lLVGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si1311438pgq.194.2018.03.13.22.31.53; Tue, 13 Mar 2018 22:32:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kowsyxPx; dkim=pass header.i=@codeaurora.org header.s=default header.b=Bi2lLVGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328AbeCNFas (ORCPT + 99 others); Wed, 14 Mar 2018 01:30:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40386 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbeCNFaq (ORCPT ); Wed, 14 Mar 2018 01:30:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9BD9C60854; Wed, 14 Mar 2018 05:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521005445; bh=M/QBuv/tJ28V8n9L5O07k4PEtZ7X0uSr+x5fquLdvcg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kowsyxPxCadd8NM0bzCAE7XQktcKEQdhaJMWUfrlfi+23sEFbQhJoWWccn9ePonSR SXTFOjkR4jHwpqb7Z2qAudAU2aWCC9Dp054VZVdl0SWcK7Ehg0yltV2kFz5K59ir8w t3Iyby5CTQTFl0/kn0to5fVIkuS6JNbcacrh4KCo= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.84] (unknown [182.71.117.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4C3956016D; Wed, 14 Mar 2018 05:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521005443; bh=M/QBuv/tJ28V8n9L5O07k4PEtZ7X0uSr+x5fquLdvcg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Bi2lLVGGMrFBZ9mvLUahNmQqecJjB3UIHUsmQWqF+IbprbrL+0zL9Ba4sHkN07IJj VWMcREDb7KtsZL3n6/7kZpSRQGC39iLwyNZVPK/RgwcBKaOFNWslITHcCHGtSjxNRH 6VDxZt97OpI7PqguVMKRW7dPPQi3FcmWMbHnq91o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4C3956016D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH v5 03/36] drm/bridge: analogix_dp: Don't change psr while bridge is disabled To: Enric Balletbo i Serra , inki.dae@samsung.com, thierry.reding@gmail.com, hjc@rock-chips.com, seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, dianders@chromium.org, a.hajda@samsung.com, ykk@rock-chips.com, kernel@collabora.com, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, rydberg@bitmath.org, krzk@kernel.org, linux-rockchip@lists.infradead.org, kgene@kernel.org, linux-input@vger.kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com, wzz@rock-chips.com, hl@rock-chips.com, jingoohan1@gmail.com, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, Laurent.pinchart@ideasonboard.com, kuankuan.y@gmail.com, hshi@chromium.org, Tomeu Vizoso References: <20180309222327.18689-1-enric.balletbo@collabora.com> <20180309222327.18689-4-enric.balletbo@collabora.com> From: Archit Taneja Message-ID: <8e68b2ae-21f8-ed3f-1804-f3d1978f8ce2@codeaurora.org> Date: Wed, 14 Mar 2018 11:00:30 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180309222327.18689-4-enric.balletbo@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 10 March 2018 03:52 AM, Enric Balletbo i Serra wrote: > From: zain wang > > There is a race between AUX CH bring-up and enabling bridge which will > cause link training to fail. To avoid hitting it, don't change psr state > while enabling the bridge. Reviewed-by: Archit Taneja > > Cc: Tomeu Vizoso > Cc: Sean Paul > Signed-off-by: zain wang > Signed-off-by: Caesar Wang > [seanpaul fixed up the commit message a bit and renamed *_supported to *_enabled] > Signed-off-by: Sean Paul > Signed-off-by: Thierry Escande > Signed-off-by: Enric Balletbo i Serra > Tested-by: Marek Szyprowski > --- > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 15 ++++++++------- > drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 +- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 +- > include/drm/bridge/analogix_dp.h | 2 +- > 4 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index e738aa6de1af..ee00d3d920e0 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -98,18 +98,18 @@ static int analogix_dp_detect_hpd(struct analogix_dp_device *dp) > return 0; > } > > -int analogix_dp_psr_supported(struct analogix_dp_device *dp) > +int analogix_dp_psr_enabled(struct analogix_dp_device *dp) > { > > - return dp->psr_support; > + return dp->psr_enable; > } > -EXPORT_SYMBOL_GPL(analogix_dp_psr_supported); > +EXPORT_SYMBOL_GPL(analogix_dp_psr_enabled); > > int analogix_dp_enable_psr(struct analogix_dp_device *dp) > { > struct edp_vsc_psr psr_vsc; > > - if (!dp->psr_support) > + if (!dp->psr_enable) > return 0; > > /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ > @@ -131,7 +131,7 @@ int analogix_dp_disable_psr(struct analogix_dp_device *dp) > struct edp_vsc_psr psr_vsc; > int ret; > > - if (!dp->psr_support) > + if (!dp->psr_enable) > return 0; > > /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ > @@ -871,8 +871,8 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) > /* Enable video */ > analogix_dp_start_video(dp); > > - dp->psr_support = analogix_dp_detect_sink_psr(dp); > - if (dp->psr_support) > + dp->psr_enable = analogix_dp_detect_sink_psr(dp); > + if (dp->psr_enable) > analogix_dp_enable_sink_psr(dp); > } > > @@ -1117,6 +1117,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) > if (ret) > DRM_ERROR("failed to setup the panel ret = %d\n", ret); > > + dp->psr_enable = false; > dp->dpms_mode = DRM_MODE_DPMS_OFF; > } > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h > index b039b28d8fcc..e135a42cb19e 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h > @@ -170,7 +170,7 @@ struct analogix_dp_device { > int dpms_mode; > int hpd_gpio; > bool force_hpd; > - bool psr_support; > + bool psr_enable; > > struct mutex panel_lock; > bool panel_is_modeset; > diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > index 36334839a3f8..3e8bf79bea58 100644 > --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > @@ -82,7 +82,7 @@ static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled) > struct rockchip_dp_device *dp = to_dp(encoder); > int ret; > > - if (!analogix_dp_psr_supported(dp->adp)) > + if (!analogix_dp_psr_enabled(dp->adp)) > return; > > DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit"); > diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h > index 711fff9b6803..e9a1116d2f8e 100644 > --- a/include/drm/bridge/analogix_dp.h > +++ b/include/drm/bridge/analogix_dp.h > @@ -41,7 +41,7 @@ struct analogix_dp_plat_data { > struct drm_connector *); > }; > > -int analogix_dp_psr_supported(struct analogix_dp_device *dp); > +int analogix_dp_psr_enabled(struct analogix_dp_device *dp); > int analogix_dp_enable_psr(struct analogix_dp_device *dp); > int analogix_dp_disable_psr(struct analogix_dp_device *dp); > >