Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1045488rdb; Wed, 24 Jan 2024 03:16:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXDiPP2btk+5FlJGQMGEjUqkadoQKQEU/51fMCQkQ2RVJ4Ktv9VKlB5cbHrth5LEu/LBet X-Received: by 2002:a05:6402:1816:b0:559:ed71:9da4 with SMTP id g22-20020a056402181600b00559ed719da4mr1724673edy.54.1706094999358; Wed, 24 Jan 2024 03:16:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706094999; cv=pass; d=google.com; s=arc-20160816; b=yHQrM8k49Y8Taw4bR7ggA6Jo0lQHqYd40ohMu6FMm2NRxGuH61c2LvvUBula2yX5ng qnh9Y6AUFdfINxMPNAdMgJ5ghAjqVnSa6eswuvY8xqcdxdhZCjBhyDdKpcDTFHTNtEqQ 01yfn2p/3ebNI8TT5WtKO1BVtS5zJ/I2yWn3yxR+FkQ/K5yWn206R5uCZlJPyqfK0dnR lSye9bSZZ99lVhaXX3q1SxBsvxTnY0rGKUeP1E0ql9EeigQeHyQwCX5csileeO+fGXWl OZ9Prqc6Xxl0HXWQUZ8UCqVdayI/2AMa4Wdwrn5IEPdaY7QecEjbeRkTIiQvAdfSs1FM Pq1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=cQHkYbac2Sl4VM3IelnZJJZvNleCCL30OPSnoeaFEVU=; fh=UyecQQQXnYrqJOxUwLOxxxo1ko/XVjNRN6+YZN+rtNE=; b=fLngtQW2v0YTleBu7BJ/pEVkJzM66viLHQjinaYhI1U/1MiPyvYjGZXQ6NVOl2mRX4 1W4jmDdbpeSmzh+23R+b0cvQUjK3UcEg0peUJjqMviqupuPelohlAaGSV3ytPOGkPvZu bx/7nzT2TQSW/S2Bcqsixk+ZsK5bykqWMkrm8ERfRGaqeJOo5DcvYK8X8CE+3mLUqjFE 7+t2n38GNRHzHeE7YWOmsUqzOf/iLGJHAIU7/MSJwZvcPz2RSwk7tHHHjjFrJvsVVu9r bGfveW99eGaukmAQYt6TSSGb7w25eKeOR8MDVuBlKpWzkL/CZYastUvRArpCj01Znfio aSSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=jUXCPW+z; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-35291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35291-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e2-20020a50a682000000b0055c029ae678si4320574edc.480.2024.01.24.03.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 03:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=jUXCPW+z; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-35291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35291-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 CD3411F26AA8 for ; Tue, 23 Jan 2024 13:00:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D80565F840; Tue, 23 Jan 2024 12:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="jUXCPW+z" Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F25065F540 for ; Tue, 23 Jan 2024 12:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014776; cv=none; b=Igbn2A2VkBCM/S+GffAJH0mIhwiVUgOIJE3au57KfpIywmtqUjKjEQmTmGmbFUrg3NBLMcwIulLoMhXRiJSLQOM1T71bQLq6z7E6bSxStVsVOJI/Vh47QV9Tb2rSeHrXz2AddvI2oLroeAWBPEhn00xOr8OFQy3f6kJr9tk6V4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014776; c=relaxed/simple; bh=Jz8kZzB2H2602ULXRUMwCZByqfrvauZa0dgw0w7Ggz0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Wp1kwD6JdSNE3Iqpqw6gI/1d3r71f/GzCJviyhHWpBxfqf/so+Z1owKLEVKxENlHWmCugHixHO8y3uA64AM4TRheRMYjfvYPJd3Ld7WSf2SpyG5mtTumyIyPR99L/4CnLhn3IpZ3Eohr1FDNWpDX7alNjrx1eiX7jkd683xFr6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=jUXCPW+z; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40e9d4ab5f3so46258205e9.2 for ; Tue, 23 Jan 2024 04:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1706014772; x=1706619572; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cQHkYbac2Sl4VM3IelnZJJZvNleCCL30OPSnoeaFEVU=; b=jUXCPW+zHk5+mtGu+QhVTrzAzK8HxD2t/VKCfIIFjCdVXRCRTYLMuQAAbzldlH3vZ/ j4Fqmx2lQq9/PkGynKPI2GHtUDP1r84daeimkyjxvr3X0BE0SZ5lwYifyEpe9wWSVgnP Z903z6ZYMqGoBw+3GzcyBy+G8+tT+7ByNx3LaaUd0ei9d8ztHJO7/PLB2ka0spiCVxWg kgL/TutfPbAXQ5Iqzp/Of1CgLQn1fHQq5QvM9KL1jtXySJhyzQZ8YOWZ0NywEMkklNKz BIR9ppvZTcKwbSV/pFJIKNnUVQgNw9BIV+rnVCQ961duhFz5ptgf6tGMuKBEVTp6GJBz x5UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706014772; x=1706619572; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cQHkYbac2Sl4VM3IelnZJJZvNleCCL30OPSnoeaFEVU=; b=PDeQ9thNjMDY+eFiIG1Y3JdUJEli7PTcVQzJxkeSPrWLbClrAMFSkfjTfb+UtPqr5n HVyf9Rm/uv3u0A1IjZowJ2AWnrSB7vzviXioqAtSYqtETEH4lSX6QJS42Pleuz4ap1h0 WxhHjAWQFNy5/yNs6b6vOh6IoutF0RcKBRoDkG2yOa1VDgOQtU8FZpgVfYFCoQWcpR9P gjmgFNU7vmOlWNTAA8jjGI/L859MP6bzB5prNc5CMjDYo6m5pdt2lMbc7Bo7plZPOFhX IEaY+HYMcAdIQLihPFDJsFemRVqUCmDghhhkIfSWmx+q0EvO6QAbTHjiR4kpgg5mokez QlaQ== X-Gm-Message-State: AOJu0YyVyqQpOj8VuMjFRlYp2D42BEgbUX1o8H6VMKe0lSY3HaflbtEC 8JsgRwUSH4aL98SKfK4r19+5RsCraqiHSMkeZKVBIVRywdyNBX0Qd4ybTJgP5tMC2diKsWNLJj5 K X-Received: by 2002:a7b:c397:0:b0:40e:4d77:dbf7 with SMTP id s23-20020a7bc397000000b0040e4d77dbf7mr109418wmj.163.1706014772033; Tue, 23 Jan 2024 04:59:32 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.135]) by smtp.gmail.com with ESMTPSA id s4-20020a05600c45c400b0040e6ff60057sm33655711wmo.48.2024.01.23.04.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 04:59:31 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, geert+renesas@glider.be Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH net-next v4 00/15] net: ravb: Prepare for suspend to RAM and runtime PM support (part 1) Date: Tue, 23 Jan 2024 14:58:14 +0200 Message-Id: <20240123125829.3970325-1-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea Hi, This series prepares ravb driver for runtime PM support and adjust the already existing suspend to RAM code to work for RZ/G3S (R9A08G045) SoC. As there are IP versions that switch to module standby when disabling the clocks, and because of module standby IP switches to reset and the register content is lost, to be able to have runtime PM supported for all IP variants, the configuration operations were moved all to ravb_open()/ravb_close() letting the ravb_probe() and ravb_remove() to deal with resource parsing and allocation/free. The ethtool and IOCTL APIs that could have been run asyncronously were adapted to return if the interface is down. As explained in each individual commits description, this should be harmless. Along with it, the series contains preparatory cleanups. The series has been tested on the boards with the following device trees: - r8a7742-iwg21d-q7.dts - r8a774a1-hihope-rzg2m-ex.dts - r9a07g043u11-smarc-rzg2ul.dts - r9a07g054l2-smarc-rzv2l.dts - r9a07g044l2-smarc-rzg2l.dts Thank you, Claudiu Beznea Changes in v4: - changed cover letter title and keep on 15 patches in series to cope with requirement at [1] - add dependency on RESET_CONTROLLER in patch "net: ravb: Make reset controller support mandatory" - use pm_runtime_active() in patch "net: ravb: Move the IRQs get and request in the probe function" - set config more before reading the mac address in patch "net: ravb: Set config mode in ndo_open and reset mode in ndo_close" - collected tags [1] https://www.kernel.org/doc/html/v6.6/process/maintainer-netdev.html#tl-dr Changes in v3: - collected tags - addressed review comments - squashed patch 17/21 ("net: ravb: Keep clock request operations grouped together") from v2 in patch 07/19 ("net: ravb: Move reference clock enable/disable on runtime PM APIs") from v3 - check for ndev->flags & IFF_UP in patch 17/19 and 18/19 instead of checking netif_running() - dropped patch 19/21 ("net: ravb: Do not set promiscuous mode if the interface is down") as the changes there are not necessary as ndev->flags & IFF_UP is already checked at the beginning of __dev_set_rx_mode() - remove code from ravb_open() introduced by patch 20/21 ("net: ravb: Do not apply RX CSUM settings to hardware if the interface is down") from v2 as this is not necessary; driver already takes care of this in ravb_emac_init_rcar() Changes in v2: - rework the driver (mainly, ravb_open() contains now only resource allocation and parsing leaving the settings to ravb_open(); ravb_remove() has been adapted accordingly) to be able to use runtime PM for all IP variants; due to this number of patches increased - adjust previous series to review comments - collected tags - populated driver's own runtime PM ops with enable/disable of reference clock Claudiu Beznea (15): net: ravb: Let IP-specific receive function to interrogate descriptors net: ravb: Rely on PM domain to enable gptp_clk net: ravb: Make reset controller support mandatory net: ravb: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr() net: ravb: Use tabs instead of spaces net: ravb: Assert/de-assert reset on suspend/resume net: ravb: Move reference clock enable/disable on runtime PM APIs net: ravb: Move the IRQs get and request in the probe function net: ravb: Split GTI computation and set operations net: ravb: Move delay mode set in the driver's ndo_open API net: ravb: Move DBAT configuration to the driver's ndo_open API net: ravb: Move PTP initialization in the driver's ndo_open API for ccc_gac platorms net: ravb: Set config mode in ndo_open and reset mode in ndo_close net: ravb: Simplify ravb_suspend() net: ravb: Simplify ravb_resume() drivers/net/ethernet/renesas/Kconfig | 1 + drivers/net/ethernet/renesas/ravb.h | 6 +- drivers/net/ethernet/renesas/ravb_main.c | 738 +++++++++++------------ 3 files changed, 352 insertions(+), 393 deletions(-) -- 2.39.2