Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2057516rwb; Wed, 30 Nov 2022 01:32:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Jjw3UlWp6YeAsRywvi1n3mH0ZDHVag57PO4EfIly2HiWsPXUlaj0Y43xQKIFACVrHrfq6 X-Received: by 2002:a17:906:aec1:b0:7c0:a04b:6795 with SMTP id me1-20020a170906aec100b007c0a04b6795mr1296437ejb.16.1669800724612; Wed, 30 Nov 2022 01:32:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669800724; cv=none; d=google.com; s=arc-20160816; b=DTMkAR2ntfULSE4pT7oJ41Glinermz36MPAbxKqvx+4HHrZBxhZnxQOUz2CuvpYS5Y hSDeolU/xekAYlzHsl4frJIP2GGT8WTVQt3yepQbP/Ry5B2PLkCnHyIn94EkLtRzDPKP 5ErB/d0NNUasv4lu/9QbySwxbYMBmIIJvL7EEvaC1OuBTXcGKp/UQaTy6TjIfFrjcWwO B6kuHOOPf5/kMJjO9YXCm8CGtCIZELIvT0xCSZ1Y1uGvt6zZg4bZTNEgdSRGLkF8k4Ex iv6Nnv+uNkLGw7WP7B3mwqWuF5t9y6JTKJCFvWYcX2X3gG3APZe4Gai1/LDccolpU4TR qfbw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yOSx/KrbK4zrdld6uAWs/f4u8HtsFuKbUVHhswrw2wg=; b=obdQFqYbfSTiipEktuXBeWzBQw3K65sMcVKaLN03mcvR+spZVhufiFqOwcbYBMP7HH Zhj+iGPJjbEa0bGKdYhUzLwpvhu+k6FlazBNUrrTbHLJd52/KfXmNm6Li62V5bCPyRa6 +WFBGYc+hG1tmEOKjpgLnhPwN3u1osUQGXsFXBGXv3MDVQ0BbdYGXeDtESsSVxJScSGG ZcIyNaM4HvlIxXv3tsSNGKbhwlG/AjyNbSxgbT1bGWWBi3M6s9BJHlpkSg967dYAcBNP cRhDBscz4ezWY6DgY2sqsrfpi7nSEyZPeY0gaDfLsr5HBnN3x6doC6hj2jfS1Hs5vS3Q fRdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=iinw8v1T; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r11-20020a05640251cb00b0046b3ecfe295si993167edd.530.2022.11.30.01.31.44; Wed, 30 Nov 2022 01:32:04 -0800 (PST) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=iinw8v1T; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234472AbiK3I4V (ORCPT + 85 others); Wed, 30 Nov 2022 03:56:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232160AbiK3I4T (ORCPT ); Wed, 30 Nov 2022 03:56:19 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11C82D1C0 for ; Wed, 30 Nov 2022 00:56:17 -0800 (PST) Received: from [192.168.1.15] (91-154-32-225.elisa-laajakaista.fi [91.154.32.225]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5A59955A; Wed, 30 Nov 2022 09:56:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669798576; bh=P+QWGX/RuFzHin2xHy5lZrSKi8lf7M6oOuqsIDQL71s=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iinw8v1TZlf82C3F6KLpPTT4awQuoJ0TuhLJB+QL6FKLdSXFIxK1AAJfK1BulEGl9 4Oi61qc1iN5g5eRa/GgwWr6uEHjK/fkZMgx8hl8VaNsyDSQsAmyE8qTqbePGTohuHA 2rz7x3iKC9LrXNJzAZIqwcLgsnflmdmESBHqeoJY= Message-ID: <58cff9e3-2488-5119-40ba-070ae930906d@ideasonboard.com> Date: Wed, 30 Nov 2022 10:56:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] drm/bridge: cdns-dsi: Fix issue with phy init Content-Language: en-US To: Rahul T R , dri-devel@lists.freedesktop.org Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, p.zabel@pengutronix.de, linux-kernel@vger.kernel.org, jpawar@cadence.com, sjakhade@cadence.com References: <20221115083918.23192-1-r-ravikumar@ti.com> From: Tomi Valkeinen In-Reply-To: <20221115083918.23192-1-r-ravikumar@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS 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 15/11/2022 10:39, Rahul T R wrote: > Phy is not being initialized after suspend resume. Fix this by setting > phy_initialized flag to false in suspend callback > > Signed-off-by: Rahul T R > --- > drivers/gpu/drm/bridge/cdns-dsi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/bridge/cdns-dsi.c b/drivers/gpu/drm/bridge/cdns-dsi.c > index 20bece84ff8c..1a988f53424a 100644 > --- a/drivers/gpu/drm/bridge/cdns-dsi.c > +++ b/drivers/gpu/drm/bridge/cdns-dsi.c > @@ -1187,6 +1187,7 @@ static int __maybe_unused cdns_dsi_suspend(struct device *dev) > clk_disable_unprepare(dsi->dsi_p_clk); > reset_control_assert(dsi->dsi_p_rst); > dsi->link_initialized = false; > + dsi->phy_initialized = false; > return 0; > } > I'm not familiar with the IP, but the code related to enable/disable looks a bit odd. Why does cdns_dsi_bridge_enable() do: cdns_dsi_hs_init(dsi); cdns_dsi_init_link(dsi); but then in cdns_dsi_bridge_pre_enable(): cdns_dsi_init_link(dsi); cdns_dsi_hs_init(dsi); Doesn't the order matter? Why are the same functions called in both places? cdns_dsi_hs_init() seems to do enabling, like locking the PLL. But there's no counterpart, hs_uninit(). I see cdns_dsi_bridge_disable() doing some clearing of the registers, so perhaps that's where the disabling happens. But cdns_dsi_hs_init() is called from the pre-enable, and post-disable doesn't do anything else but pm_runtime_put(). More or less the same comments apply to cdns_dsi_init_link(), but it's a bit worse as it's also called in cdns_dsi_transfer(), and then there's no uninit counterpart that I can see. Well, maybe both functions are only doing configuration, not enabling this as such, and so it's fine to just turn off the IP without any uninit step. If that's the case, then probably this patch is fine. Tomi