Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp374395rdb; Mon, 22 Jan 2024 07:01:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFwFR2ukOVC4bBOfCuEcXTsO9BtaDUw1eOoXpoi4hNjn6Md8JEsOOyIDKkqdzuzggYkR4k X-Received: by 2002:a05:6a20:7a26:b0:199:8ed6:746e with SMTP id t38-20020a056a207a2600b001998ed6746emr1402207pzh.58.1705935682463; Mon, 22 Jan 2024 07:01:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705935682; cv=pass; d=google.com; s=arc-20160816; b=SLKa6Ws22IAtihRVIXpyNyMZsJis8rPeZAnDUHkfICbHBVrjlhSYxnAo5METUHBGlZ 9VrlgdCIsBTHcM20NcDw/MBanRiJytT+KliSEWRWt6oganxQIteploJ29ksVdA2gGSxj WTRwHFfMAE2eWnhHVv1bHtVG3uBbxaEi3W/xm0ZyZhgH8MH9jLzJxFbGfx5S8HeSfNIB K8cngHp3ETY0Yv/GZsmEjw1f5eZBMvKjRBoRFEmH11Nc9qbhIU2yDWVLxjiTewpEWS/n bsFNK8tR6b3aQGiUgPO8G1hfPZpGqWBeEYny4v4Rf+VgJJE9xA/FDtvgxS9Jls10F8iw Yfww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=hUHwKKXyN83iQW+8ASCaMDdQ+1ucr+vrFhxoE1hk85s=; fh=8ijM23AKUYbN5ZezL40htAjaonA3CuKa5JZF/0R7710=; b=GV/y5wh1MDJK9uEH0s355e+nEsSiQGcI26nSgXW/8GbsIzjo1LI7gDWjcKBbQ+o54G n5ZuxrcqIa5Vjr4tJVURHe0vpIpweo3k+qsXYixrRdLL4dfFEFnhDGgy511neCL4nwjg Jmyk4VSe1EdkWB4pKfA4AtVokq6Z3o9GH4MJX0VBs5g2IoFXDtY5sq5dtvfqMU2HfrVY DSxOTQJz7C+ZGF/86tv22T/WeLk47TOGpHXym/OU0VFFqpVRkMWZ9TRYrkR/+V0kvZYW xVMw8AnBpAxXZAEwEJXQ4A2TsUYNvxrpCndlrmAbAynVfQ1XrxtP/2xH96oWBL45KoBi ugJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Eo/4/GbP"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-33156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g13-20020aa7818d000000b006dbbcb47d98si6032483pfi.299.2024.01.22.07.01.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:01:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Eo/4/GbP"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-33156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF114B294D4 for ; Mon, 22 Jan 2024 14:28:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B30D3D38C; Mon, 22 Jan 2024 14:28:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Eo/4/GbP" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 CB5C93C488; Mon, 22 Jan 2024 14:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705933700; cv=none; b=FSKdqZl5aLFzMOrDNRnKC6Nl7sWb0qHULd0njzaG8RFdt9E1FbRT6gdf99N6omJwZwMFOBtJD5o+yUiwo3nREe1zwr7D6bNFb9YFw9JZWE1YlVQ7ZAtjtNawnYUPS3QStOzROKcXVKac8BQTslpt9s05FK+wJrZi8fKuYXBHG6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705933700; c=relaxed/simple; bh=cobDFEarhSrpaarf/hflxidRDBHdiSClIDCuWn2EHZs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DwJtNaeIlnH9M5CI7aIkiWxU2S4u8qMh+cbC9FzM4FXZUnscw/UkxNw7QdwsjqQXwLKlpteNL0GN49Gi66HUFlM2gvYEjWnTCKaJM2UTKFOVbXVRA6s5Pmypkgt4y9KipmHYabgS7od464JAPzNFxi5RzZZ3MGR4DCgNOM004eQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Eo/4/GbP; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 8BA25C000B; Mon, 22 Jan 2024 14:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705933689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hUHwKKXyN83iQW+8ASCaMDdQ+1ucr+vrFhxoE1hk85s=; b=Eo/4/GbP6NNCg+QhObmRPD/F7PbEwojKkEc+ZqeTp2whemggtZ9XGLV0arqYTPmU3zEKBt t06b5DM+lTctrEpAzlwuUZEwEx4o7ZXF2rnrTHnCeUzCsmmgMwKVD5Yb/l+kKCYqgrV7Y/ DqwdaLijb8hL8B2owHwWEVC+o8EDt46F5Yh2ZEFeIhaHmAADA9Qsj/PwoJE2Itqpgq4BFf IuEFB24TUpKpyiOnFztQ2Ystc+LWgI+9uA4y9Gw9D6jmnUptRbBGk9dFJytBKFFEncWyrE rGIfQqx9CiBFmORwpIlqIjIIVVtky6HM7KhZ3mHcE15YBa/lTTEVG3clfQNkZw== Message-ID: <27eff12c-6d80-48e3-82b9-3a4aa90ce76c@bootlin.com> Date: Mon, 22 Jan 2024 15:28:05 +0100 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 11/14] phy: cadence-torrent: add suspend and resume support Content-Language: en-US To: Philipp Zabel , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Tom Joseph , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> <20240102-j7200-pcie-s2r-v1-11-84e55da52400@bootlin.com> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com Hello Philipp, On 1/17/24 16:12, Philipp Zabel wrote: > Hi Thomas, > > On Mo, 2024-01-15 at 17:14 +0100, Thomas Richard wrote: >> Add suspend and resume support. >> The alread_configured flag is cleared during suspend stage to force the >> phy initialization during the resume stage. >> >> Based on the work of Théo Lebrun >> >> Signed-off-by: Thomas Richard >> --- >> drivers/phy/cadence/phy-cadence-torrent.c | 57 +++++++++++++++++++++++++++++++ >> 1 file changed, 57 insertions(+) >> >> diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c >> index 70413fca5776..31b2594e5942 100644 >> --- a/drivers/phy/cadence/phy-cadence-torrent.c >> +++ b/drivers/phy/cadence/phy-cadence-torrent.c >> @@ -3006,6 +3006,62 @@ static void cdns_torrent_phy_remove(struct platform_device *pdev) > [...] >> +static int cdns_torrent_phy_resume_noirq(struct device *dev) >> +{ >> + struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(dev); >> + int node = cdns_phy->nsubnodes; >> + int ret, i; >> + >> + ret = cdns_torrent_clk(cdns_phy); >> + if (ret) >> + goto clk_cleanup; >> + >> + /* Enable APB */ >> + reset_control_deassert(cdns_phy->apb_rst); >> + >> + if (cdns_phy->nsubnodes > 1) { >> + ret = cdns_torrent_phy_configure_multilink(cdns_phy); >> + if (ret) >> + goto put_lnk_rst; >> + } >> + >> + return 0; >> + >> +put_lnk_rst: >> + for (i = 0; i < node; i++) >> + reset_control_put(cdns_phy->phys[i].lnk_rst); > > What is this intended to do? I expect this to explode in _remove, where > the lnk_rst are put again. Should this be: > > reset_control_assert(cdns_phy->phys[i].lnk_rst); > > ? Yes indeed, it's reset_control_assert instead of reset_control_put. Thanks for the review. Regards, -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com