Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp395964rdb; Sat, 16 Dec 2023 12:56:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQopHVpGfoNYbHq17Si+zjShnsV15CJgwEsBL4eoz1OIZk7v4uK/3j7NPU6Ws1T620ivvj X-Received: by 2002:a05:6e02:1a41:b0:35d:57ea:8e42 with SMTP id u1-20020a056e021a4100b0035d57ea8e42mr19976900ilv.10.1702760190426; Sat, 16 Dec 2023 12:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702760190; cv=none; d=google.com; s=arc-20160816; b=oL0brFJ7q8BjIE45KQnV3yKqdtLX1OIgoJ16lJxErj2JZWSrur4H9NNTxE5O8wAXYU p6u74tP+4AMsngrOPsKsLEF8M+JPfwPfzvHM0252HAxmUE80Rx+Oln9bg1WlUtVqsdBy pMbjKoUqsXSlHA1dxecf+DkbBWqsYEIRuXo4vLVdTnFw7sq8R5rckF9UsfI74l2+wVcu eq9Aiivo6kWGj7t7kflpj8i79+UbZmr+W8lHeK35BoQ/MU8lvKkbve5nQtyfb5pHnZaM ysFfy61uwAWSVs7qJT0Fk2s8G9kU/YbOpQZZGroxj4oEa7qqw28lFUuMB7qqHV60D6zd ysUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=xAI/GjXSiltHezkevsiLP9xMT3MVhZD0acO3UUz3nnk=; fh=2RsYFHEIGT6SdwVMn2Fr/vWWtVyxDK3oO9pDiUb5rTA=; b=YLbYt8j/6wMBNJ0x4M99IIc7SdajrltHKd6AxeKxxEI6B+DQwFXcFIay1v4z5/ZY0O Lx5er/drOblCHtxGf6QwYAANsBoXVr7MpFOI7wHr+ZA+6tO7MQWN8tDyyfb6605rvNP2 qqMxue5WrEqH3GJ8xSpiHq2qFGc4WLcKWD9YUAcEvgDyXMuH4xKxPtvj5S+ecQlEBPcZ azr3hnj0DhWC0HEWVcqSzvE0OGZb+xpro43NwSdXZQ5fF1YcfSFjRYgfzOMfCBa5wjpE 6/p3t5/XJEsS6htlHke6QTg/dp5naRgdBo2nAFWP/MAM+HoBRLTZ+n/xZPd6wWKNvHme 81eQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2367-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w1-20020a170902e88100b001d366f8cfe3si5372478plg.52.2023.12.16.12.56.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 12:56:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2367-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; spf=pass (google.com: domain of linux-kernel+bounces-2367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2367-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 54265B23460 for ; Sat, 16 Dec 2023 20:56:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53D2132C6B; Sat, 16 Dec 2023 20:56:19 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 576681E494; Sat, 16 Dec 2023 20:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from [192.168.1.104] (31.173.82.73) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Sat, 16 Dec 2023 23:56:05 +0300 Subject: Re: [PATCH net-next v2 21/21] net: ravb: Add runtime PM support To: Claudiu , , , , , , , , , CC: , , , Claudiu Beznea References: <20231214114600.2451162-1-claudiu.beznea.uj@bp.renesas.com> <20231214114600.2451162-22-claudiu.beznea.uj@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <07dd346c-a6f8-ecdb-9af5-7b891881347b@omp.ru> Date: Sat, 16 Dec 2023 23:56:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20231214114600.2451162-22-claudiu.beznea.uj@bp.renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.0, Database issued on: 12/16/2023 20:43:46 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 182147 [Dec 16 2023] X-KSE-AntiSpam-Info: Version: 6.1.0.3 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 31.173.82.73 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 31.173.82.73 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: omp.ru:7.1.1;31.173.82.73:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: ApMailHostAddress: 31.173.82.73 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 12/16/2023 20:48:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 12/16/2023 5:57:00 PM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit On 12/14/23 2:46 PM, Claudiu wrote: > From: Claudiu Beznea > > Add runtime PM support for the ravb driver. As the driver is used by > different IP variants, with different behaviors, to be able to have the > runtime PM support available for all devices, the preparatory commits > moved all the resources parsing and allocations in the driver's probe > function and kept the settings for ravb_open(). This is due to the fact > that on some IP variants-platforms tuples disabling/enabling the clocks > will switch the IP to the reset operation mode where registers' content is The register contents. > lost and reconfiguration needs to be done. For this the rabv_open() > function enables the clocks, switches the IP to configuration mode, applies > all the registers settings and switches the IP to the operational mode. At > the end of ravb_open() IP is ready to send/receive data. > > In ravb_close() necessary reverts are done (compared with ravb_open()), the > IP is switched to reset mode and clocks are disabled. > > The ethtool APIs or IOCTLs that might execute while the interface is down > are either cached (and applied in ravb_open()) or rejected (as at that time > the IP is in reset mode). Keeping the IP in the reset mode also increases > the power saved (according to the hardware manual). > > Signed-off-by: Claudiu Beznea Reviewed-by: Sergey Shtylyov [...] > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index 9ff943dff522..0733b63ff910 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -1839,16 +1839,21 @@ static int ravb_open(struct net_device *ndev) > { > struct ravb_private *priv = netdev_priv(ndev); > const struct ravb_hw_info *info = priv->info; > + struct device *dev = &priv->pdev->dev; > int error; > > napi_enable(&priv->napi[RAVB_BE]); > if (info->nc_queues) > napi_enable(&priv->napi[RAVB_NC]); > > + error = pm_runtime_resume_and_get(dev); > + if (error < 0) > + goto out_napi_off; > + Note that sh_eth.c does this before enabling NAPI... [...] MBR, Sergey