From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 1A0533064BC for ; Thu, 23 Oct 2025 16:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761236603; cv=none; b=Od35TwLEnmC6+Y8epC/oF2FV9RdD+KqzjxAbUSjRKPFHNVVJL3CsxqIhYTKiD/mGAsIIBQPm53D7yvaFdceyvdM5LJhuJ4r21x3pVW+PJkm3a5I14STaFwBVaAgw6sy4na1RZqgYROKrzxO6V4ZzuOLepPpT94wqV/OfvTCStGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761236603; c=relaxed/simple; bh=VxuFG5ZOb+yiTUfj4Jo43jlD7WQcjBC2WiJgbz5FXPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tPhJZVplQmnbyxcZt5jcoZaBHbcLqibCl4PInWKhw6Uyd53WW8LjIEETh2JrP4slo3edDLQkQvd8eh1wO2CbcK47Pg6C63ievHq0VZU46LS4PHkZ/eIoKGWrC9i8Pcu//0dHUGNtU/GBo2+H3FdWGqG4Kci9x+NdqmpREJ0rTuo= 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=RVH7+xo3; arc=none smtp.client-ip=185.246.85.4 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.b="RVH7+xo3" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 9935C4E4127A; Thu, 23 Oct 2025 16:23:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6E9C1606DE; Thu, 23 Oct 2025 16:23:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9DD5A102F2468; Thu, 23 Oct 2025 18:23:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761236598; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=oBXojVXIJFwozhhdkYSIxwYVsagkOAhdOoi1g9O4htk=; b=RVH7+xo3dhYwkMq7Nio+SEmYJbP8aCbk728R4zu71+rXa6D7Za0+xuNYWszrW65MZA2iYW b6UIWbgqz67BtRb8HllFF1XxbbHewP2ZE3HVhIwG4gQEto8FWWcTynEZeA9I9Angk0SZMz QMANvA4YpsZawXTnLox/uT51bPPZCrY1ahr2DqikjQZzytIwWMNMQxw3qgO6kbP40pb45K kWUkDwJK1DJv9PxC3/Q9a/9hLd1RM1y0aG+1p+6KGNXuAc7qFNtAGDMTqbdcVelJzWJoVe rdsp50GgrH8OsX0kdQDW8TqWxOk5i0gud5jtgMxp29JV563IKnN7zUsI3xrudw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Thu, 23 Oct 2025 18:22:53 +0200 Subject: [PATCH net-next v3 3/5] net: macb: add no LSO capability (MACB_CAPS_NO_LSO) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20251023-macb-eyeq5-v3-3-af509422c204@bootlin.com> References: <20251023-macb-eyeq5-v3-0-af509422c204@bootlin.com> In-Reply-To: <20251023-macb-eyeq5-v3-0-af509422c204@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , =?utf-8?q?Gr=C3=A9gory_Clement?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , Vladimir Kondratiev , =?utf-8?q?Th=C3=A9o_Lebrun?= , Andrew Lunn X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 LSO is runtime-detected using the PBUF_LSO field inside register DCFG6. Allow disabling that feature if it is broken by using bp->caps coming from match data. Reviewed-by: Andrew Lunn Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 93e8dd092313..05bfa9bd4782 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -778,6 +778,7 @@ #define MACB_CAPS_DMA_64B BIT(21) #define MACB_CAPS_DMA_PTP BIT(22) #define MACB_CAPS_RSC BIT(23) +#define MACB_CAPS_NO_LSO BIT(24) /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index be3d0c2313a1..8b688a6cb2f9 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4564,8 +4564,11 @@ static int macb_init(struct platform_device *pdev) /* Set features */ dev->hw_features = NETIF_F_SG; - /* Check LSO capability */ - if (GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) + /* Check LSO capability; runtime detection can be overridden by a cap + * flag if the hardware is known to be buggy + */ + if (!(bp->caps & MACB_CAPS_NO_LSO) && + GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) dev->hw_features |= MACB_NETIF_LSO; /* Checksum offload is only available on gem with packet buffer */ -- 2.51.1