From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796559843; b=w+0+Ozq6XAzZG+/QqHWuMDuxNpL/Sn8MyB5EVUuzK6ykiDVBToYTPfZuJelvBwFZ74ex sxqlOw9WNkd0bnVqpXazEHh8uWvzlXE8Wgmp6P4f586E2ujZdf0OewfczhyOd5OdR2p1j 9rB5qFMJRpseUxWGZiQKy7S0xIfcrfvKDqKqkIwzUOBvEmoRGXwSoS5qn5R9lcK3ZlUZS AsQbhsEj1BCCfpHxGoBiC8tVx7+sVDja/eJ6ZWZ/FKD0/u5zjlH8yOPbrT+3bFHqwiVlq l7thQXJuSHX8PkYUMA22agjiB8HL4GohoG2jHleLLeTeEtyCaRbIGrkTkbc89gHI4DA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796559843; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=JnYPGZ8BjdqaK3g1qvQIsg4CbML9RcFhXF2QkKTcG3o=; b=pjSwjA0S/fMB9hrb+zl0D1UU9LRIUYaYcaWvey9RI5T9dgZEjCsAuA7j4DCO+gpsMK0c 6Tp1XZlKRpemPGAW09FeDo8lAENA6MkW9Ju1b2O1SQwliZHAbicjEsIhvQmzMmjV6vJ8v AWqz/I8TYrLn7/HaYaEhwmlWBeBoCKdlpVrYA4SqRiaWSTNzZ3MsMGQap34u0gRQyJ9zg o8+0gC1JtCUZkIKbww7GBfvLaXtHmCZPEAEst1MxWH4ceagbrmAJ/T4e+fW/uu+HN5AJu m6/wPDS1QAE9y1V6e2aDZJ6s87fo/alFdmvFjHzK1nPpr3zurjcNUqY28ibn3j4Kedg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=AW1rJMM6; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE5AD606A322 for ; Sun, 6 Dec 2026 12:24:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE5AD606A322 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=AW1rJMM6 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id EB21FC026F7; Sun, 6 Dec 2026 12:24:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 26191604C0; Sun, 6 Dec 2026 12:24:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 041A511EA00AE; Sun, 06 Dec 2026 13:23:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796559839; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=JnYPGZ8BjdqaK3g1qvQIsg4CbML9RcFhXF2QkKTcG3o=; b=AW1rJMM6SVL43jEv6YgnIXLKsnlfW5hx6Vqk4vtB5owcYsCOYeZDI4dcJ5nrhfusfD6GBq rYiwipSeyd6ZUE+zG0Q/j8biY1kocS7e2ch0gMGWLYe9isvOShx1QYQA7IlfNebmLs2U8D Lu1ZZn3oXuiJF4kjL9ymbgXOR6gVYDfOPsgv7eMqz3rtVSJMzQUTBrv1gzAMDrZEct3d0v IvP5xId42y5hMct9X48+l3Dg5qezRB6w13v5L1WFWDWDKTXnAPWhBO5VdHFJD0q5ja7buX tFCfOcetcvLXCgKX6us5TTpozvZA8+klO2+W3y841IluyAQyw/E4/zkEw2yVVg== Message-ID: <40dbae2a-5ca1-4f04-b48f-a74aeaf11ab1@bootlin.com> Date: Sun, 6 Dec 2026 13:23:50 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net: stmmac: keep RXC running for atomic filter updates To: Lorenzo Bianconi Cc: Mohd Ayaan Anwar , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Russell King , "Russell King (Oracle)" , Jacob Keller , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20261205-stmmac-keep-rxc-running-v1-1-35f8cb71cb98@oss.qualcomm.com> Content-Language: en-US From: Maxime Chevallier In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi, On 12/6/26 13:07, Lorenzo Bianconi wrote: >> Hi, >> >> On 12/5/26 18:31, Lorenzo Bianconi wrote: >>> stmmac_phylink_setup() allows the PHY to stop the RX clock in LPI >>> whenever the platform does not need RXC in LPI and no VLAN features are >>> advertised. The VLAN feature check was only a proxy for "the driver may >>> program RXC-dependent registers from atomic context": >>> stmmac_set_rx_mode() and the VLAN filter callbacks run with bottom >>> halves disabled and cannot use phylink_rx_clk_stop_block(). >>> >>> That proxy is fragile because it changes with the advertised offload >>> set, and it does not cover CONFIG_VLAN_8021Q=n. A filter update while the >>> link is in LPI with RXC stopped can be lost, leaving the hardware filter >>> out of sync with the software address lists. >>> >>> Since the driver cannot know whether a filter update will happen while >>> RXC is stopped, keep RXC running and never let the PHY stop it during >>> LPI. A platform that has verified its filter programming does not need >>> RXC can restore the power saving in a follow-up with an explicit opt-in. >>> >>> STMMAC_FLAG_RX_CLK_RUNS_IN_LPI is now redundant, so remove it and its >>> qcs404 setting; keeping RXC running everywhere supersedes it. >> >> That would introduce some power consumption impacts though no ? > > Yes, you are right. I guess this is a trade-off between correctness and > simplicity of the fix. > If we disable CONFIG_VLAN_8021Q (CONFIG_VLAN_8021Q=n) there are multiple spots > (not just ndo_set_rx_mode_async()) where we can access sensible DMA/MAC regs > while the RXC clock is gated. > I drafted a possible fix in [0] but as you can see it is much more complex :) > > Regards, > Lorenzo > > [0] https://github.com/LorenzoBianconi/net-next/commit/87da83ada7e971e78908ccbd5bbe104b00654124 Quickly looking at it, it's complex but not as bad as I expected, this can be a nice series on its own :) It's important we get this right, the RXC thing have been a never ending source of problems with dwmac, and we have the plumbing in phylink to deal with that, I'd be very happy with this being behind us ! but hey we know how it goes now, 3 patches in a small series, a few sashiko replies and suddently we have a 20-patches backlog... Do you feel like sending your more complete change ? Maxime