Received: by 10.213.65.68 with SMTP id h4csp801403imn; Tue, 13 Mar 2018 23:51:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELtoPOWoN534BTWnYq44FA0TGHf8kMnWnWzH7LIKokDf3i1JpROmlrDF2rqHbmO7lQJJb+T6 X-Received: by 10.99.6.198 with SMTP id 189mr2820416pgg.131.1521010300096; Tue, 13 Mar 2018 23:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521010300; cv=none; d=google.com; s=arc-20160816; b=xa+J389wE6V7q8cs02bQ7Z2rh+z4BdimseY2gqjjhhKURHaeBEg/1AGxKziS2cErO5 0Z+MMHDnDOz9/+Pc7xY/kNo5QLgV1p75sL/UXKOvNnuBBaKa1xKFLFAWs5MXNPqFZj0U wxnFEC47ublNKE9YAKq5mie1CdVzhbZnRr7MOVKC2iEU8KLyMNGJjkbGcLeglRfjJT2e U/f8fDIgOlMsNJvGFzzYMoNvtcyEzFp2XlIyP+xRto/Tqsbq5bHh3QK3/Cr91ja7D76K dU1ocEOgGqGZnCFbRiuziVMD58//jEjHnTPdku6w9P+RS54azyp8A6F5HXIcMM9wqZLy TWNg== 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=Yx7hx6WIrzcFVpCtf5e+5d/wuWY1kCe8UE0GXhI62Zw=; b=m8CoJLRhmqXQ9TYpDOvbjB6lyzGsCr3kKd/P/glwJmQeDOP+i+QAgjLUSoSsrYwW5H 03BDFTTk1VF3Svi9O/ASGHb9pY+a2FmVKGHlCMxFXPnSYn+nCxaDB1/4nj5otkj9QDvP p552xNLGnY9H7u2CzneUickbElR02KO6V38FZrOg0fn86wnepl1Ug0orsvEd6FYiY/Jd G1+r3MYg+4+9I72eyh9dn+CwijNddUlsFBGkOjH1lmmSpyXaldZQPiaC3uoNK5Pm8cC1 pVzj4Q2lKTV6TllHSwh1cmZQ3i37FiGXozi7tGNEx/Xxcg6hGovRIYH0gBmzyhToiRvT WJjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=d4UsMYeF; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ef8ZLBuX; 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 n21-v6si1410350plp.198.2018.03.13.23.51.25; Tue, 13 Mar 2018 23:51:40 -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=d4UsMYeF; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ef8ZLBuX; 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 S1753384AbeCNGu2 (ORCPT + 99 others); Wed, 14 Mar 2018 02:50:28 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38466 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbeCNGu0 (ORCPT ); Wed, 14 Mar 2018 02:50:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A18E7608BF; Wed, 14 Mar 2018 06:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521010225; bh=STr4SWw28vMswYD5ftlIvOvftGumw5JGh5s0+XVfgho=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=d4UsMYeF5BoGwd/zbG3HgwiqH8z7I0QvRPVEifacLkd+gwMxIxsFcs/Z0+2SwB2vd sxjQwppoSZ1Z3hYM1IN98o3z0cpAX216LnPJB3BlhrcHv9TwM1j96qFYcmIZGaWzhZ ReSI9M9c83s/BOwuFXe+stmq9x1o0HXZz1MnzqCw= 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 B0BAA60390; Wed, 14 Mar 2018 06:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521010223; bh=STr4SWw28vMswYD5ftlIvOvftGumw5JGh5s0+XVfgho=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Ef8ZLBuX5UzI3tZlgzHzqyTsg5zt8tFVZLDqoZueDLT7APsRiXy7laRqKFPi+HCJ+ Tr9mWwl5BypJOpv8dcWRAqXUMzbg0UxIzPMZWGayDJVJrr8iRGGanCHIJVEybMQGdw sdtuzt0vi1/lpSs2QY2QAEnGvU2q3nL3+jEsOz0c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B0BAA60390 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 24/36] drm/bridge: analogix_dp: Reorder plat_data->power_off to happen sooner 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, "Kristian H . Kristensen" References: <20180309222327.18689-1-enric.balletbo@collabora.com> <20180309222327.18689-25-enric.balletbo@collabora.com> From: Archit Taneja Message-ID: <6411add8-32ee-a365-9882-061c1383ffd0@codeaurora.org> Date: Wed, 14 Mar 2018 12:20:09 +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-25-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:53 AM, Enric Balletbo i Serra wrote: > From: Douglas Anderson > > The current user of the analogix power_off is "analogix_dp-rockchip". > That driver does this: > - deactivate PSR > - turn off a clock > > Both of these things (especially deactive PSR) should be done before > we turn the PHY power off and turn off analog power. Let's move the > callback up. > > Note that without this patch (and with > https://patchwork.kernel.org/patch/9553349/ [seanpaul: this patch was > not applied, but it seems like the race can still occur]), I experienced > an error in reboot testing where one thread was at: > > rockchip_drm_psr_deactivate > rockchip_dp_powerdown > analogix_dp_bridge_disable > drm_bridge_disable > > ...and the other thread was at: > > analogix_dp_send_psr_spd > analogix_dp_enable_psr > analogix_dp_psr_set > psr_flush_handler > > The flush handler thread was finding AUX channel errors and eventually > reported "Failed to apply PSR", where I had a kgdb breakpoint. Presumably > the device would have eventually given up and shut down anyway, but it > seems better to fix the order to be more correct. > Reviewed-by: Archit Taneja Thanks, Archit > Cc: Kristian H. Kristensen > Signed-off-by: Douglas Anderson > Signed-off-by: Sean Paul > Signed-off-by: Thierry Escande > Reviewed-by: Andrzej Hajda > Signed-off-by: Enric Balletbo i Serra > Tested-by: Marek Szyprowski > --- > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index 37b16643f14c..eaf93cbd47a8 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -1337,12 +1337,13 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) > } > > disable_irq(dp->irq); > - analogix_dp_set_analog_power_down(dp, POWER_ALL, 1); > - phy_power_off(dp->phy); > > if (dp->plat_data->power_off) > dp->plat_data->power_off(dp->plat_data); > > + analogix_dp_set_analog_power_down(dp, POWER_ALL, 1); > + phy_power_off(dp->phy); > + > clk_disable_unprepare(dp->clock); > > pm_runtime_put_sync(dp->dev); >