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 AE48E433BC4 for ; Mon, 3 Aug 2026 20:09:08 +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=1785787750; cv=none; b=Ndo+wzt+ZTrG19ERIkZ5/P4J8P0JdXWpmDhCKijTHSMh0tvAlf7VKSKUchK6FvaHrHk8HUhKpqE4XbX36La7E8xcZ2QvLs4mPH8R57iiT+Jv0nyh0QqFOP00sxWjZmKYqmqKxvX6NlOMUe8QpPJG1CvmSygacjLdPSnofCigoMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785787750; c=relaxed/simple; bh=Zj8ljX2iP4cV10Q/+qiv29C4kXrtslw6skNOnU5A4zQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XpLC+6ZLztJkscszoTmBe2jlfbC6b9EJrX3CTyrPazh3ydaQtvG28Hx9g7bAe3AlFbSGDdjDaTbIOXmXbASqKUAchPOlJocRqLjeHDKNKCY5UHxl/qJEH/f68gnDlTNEJfavCFjttDciPJZJM/1N3GhmYoP5Tmbfc6apgeILOy4= 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=pyEND/lS; 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="pyEND/lS" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 102E14E410AE; Mon, 3 Aug 2026 20:09:07 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D33B96029B; Mon, 3 Aug 2026 20:09:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1BD2F11C31859; Mon, 3 Aug 2026 22:09:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1785787741; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=T4UQOD2lvOpEjM3yH3RxEruIPXtMmVbNk2g8lQpYEao=; b=pyEND/lScTJwLrHC48goSXzzPgB9r52kxnTxmm7/TS1/OLNcIPl5B2CEZjunXJGJwtksdX 2Mtk7EaNMi+oxNtb0bftP+m/SauGWnpl0iFiMiZ3xIBrqe/W5s/jL4G/dwWBt2Tc0eZKax LJl6gc17qgCJHFPwcDUeBx2BACG1U5TbGljDEnwwWMl3MNIhjB/XSh/3kB8Vsx+66G3T7z RFVEO+8R0OSLnX1QtFTqNjsxQFbUXKkJC8nM/JOPnMMGYAPkK8Gft8H5UOez0FWCCqRaKF to8ZFIgAl4OYMEtN6hRonZ4Gqi1W5OYrNGUMMa4kDRkIalFM83LIUzOuL5r2fQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Mon, 03 Aug 2026 22:08:14 +0200 Subject: [PATCH net-next v7 07/17] net: macb: refuse set_ringparam on EMAC 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="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260803-macb-context-v7-7-4d7d4af04849@bootlin.com> References: <20260803-macb-context-v7-0-4d7d4af04849@bootlin.com> In-Reply-To: <20260803-macb-context-v7-0-4d7d4af04849@bootlin.com> To: =?utf-8?q?Th=C3=A9o_Lebrun?= , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Ferre , Claudiu Beznea , Paolo Valerio , Nicolai Buchwitz , Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Beno=C3=AEt_Monin?= , Tawfik Bayouk , Thomas Petazzoni , Maxime Chevallier X-Mailer: b4 0.15.2 X-Last-TLS-Session-Version: TLSv1.3 EMAC has never supported changing ring sizes: RX is hardcoded to 9 and TX is the tiniest ring buffer you can imagine. Make sure the operation fails early rather than silently succeed and storing values in bp->configured_{rx,tx}_ring_size that are never read in the EMAC case. Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index af351d30adab..1476bce77f34 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3687,6 +3687,9 @@ static int macb_set_ringparam(struct net_device *netdev, u32 new_rx_size, new_tx_size; unsigned int reset = 0; + if (bp->caps & MACB_CAPS_MACB_IS_EMAC) + return -EOPNOTSUPP; + if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL; -- 2.55.0