From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F09913212E for ; Wed, 19 Jun 2024 11:57:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718798226; cv=none; b=Bnan5pUDxi/dDY3P5vdDhZe0DM7rjKjwCVn0LL8LHI6TLeImygZp1XwAM3z8w2HYjoRcVd5yckqcLTt/W2ONSN5sra/5y29TsOkzYOHqyDf/gTj+GjF2vSfQhc7v1mzuW6mPLGkSpbSOBeBOcwBb6L/ZszQYJVS8AFn+YBEBI/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718798226; c=relaxed/simple; bh=udx4D3ICBwxAkvohVia2osGF316tWCg5WoOL/Qsr8vA=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ClMiou1D+O4W+odqC3mZ8+BRiwqaNmVbw5gQJwzhvQaIJaCk93AsqbXWEymif0z/Jbala2B1FLUAoGG6TuqDsd7v9CknXz6OhD9X0gX1Ei1bgPmJdR0s5XSCv4H2uB7cb0ovufJWEP07HCLGt3Imo2rz608ILWx1P49/HM3jCN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=k0W+7as6; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="k0W+7as6" Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45JBuO7Y107694; Wed, 19 Jun 2024 06:56:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718798184; bh=kYaOKx8VKBp41d22VvJ3euzGXc/iy+xf/Q65ZhDlRzQ=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=k0W+7as6Ecnd5mBxgOAMAxpvnO3nYNg1eWjUoDg/qml7jrS0Ikd9DpqTcQYItCHin YQwsI/fNY5XgJMJVlfjVGm7ku3Bl1W9eFxOs0fTAC10Lp4BVzNTzouLVND7DkHuFTI BetYrUEsgzuYJQfpvruyYoLwgK2GmlDzMgMz/TRs= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45JBuOgF117398 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 19 Jun 2024 06:56:24 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 19 Jun 2024 06:56:24 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 19 Jun 2024 06:56:24 -0500 Received: from [172.24.227.31] (uda0496377.dhcp.ti.com [172.24.227.31]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45JBuGat014422; Wed, 19 Jun 2024 06:56:17 -0500 Message-ID: Date: Wed, 19 Jun 2024 17:26:16 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 02/10] drm/bridge: cdns-dsi: Fix the phy_initialized variable To: Dmitry Baryshkov CC: Tomi Valkeinen , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Jyri Sarha , Thomas Zimmermann , David Airlie , Daniel Vetter , DRI Development List , Linux Kernel List , Dominik Haller , Sam Ravnborg , Thierry Reding , Kieran Bingham , Nishanth Menon , Vignesh Raghavendra , Praneeth Bajjuri , Udit Kumar , Devarsh Thakkar , Jayesh Choudhary , Jai Luthra References: <20240617105311.1587489-1-a-bhatia1@ti.com> <20240617105311.1587489-3-a-bhatia1@ti.com> <41fd6509-33fd-4e7f-9889-e7e9acd928d8@ti.com> Content-Language: en-US From: Aradhya Bhatia In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 18/06/24 01:04, Dmitry Baryshkov wrote: > On Mon, 17 Jun 2024 at 17:16, Aradhya Bhatia wrote: >> >> Hi Dmitry, >> >> Thanks for reviewing the patches! >> >> On 17/06/24 17:29, Dmitry Baryshkov wrote: >>> On Mon, Jun 17, 2024 at 04:23:03PM GMT, Aradhya Bhatia wrote: >>>> Update the Phy initialized state to "not initialized" when the driver >>>> (and the hardware by extension) gets suspended. This will allow the Phy >>>> to get initialized again after resume. >>>> >>>> Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") >>>> Signed-off-by: Aradhya Bhatia >>>> --- >>>> drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c >>>> index b016f2ba06bb..42565e253b2d 100644 >>>> --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c >>>> +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c >>>> @@ -1153,6 +1153,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; >>> >>> Most likely you should also call phy_exit() here. And in _remove() too. >> >> I agree that phy_exit should be called here. But why in _remove()? >> Wouldn't having phy_exit in 2 places mess up the internal ref count? > > If suspend() is going to be called in the teardown path, then it's > fine to have just one call here. Otherwise you might add one guarded > with if (phy_initialized) to _remove() too. Since the _suspend() and _resume() hooks are registered for both, system sleep PM and runtime PM, the _suspend() hook does get called when I remove the cdns_dsi module using modprobe. Tested that on my setup. I believe having phy_exit() only in _suspend() would suffice for now. > >> >>> >>>> + dsi->phy_initialized = false; >>>> return 0; >>>> } >>>> >>>> -- >>>> 2.34.1 >>>> >>> >> -- >> Regards >> Aradhya > > > -- Regards Aradhya