All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Markus Schneider-Pargmann <msp@baylibre.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Sasha Levin <sashal@kernel.org>,
	rcsekar@samsung.com, mailhol.vincent@wanadoo.fr,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-can@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.10 01/18] can: m_can: Limit coalescing to peripheral instances
Date: Tue, 10 Sep 2024 13:21:46 -0400	[thread overview]
Message-ID: <20240910172214.2415568-1-sashal@kernel.org> (raw)

From: Markus Schneider-Pargmann <msp@baylibre.com>

[ Upstream commit e443d15b949952ee039b731d5c35bcbafa300024 ]

The use of coalescing for non-peripheral chips in the current
implementation is limited to non-existing. Disable the possibility to
set coalescing through ethtool.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240805183047.305630-8-msp@baylibre.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/can/m_can/m_can.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 14b231c4d7ec..6f5899f2e593 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2129,7 +2129,7 @@ static int m_can_set_coalesce(struct net_device *dev,
 	return 0;
 }
 
-static const struct ethtool_ops m_can_ethtool_ops = {
+static const struct ethtool_ops m_can_ethtool_ops_coalescing = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS_IRQ |
 		ETHTOOL_COALESCE_RX_MAX_FRAMES_IRQ |
 		ETHTOOL_COALESCE_TX_USECS_IRQ |
@@ -2140,18 +2140,20 @@ static const struct ethtool_ops m_can_ethtool_ops = {
 	.set_coalesce = m_can_set_coalesce,
 };
 
-static const struct ethtool_ops m_can_ethtool_ops_polling = {
+static const struct ethtool_ops m_can_ethtool_ops = {
 	.get_ts_info = ethtool_op_get_ts_info,
 };
 
-static int register_m_can_dev(struct net_device *dev)
+static int register_m_can_dev(struct m_can_classdev *cdev)
 {
+	struct net_device *dev = cdev->net;
+
 	dev->flags |= IFF_ECHO;	/* we support local echo */
 	dev->netdev_ops = &m_can_netdev_ops;
-	if (dev->irq)
-		dev->ethtool_ops = &m_can_ethtool_ops;
+	if (dev->irq && cdev->is_peripheral)
+		dev->ethtool_ops = &m_can_ethtool_ops_coalescing;
 	else
-		dev->ethtool_ops = &m_can_ethtool_ops_polling;
+		dev->ethtool_ops = &m_can_ethtool_ops;
 
 	return register_candev(dev);
 }
@@ -2337,7 +2339,7 @@ int m_can_class_register(struct m_can_classdev *cdev)
 	if (ret)
 		goto rx_offload_del;
 
-	ret = register_m_can_dev(cdev->net);
+	ret = register_m_can_dev(cdev);
 	if (ret) {
 		dev_err(cdev->dev, "registering %s failed (err=%d)\n",
 			cdev->net->name, ret);
-- 
2.43.0


             reply	other threads:[~2024-09-10 17:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 17:21 Sasha Levin [this message]
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 02/18] can: mcp251xfd: mcp251xfd_ring_init(): check TX-coalescing configuration Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 03/18] ASoC: Intel: soc-acpi-cht: Make Lenovo Yoga Tab 3 X90F DMI match less strict Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 04/18] ASoC: intel: fix module autoloading Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 05/18] ASoC: google: " Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 06/18] ASoC: tda7419: " Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 07/18] ASoC: " Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 08/18] ASoC: mediatek: mt8188-mt6359: Modify key Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 09/18] spi: spidev: Add an entry for elgin,jg10309-01 Sasha Levin
2024-09-10 17:27   ` Mark Brown
2024-09-18 22:43     ` Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 10/18] ASoC: amd: yc: Add a quirk for MSI Bravo 17 (D7VEK) Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 11/18] clk: qcom: gcc-sm8650: Don't use shared clk_ops for QUPs Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 12/18] ALSA: hda: add HDMI codec ID for Intel PTL Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 13/18] drm: komeda: Fix an issue related to normalized zpos Sasha Levin
2024-09-10 17:21 ` [PATCH AUTOSEL 6.10 14/18] spi: bcm63xx: Enable module autoloading Sasha Levin
2024-09-10 17:22 ` [PATCH AUTOSEL 6.10 15/18] Revert "wifi: ath11k: restore country code during resume" Sasha Levin
2024-09-10 17:22 ` [PATCH AUTOSEL 6.10 16/18] smb: client: fix hang in wait_for_response() for negproto Sasha Levin
2024-09-10 17:22 ` [PATCH AUTOSEL 6.10 17/18] platform/x86/amd: pmf: Make ASUS GA403 quirk generic Sasha Levin
2024-09-10 17:22 ` [PATCH AUTOSEL 6.10 18/18] ice: check for XDP rings instead of bpf program when unconfiguring Sasha Levin
2024-09-10 17:22   ` [Intel-wired-lan] " Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240910172214.2415568-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=msp@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rcsekar@samsung.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.