Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1897225lqp; Tue, 16 Apr 2024 00:32:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDnifJlYD++j0bfc6rG/Bb8LnZ0hP0u0cPzZyIoOz7ec3EhKkwwBXVWdFZd6SZbtAW9UotTtfFdyB1HteKgRKzhqkc1hdXKFGQyRdr7A== X-Google-Smtp-Source: AGHT+IEFBCuC/y3izw3JixOK1OIRXOZvY5lpl0HtM+422i3+DODbXhnjI8SngVGYpwx4liHi3CD8 X-Received: by 2002:a05:6808:6147:b0:3c6:127c:3509 with SMTP id dl7-20020a056808614700b003c6127c3509mr13374687oib.22.1713252772179; Tue, 16 Apr 2024 00:32:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713252772; cv=pass; d=google.com; s=arc-20160816; b=jzOXdiFU/uiJuMdn/VfNS03wzxt8Vj3kgd5DSGFEiS8m9sm+4e4mROxluC0x/VwEGL XBzT9L90fNNN5mYDRj6EeQNEkkauCg+evFEceAvhmmQtV2IAJp0LIjNfRTwhgvRcbek2 mvHSzu5ooSiBMte1Dc5kJh5AT7GdNi8z6ryDs5V0dEUXtv1Tyy3VrREIZhd2Yn1RITj3 Dm6EaxVxC6mwNsc07van9lPNAsH8ueTvXDteSZSzCSw9G5GYq5W0AUX7gGu+1TB7lLmw KDpxIefDoeURRK7dWZEFrMstm7JNFo9y6c50f43wTc1qkIhyMuJZz1y9EedyYXz3Csdu IQ4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=d+J9a1XsY9wVIqCw//2fmPUH+b6/wrcvkVKiCmqi9U0=; fh=YgAfZTIs+BaXb4thQBxgKVr138aW/8if4cpTFuugzD0=; b=dqmPBy+h0soCR7QXfnce96uxRe6zlHmFtUxRchfUEy+7i0TQOSiKrjQf+mP/UIzi/H SBC9ox2AmMgZ4N29x/OWNw7YJTzcFVdn9JgnYeg77gKP023iUKrjbdUg05ZFN1S+D4/S kEgbhXHfluSoUYRIgzRa8xSpkWU2SYDkAQtDOmvKimqEmnhzNz7I7dChvJTIesfPjghT gciULCWUdAZPpots5SA73IsFHy519y8MvQjyso4VH2EnTOGORhXRuUUg0QrWkhDLxABV tja/nhdx6oMlE7kDqkizMdPs38b3vF3NIjVX+I7om093H3bqa31Yt6ExYfJn1Q+8upY1 Gumg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GA0sZrWA; 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-146432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q8-20020a632a08000000b005f76107ec97si2744119pgq.247.2024.04.16.00.32.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 00:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GA0sZrWA; 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-146432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146432-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C64612845FD for ; Tue, 16 Apr 2024 07:32:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3768811E6; Tue, 16 Apr 2024 07:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GA0sZrWA" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 7A71C3B78B; Tue, 16 Apr 2024 07:32:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713252761; cv=none; b=Culvy7hYLI11XvgYSj2kcN9O3BXdrGaWHWulX/cGd9BSbDuoap6QOlLnj/eW0jtAKwvuu8PNlPuTaiyG+EHbsWeEWIt6seUzxoiKFkghFVTmW6UWfmsLmUgDuS/tFlCKuP7KKtaEg9anae6yZebdcfsYCwdiVZH3BBxaBcNHW4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713252761; c=relaxed/simple; bh=FIgGURLFLfp2cIyxqCz3adqRLXcVtc3KCQ+iVrL+UIg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=MhQKoNdtT7H5Py4AYQjg4U4XIL/oDcX6pR1ZtSUYhizWI7Bx3M7wzAV31zj9p4T6JDaqMwzafRWJTE76VNDNf4YPkWtbIRXcKd/BEniORIWi8xQPZjnYFU82yw6HEBiFp1irvHyIL+o2YvHRYTocfQQdbaSti6zzeYgKjSzchqs= 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=GA0sZrWA; arc=none smtp.client-ip=217.70.183.200 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 275042000A; Tue, 16 Apr 2024 07:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713252749; 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: in-reply-to:in-reply-to:references:references; bh=d+J9a1XsY9wVIqCw//2fmPUH+b6/wrcvkVKiCmqi9U0=; b=GA0sZrWAe9372nqCrt2w7l3ynepzPOSCskMsWstQkbv2DpTvZPxFBHPt7qJ4ExbwTtq4ip CrFWLht6zyQ7ZUwa91cwhKzBzmzZJ/kMkknRvUEC++beLzXMd2Xkwkc9HQWcQ3CzyGvIbL xJPQyVQJRa3SUg1V8XXeJyu71kDHv5JbYQZeBFFy+1IvQNn93U7ruseGnNfN3kUTJTV7Q3 WBLULJmsDOZ/h82mvh+w+Il0JRcinK2JiAIYmxgh6puuvM3F7h9QlIiaey91hR/8x/QzKO NNK9c6LTOEc0ftlg4mAc8IFuOIuYAXv/OfZFlWyppJh5aPCWzmG3P/goyDrRKg== Date: Tue, 16 Apr 2024 09:33:04 +0200 (CEST) From: Romain Gantois To: Serge Semin cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Yanteng Si , Maxime Coquelin , Michael Sit Wei Hong , "Gan, Yi Fang" , Simon Horman , Huacai Chen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 2/4] net: stmmac: Fix max-speed being ignored on queue re-init In-Reply-To: <20240412180340.7965-3-fancer.lancer@gmail.com> Message-ID: References: <20240412180340.7965-1-fancer.lancer@gmail.com> <20240412180340.7965-3-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-GND-Sasl: romain.gantois@bootlin.com On Fri, 12 Apr 2024, Serge Semin wrote: > It's possible to have the maximum link speed being artificially limited on > the platform-specific basis. It's done either by setting up the > plat_stmmacenet_data::max_speed field or by specifying the "max-speed" > DT-property. In such cases it's required that any specific > MAC-capabilities re-initializations would take the limit into account. In > particular the link speed capabilities may change during the number of > active Tx/Rx queues re-initialization. But the currently implemented > procedure doesn't take the speed limit into account. > > Fix that by calling phylink_limit_mac_speed() in the > stmmac_reinit_queues() method if the speed limitation was required in the > same way as it's done in the stmmac_phy_setup() function. > > Fixes: 95201f36f395 ("net: stmmac: update MAC capabilities when tx queues are updated") > Signed-off-by: Serge Semin > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index dd58c21b53ee..b8a1f02398ee 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -7328,6 +7328,7 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) > { > struct stmmac_priv *priv = netdev_priv(dev); > int ret = 0, i; > + int max_speed; > > if (netif_running(dev)) > stmmac_release(dev); > @@ -7343,6 +7344,10 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) > > stmmac_mac_phylink_get_caps(priv); > > + max_speed = priv->plat->max_speed; > + if (max_speed) > + phylink_limit_mac_speed(&priv->phylink_config, max_speed); > + > stmmac_napi_add(dev); > > if (netif_running(dev)) > -- > 2.43.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > Reviewed-by: Romain Gantois