Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp459702rdb; Wed, 17 Jan 2024 07:15:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbBFpSM652uRNowvYbpH22E/M0Cuk86JdbEMesaeRXdapMiOC1xy30ACOX1KU78HXwn8gj X-Received: by 2002:a19:9116:0:b0:50e:e1cc:7052 with SMTP id t22-20020a199116000000b0050ee1cc7052mr3988031lfd.19.1705504529568; Wed, 17 Jan 2024 07:15:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705504529; cv=pass; d=google.com; s=arc-20160816; b=OZ76aX/C+xo138l5nfixrI3U/3291CY3+WNlQUh3X6GUA4PT4owucAe0/668Ink4s2 gZavnvXuPNC7L+iEA1hkNEiuRbbHU6t8v6kC/9xoX0iAMXmVFi/G4Ysuy3zvKVxXBNIv eK8hzDk+2TFwYnoYwPHJKYd5sxoWPjU6U4fvJED69fE0Bmz5/AH4uSs5BlibrpoWctl9 qO3SbljyGIUOkv0z6xcRzbUyASrO2J2rP/LWa3naTVIm8R3kFCBtMcxbHZtgH5u08zS4 Z0618tKroCxm/JREvQpxOoxFkTAXM5Athp0topyvXW2hNbt/eVtqlv/0C9BDk4A8AZzP furg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=ZqTPGmZoLpjNwCSsQ0mqsKmol+s3Zf2SnN+GPJn4AXI=; fh=T/ea2FunEp1Y2KFEnOZ8Q5YTSd+1ABL63cUja30PTsU=; b=m3AFhqZTdH2jV9w9Ft5c2C/nOu3Q39W2Lzb+3SOTjFkhk+AK0Ki7D0wnVlyQRbD3TV Qzc1P8K3AEfDUzKthMNp/HuGXs5UislCcj7Y+Is8RxZivxxB70LBj8Cv4BCQ6X5WQ49c N6HzDIMRlLilFN9Ihl+zIjPeOcIe++Kw5S/e6MV2C1sFEWzMDyHMvBO858R8PK1w3pbm AnvgDxHkPsRkBD07cqyJGWxk9XABK755xaiBy2rq9mfYelijDpb8K+d+Z/jze8qjHfWX qj4nHxD9llY5dnBQCf4OKo78rVOmRFz1AjFmrCIBu6QYePs4Gr3/A7farUl2SWRoosJR fPrQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-29140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29140-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ox5-20020a170907100500b00a2a637bfe68si5535761ejb.335.2024.01.17.07.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 07:15:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-29140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29140-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 340CD1F259C0 for ; Wed, 17 Jan 2024 15:15:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99A2D2137D; Wed, 17 Jan 2024 15:13:24 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 B4A8222325 for ; Wed, 17 Jan 2024 15:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504404; cv=none; b=Nfyhgk+59UR5NH9nsjzxAJmbODB7tUvs1itYPYKqG5joEh6tt0uIv77abslLkoC5QYIjBoSJczsr+gAbm2z2AWLizgMJH3q3IZLtuyzSJ29QmFp+aIZTdrc2Olpb3TeEopg+/uxXXUZQhUMaW31OtcJ9azDGhjCld+tXR7ZzOtc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504404; c=relaxed/simple; bh=DoPT2kPCKFf6axbElxOjPA7nhJzePbYJNHAQ65rX3aQ=; h=Received:Received:Received:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version:X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From: X-SA-Exim-Scanned:X-PTX-Original-Recipient; b=iBhUTI1u6UjkkA83oj4jR1z0RX828S2BkrUwByMElLF0Z7mS0XA7vMNJ6O82GdeGuy3jv5eXbS35HWOf0Zh/RnfyeeBMOpXGPzZuIZR0BS7P9CwgufWrGqGqPR/vV9Tk7rQ6mAUyVL18Wu/FndaDjO6SsU5Y7W86MavET0ucTj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQ7b0-0000IN-Ew; Wed, 17 Jan 2024 16:12:50 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQ7ay-000UW3-1a; Wed, 17 Jan 2024 16:12:48 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1rQ7ax-000C5F-36; Wed, 17 Jan 2024 16:12:47 +0100 Message-ID: Subject: Re: [PATCH 11/14] phy: cadence-torrent: add suspend and resume support From: Philipp Zabel To: Thomas Richard , 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 , Krzysztof =?UTF-8?Q?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 Date: Wed, 17 Jan 2024 16:12:47 +0100 In-Reply-To: <20240102-j7200-pcie-s2r-v1-11-84e55da52400@bootlin.com> References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> <20240102-j7200-pcie-s2r-v1-11-84e55da52400@bootlin.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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. >=20 > Based on the work of Th=C3=A9o Lebrun >=20 > Signed-off-by: Thomas Richard > --- > drivers/phy/cadence/phy-cadence-torrent.c | 57 +++++++++++++++++++++++++= ++++++ > 1 file changed, 57 insertions(+) >=20 > diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cade= nce/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 platfor= m_device *pdev) [...] > +static int cdns_torrent_phy_resume_noirq(struct device *dev) > +{ > + struct cdns_torrent_phy *cdns_phy =3D dev_get_drvdata(dev); > + int node =3D cdns_phy->nsubnodes; > + int ret, i; > + > + ret =3D 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 =3D cdns_torrent_phy_configure_multilink(cdns_phy); > + if (ret) > + goto put_lnk_rst; > + } > + > + return 0; > + > +put_lnk_rst: > + for (i =3D 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=C2=A0lnk_rst are put again. Should this be: reset_control_assert(cdns_phy->phys[i].lnk_rst); ? regards Philipp