Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp943642rdb; Thu, 15 Feb 2024 23:37:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVEyz9v+EHCEM5st39I5kHIv3wSIxp/55Y2IBWUz2H5M8J2NX/9H5hy3dGqtltVNazi5R6A5h/BHQXKB8gnBPnpGRtJF+c1qkqICnVsbg== X-Google-Smtp-Source: AGHT+IEqMyr/NS6x0tG+5KU8J0ukPTMC4AfT5qs7ay1WwtGm+EbP5ytyJDnto9vQOrqct+xdInSc X-Received: by 2002:a05:6808:118b:b0:3c0:32d7:b93b with SMTP id j11-20020a056808118b00b003c032d7b93bmr4555492oil.50.1708069024734; Thu, 15 Feb 2024 23:37:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708069024; cv=pass; d=google.com; s=arc-20160816; b=jjixwH/AuTuonIRydYPlAei+9BXZy1BudQZxVzUCt3XEHuDH/1DhekNUua5wco/PuU J3zkEt5ZFi0G0GTRdlkLE18zroqis90hI8tFUxAf/3oLiTiqBtAMs5u4kEfNum5mucaD C7Lhl+Vqcf65gaWonevjXDjqpE0UeDefg5SEWUq+L4qOV5HZydY/JsAJ0rXtC9rhZjC8 MTYwMTgj7or/BR7B+J6OQdrstPZvguKsVoxX1UsOCS1AFAd8+MHwKPAV/54YwO8EmUq7 qkpUUXRjm/w1UtOJ40gSARqACiudvhFaKcxNENi6CvNh2yVLW0Nl4Jp5+tTWMSZJ0Jam EXQg== 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=OceffZlD1lIRrksGFR8T20wExx5FlLvt5rO7c2PaCW0=; fh=nXs/zBkC1fyGT1Fbmmp5YZLdzFQCtlsfnl+UZiYevqg=; b=mBOzbIeWQ7JQ1Y+xYK6ZOO3e+7vqnClbVG7bjGbigS9gf3wYBDMRntVSiM7vDN0q5P 4N6WGC+NdTHk5Du5+OMRl4vgSZ+32kST2/lI5Q9V76B9r2YdAglAc264Y805KtYKEdkR OYzTft5YZrUVGmWHJLT7JH8xvT48nNHyapUqWXPuGNl5++OZsT19zE1TwabCPyufKTTn P2hOXPlwXPqgo40q4oPhIeagRrNBLpk1zmXxpz6UnsfVglFYiWgM/qsA7ZVpzfAoJse/ FJyL98Y3snfYj0+fkuSarbWNSslOJ5AjgW6kdjrG9LiwHTgVYgYZDAPWuIxprWEOv+zR Lc8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GTRnjZLf; 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-68179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q3-20020a056214194300b0068f134247bcsi3611838qvk.548.2024.02.15.23.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 23:37:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GTRnjZLf; 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-68179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68179-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7C81A1C21120 for ; Fri, 16 Feb 2024 07:37:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2E1A175A7; Fri, 16 Feb 2024 07:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GTRnjZLf" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 3039D14AB0; Fri, 16 Feb 2024 07:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708069011; cv=none; b=u/B74JbSSJZhW2w9wUdrF4vQWn5elGh8aN0sx9+ajgth8YmT5fwSvGCBYowJ4wvpkXSTik07udxQU9y3qtkWKF/CpbDbgUuTD6k3lMtokE2UQa6GHHGrjw61CK7KJoNePXvYY7ziLDV4QltG6/Q0+tLTJYRgNvYZ3S4uAJYLOqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708069011; c=relaxed/simple; bh=f8O5RfA11gnSkEMTAztpJrLXeJDtOAHp8CFzTBzu+lc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Q16QICcUlv3ElwKXpTv50eQ+TBabCLKHkQFbET/YRipbg9+AaqqPKu+QGbLySrntSiPYN9auC9/ItzySA6MYAMo9oNp0ZAZBkBl4CXJsWtPSSlI0WTJiwMk7suFDzYq90XcqvBq5pASn8Ai2wsPaFPU9STHrDLJ4GYy5xcJZloU= 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=GTRnjZLf; arc=none smtp.client-ip=217.70.183.193 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 4FD8924000B; Fri, 16 Feb 2024 07:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708069005; 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=OceffZlD1lIRrksGFR8T20wExx5FlLvt5rO7c2PaCW0=; b=GTRnjZLfmc2MBgiM1Zf60+hsxmEgvJSAgGfpD3EUcdMGy67ksahC4u4bWw6gKe4BQLm9hS LSV9/i/SxXWbTXIqhaVJny94dwU7J7Isx8fOfAUKJFhgAgoCYOrmGsMTESGCeDB6JTGFIx q5CjZxup1yTajZRgaH2xgPhKjnLk2R2zInVEGgxJpobpIO5whKDl979ttmSKs20EC9Fekb QbuTDbEJbLinNt/aR2Gd7PolhTTx71myPFc0Qrt8WHYyWBLbc6YElGLJ1iqsVEV3vjBB/k Cm9HzvOLZsKgKefbLRhMbBSa+TJXzKMTB3VgMlVA5smCpuKtnfYMNLZP2B8axw== Message-ID: Date: Fri, 16 Feb 2024 08:36:41 +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 v3 14/18] phy: cadence-torrent: add suspend and resume support Content-Language: en-US To: Andy Shevchenko Cc: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , 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-v3-0-5c2e4a3fac1f@bootlin.com> <20240102-j7200-pcie-s2r-v3-14-5c2e4a3fac1f@bootlin.com> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-GND-Sasl: thomas.richard@bootlin.com On 2/15/24 16:46, Andy Shevchenko wrote: >> +static int cdns_torrent_phy_suspend_noirq(struct device *dev) >> +{ >> + struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(dev); >> + int i; > > Why signed? In the for loop below, the i variable is compared to cdns_phy->nsubnodes, which is an int. https://elixir.bootlin.com/linux/latest/source/drivers/phy/cadence/phy-cadence-torrent.c#L360 > >> + reset_control_assert(cdns_phy->phy_rst); >> + reset_control_assert(cdns_phy->apb_rst); >> + for (i = 0; i < cdns_phy->nsubnodes; i++) >> + reset_control_assert(cdns_phy->phys[i].lnk_rst); >> + >> + if (cdns_phy->already_configured) >> + cdns_phy->already_configured = 0; >> + else >> + clk_disable_unprepare(cdns_phy->clk); >> + >> + return 0; >> +} >> + >> +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; > > Ditto> Same reason >> + 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_assert(cdns_phy->phys[i].lnk_rst); >> + reset_control_assert(cdns_phy->apb_rst); >> + clk_disable_unprepare(cdns_phy->clk); >> +clk_cleanup: >> + cdns_torrent_clk_cleanup(cdns_phy); >> + return ret; >> +} > -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com