From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 4177839E177 for ; Thu, 5 Mar 2026 12:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772715269; cv=none; b=lBwfNivFuD52xcHMrZspOCDLy2D46O2itvZ3SvxWNmSOssRD+/aBQcF8hYrVRvlRDZnuxX7JMTxVIeiVIF2+mnGeQgqCAhKRGK3jwb8G3YBZYELTm3yNLrKbDvXexED9MWVWb+vN8j/DdJHMfMV6PnFufXzZ4UZT9oy7ksKboeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772715269; c=relaxed/simple; bh=ZkqqxNAsdLLOBBCCtVYLv2vL79nqgo/zs6NdcEtLMU0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=t//oceWZKGoUd4P95sFc/Ng9n9RUyJylBnjkmHe63kbR8kKUDbOyWwoc4P5S6dDqrEY9l9crWgjpM4cAITUimH18JOR9LeguYv1brMqBg4C8dNV3dBvku8ccUHI4b5VjABig2zOMNzTNkk57/8yJgSu+MeNHAuHRq8EvWGYyLO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GcK+iLwI; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=rvAfqYF/; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GcK+iLwI"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="rvAfqYF/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772715267; 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=2ozPyRLvFVo7RkDuja3Q6t/+2zK1nnxP+IcGjhg3LBE=; b=GcK+iLwIq1CBzFFZzgleJYz5UClczGCjcMVBIyt5epHYgRVPqi7ufLPR+m4cQ95NErOMuu ujtqAKfvDC2eKyRWwX9iAYV4XAugKRK7frC2Ohinde0aPHhPdOgGZWoiyb9hLIN/JPmKt6 KpPYKfJP+pYaWjz9INZXoidmVTh//os= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-QkBRrbnmMJSV97IhDunMWg-1; Thu, 05 Mar 2026 07:54:26 -0500 X-MC-Unique: QkBRrbnmMJSV97IhDunMWg-1 X-Mimecast-MFC-AGG-ID: QkBRrbnmMJSV97IhDunMWg_1772715265 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4837b9913c9so61058225e9.0 for ; Thu, 05 Mar 2026 04:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1772715265; x=1773320065; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=2ozPyRLvFVo7RkDuja3Q6t/+2zK1nnxP+IcGjhg3LBE=; b=rvAfqYF/Lj4DuWyOMzjh86JFlV69QA/r88Io7Zaz1wPd8xLvvxqo+K69CRIAeYhibZ G7Gf4BJxcD152VzZABSK3XsjYVXXqIpVBzegCczM04Zg3OIJReTSEJmBn/viPM4Abqwf VN9xtFE739f7MLR9kAgc9m/wX+rkfViNepPdcskK3jKrvEHn6fm65StFD/nw1XI5rJJ8 g9qCRDyym5BMIh5F8mi9RuUjTfcNFMoEhZtRLjSp5qtk/piOAPnq8NI2lkR5BXcmY7ht SDuIGQyr2VFf46w6yThy+t13/YqQ6ZAlFAjmxnBKv5LVP+qTxDzSfv0nOK6INwRKOaKT E9Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772715265; x=1773320065; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2ozPyRLvFVo7RkDuja3Q6t/+2zK1nnxP+IcGjhg3LBE=; b=m3WuOgp0Sc66O7zXrFdsu4YHgxXfYHjPTWl6+Y2X3yWdivDKZG7jSSgxcZf0zEImZF W7ZuCjfpnCPR8i9dKJubqPVK8HxARUfp4FQEjyq3hRJJKjWl4w1NzSICll3B3o60+36E m+b8DQV5ds9vCsSq45sdj0jTyOI6SmaMXKA3RNl3unM6tRKLDEiN68rBXbdpulCINLUz hXOOoasYjfLdDnB4Hwdis1h5h/Cjt0+mVCQGDvI2WITz9S/LV6/TV0L958JrtGpquiIL KU36BpQTe3KdJYXNddz+KyxtdC8k+JvmDQ7zKjuss6SXfezI2DCFx4rd4LMv7f2mRJRH 9e5g== X-Forwarded-Encrypted: i=1; AJvYcCX+o7Y/kHOSlJWTJCLuZ1RN7HmeHRiB3vlBre5GKnKL7QRKZUE2wCpJcEFj2CWxcbjoTmMY9Tko/bSQ7pc=@vger.kernel.org X-Gm-Message-State: AOJu0YzJ89UZ0G70lOHGiLht4ZF6pxu4D6ImNooGhrzWx8apZF7oA6y7 h/QLm+CrcnYCzK0ZquCFB0d/67pEUveFbwdJ+o5GPl4UrdimuZE3Mq+qc4B5e6v/hUlftuG6gzS DhUGMgmhA56H8wNBwHmI00Dp/XfEy0pctcEY0J63rsGAl+TB35fIDD2QaZhCHjNyhng== X-Gm-Gg: ATEYQzzRYauRUEySdbyT3JrwjRi0vnVTai9p4Y8G7Vh4KQWRKFLZHNOCSbPYnweQXsX ruMD7RGmqkn/2nbHd+4jY7xAecpwXCQAoK3FQJHk/74wNrpxWHksm8uSivDN2et/C0HB0JL5jUR I4j7VeAMeqvVZow2b94Njc5KXjqcFZBfqYO574TB7OFsjJoy7LjQd3NsDsOr98gYdlzrGvm+WV4 UrVkitup5JoWeWtz03QoRS7YuOVdmz3iFGpfShDGijNBVM3eLEOvWHcWddSLGDYUqDOfZyxFRpL CX/U2qfroDQcWQV3zfi/EXoclsx3u4yl8wwhrlismpIyyHRLxJEq4H9kOu40TluAXVpQjSBOwT9 +jFz1Umocc6ghZfvdL0hgQPqo1Q== X-Received: by 2002:a05:600c:4e8a:b0:47e:e9c9:23bc with SMTP id 5b1f17b1804b1-4851989fb4cmr84510315e9.30.1772715264979; Thu, 05 Mar 2026 04:54:24 -0800 (PST) X-Received: by 2002:a05:600c:4e8a:b0:47e:e9c9:23bc with SMTP id 5b1f17b1804b1-4851989fb4cmr84509955e9.30.1772715264550; Thu, 05 Mar 2026 04:54:24 -0800 (PST) Received: from [192.168.88.32] ([212.105.149.216]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439b0549600sm36034668f8f.35.2026.03.05.04.54.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Mar 2026 04:54:24 -0800 (PST) Message-ID: <5d147ef5-8f46-473f-9c9a-455e52ce9541@redhat.com> Date: Thu, 5 Mar 2026 13:54:22 +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 net] net: bcmgenet: fix bcmgenet_get_eee() clobbered by phy_ethtool_get_eee() To: Nicolai Buchwitz , Andrew Lunn Cc: Doug Berger , Florian Fainelli , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260303153918.538902-1-nb@tipi-net.de> Content-Language: en-US From: Paolo Abeni In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/5/26 9:50 AM, Nicolai Buchwitz wrote: > On 4.3.2026 22:57, Andrew Lunn wrote: >> On Tue, Mar 03, 2026 at 04:39:18PM +0100, Nicolai Buchwitz wrote: >>> bcmgenet_get_eee() sets the MAC-managed tx_lpi_enabled and >>> tx_lpi_timer >>> fields, then calls phy_ethtool_get_eee() which internally calls >>> eeecfg_to_eee() — overwriting eee_enabled, tx_lpi_enabled and >>> tx_lpi_timer with the PHY's eee_cfg values. For non-phylink MACs like >>> GENET, these PHY-level fields are never initialized (they are only set >>> by phylink via phy_support_eee()), so the ethtool report always shows >>> eee_enabled=false and tx_lpi_enabled=false regardless of the actual >>> MAC >>> state. >> >> I think the MAC driver is missing a call to phy_support_eee() to let >> phylib know the MAC supports EEE. Have you tried that. > > Thanks for the suggestion. I've incorporated phy_support_eee() and > tested it > with a Raspberry CM4. > > After applying the patch, the PHY correctly advertises EEE, negotiates > it with > the link partner, and ethtool reports: > > EEE status: enabled - active > > However, reading UMAC_EEE_CTRL directly: > > UMAC_EEE_CTRL = 0x00000040 (DIS_EEE_10M set, EEE_EN = 0) > UMAC_EEE_LPI_TIMER = 0x00000022 (34 us, hardware reset default) > > EEE_EN (bit 3) is never set - the MAC does not actually enter LPI. > priv->eee.eee_enabled stays false at init, so bcmgenet_mac_config() > never calls bcmgenet_eee_enable_set(). The result is ethtool advertising > "enabled - active" while zero power savings happen, which is worse than > the original bug. > > Likely root cause: phy_support_eee() sets eee_cfg.eee_enabled=true, > which > phy_ethtool_get_eee() -> eeecfg_to_eee() then reflects back as > eee_enabled=true - but that is PHY eee_cfg state, not MAC state. The > fix should override eee_enabled and tx_lpi_enabled from priv->eee after > calling phy_ethtool_get_eee(), since those fields are MAC-managed: > > ret = phy_ethtool_get_eee(dev->phydev, e); > if (ret) > return ret; > > e->eee_enabled = priv->eee.eee_enabled; > e->tx_lpi_enabled = priv->eee.tx_lpi_enabled; > e->tx_lpi_timer = bcmgenet_umac_readl(priv, UMAC_EEE_LPI_TIMER); > > This correctly separates what the PHY negotiated (eee_active, link > modes) > from what the MAC is configured to do. > > The deeper problem - that the MAC never enables LPI even when EEE is > successfully negotiated - was submitted separately to net-next [1]. It > initializes priv->eee.eee_enabled=true in bcmgenet_open() for GENET v2+, > matching what mvneta, mvpp2 and others do. > > Given how the two patches interact, I think they should go through net > as a 2-patch fix series - if there is consensus on that approach. > Sending > the fix alone would ship the misleading "enabled - active, no actual > LPI" > state. Makes sense to me, but it's probably better if you wait for Andrew's ack before proceeding. /P