All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"Ahmed S. Darwish" <a.darwish@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Denis Kirjanov <kda@linux-powerpc.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, ath9k-devel@qca.qualcomm.com,
	Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless@vger.kernel.org, Chas Williams <3chas3@gmail.com>,
	linux-atm-general@lists.sourceforge.net,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	linux1394-devel@lists.sourceforge.net
Subject: [patch 08/14] net: jme: Replace link-change tasklet with work
Date: Tue, 09 Mar 2021 09:42:11 +0100	[thread overview]
Message-ID: <20210309084242.106288922@linutronix.de> (raw)
In-Reply-To: 20210309084203.995862150@linutronix.de

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The link change tasklet disables the tasklets for tx/rx processing while
upating hw parameters and then enables the tasklets again.

This update can also be pushed into a workqueue where it can be performed
in preemptible context. This allows tasklet_disable() to become sleeping.

Replace the linkch_task tasklet with a work.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/net/ethernet/jme.c |   10 +++++-----
 drivers/net/ethernet/jme.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -1265,9 +1265,9 @@ jme_stop_shutdown_timer(struct jme_adapt
 	jwrite32f(jme, JME_APMC, apmc);
 }
 
-static void jme_link_change_tasklet(struct tasklet_struct *t)
+static void jme_link_change_work(struct work_struct *work)
 {
-	struct jme_adapter *jme = from_tasklet(jme, t, linkch_task);
+	struct jme_adapter *jme = container_of(work, struct jme_adapter, linkch_task);
 	struct net_device *netdev = jme->dev;
 	int rc;
 
@@ -1510,7 +1510,7 @@ jme_intr_msi(struct jme_adapter *jme, u3
 		 * all other events are ignored
 		 */
 		jwrite32(jme, JME_IEVE, intrstat);
-		tasklet_schedule(&jme->linkch_task);
+		schedule_work(&jme->linkch_task);
 		goto out_reenable;
 	}
 
@@ -1832,7 +1832,6 @@ jme_open(struct net_device *netdev)
 	jme_clear_pm_disable_wol(jme);
 	JME_NAPI_ENABLE(jme);
 
-	tasklet_setup(&jme->linkch_task, jme_link_change_tasklet);
 	tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet);
 	tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet);
 	tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet);
@@ -1920,7 +1919,7 @@ jme_close(struct net_device *netdev)
 
 	JME_NAPI_DISABLE(jme);
 
-	tasklet_kill(&jme->linkch_task);
+	cancel_work_sync(&jme->linkch_task);
 	tasklet_kill(&jme->txclean_task);
 	tasklet_kill(&jme->rxclean_task);
 	tasklet_kill(&jme->rxempty_task);
@@ -3035,6 +3034,7 @@ jme_init_one(struct pci_dev *pdev,
 	atomic_set(&jme->rx_empty, 1);
 
 	tasklet_setup(&jme->pcc_task, jme_pcc_tasklet);
+	INIT_WORK(&jme->linkch_task, jme_link_change_work);
 	jme->dpi.cur = PCC_P1;
 
 	jme->reg_ghc = 0;
--- a/drivers/net/ethernet/jme.h
+++ b/drivers/net/ethernet/jme.h
@@ -411,7 +411,7 @@ struct jme_adapter {
 	struct tasklet_struct	rxempty_task;
 	struct tasklet_struct	rxclean_task;
 	struct tasklet_struct	txclean_task;
-	struct tasklet_struct	linkch_task;
+	struct work_struct	linkch_task;
 	struct tasklet_struct	pcc_task;
 	unsigned long		flags;
 	u32			reg_txcs;


  parent reply	other threads:[~2021-03-09  8:46 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  8:42 [patch 00/14] tasklets: Replace the spin wait loops and make it RT safe Thomas Gleixner
2021-03-09  8:42 ` [patch 01/14] tasklets: Replace barrier() with cpu_relax() in tasklet_unlock_wait() Thomas Gleixner
2021-03-17 15:49   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09  8:42 ` [patch 02/14] tasklets: Use static inlines for stub implementations Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09  8:42 ` [patch 03/14] tasklets: Provide tasklet_disable_in_atomic() Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09  8:42 ` [patch 04/14] tasklets: Use spin wait in tasklet_disable() temporarily Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09  8:42 ` [patch 05/14] tasklets: Replace spin wait in tasklet_unlock_wait() Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Peter Zijlstra
2021-03-09  8:42 ` [patch 06/14] tasklets: Replace spin wait in tasklet_kill() Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Peter Zijlstra
2021-03-09  8:42 ` [patch 07/14] tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT Thomas Gleixner
2021-03-09 15:00   ` Sebastian Andrzej Siewior
2021-03-09 15:21     ` Sebastian Andrzej Siewior
2021-03-10  8:35       ` Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09  8:42 ` Thomas Gleixner [this message]
2021-03-17 15:48   ` [tip: irq/core] net: jme: Replace link-change tasklet with work tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 09/14] net: sundance: Use tasklet_disable_in_atomic() Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 10/14] ath9k: " Thomas Gleixner
2021-03-09 10:23   ` Kalle Valo
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 11/14] atm: eni: Use tasklet_disable_in_atomic() in the send() callback Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 12/14] PCI: hv: Use tasklet_disable_in_atomic() Thomas Gleixner
2021-03-09 22:17   ` Bjorn Helgaas
2021-03-10 11:34   ` Wei Liu
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 13/14] firewire: ohci: Use tasklet_disable_in_atomic() where required Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2021-03-09  8:42 ` [patch 14/14] tasklets: Switch tasklet_disable() to the sleep wait variant Thomas Gleixner
2021-03-17 15:48   ` [tip: irq/core] " tip-bot2 for Thomas Gleixner
2021-03-09 14:04 ` [patch 00/14] tasklets: Replace the spin wait loops and make it RT safe Peter Zijlstra

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=20210309084242.106288922@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=3chas3@gmail.com \
    --cc=a.darwish@linutronix.de \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=frederic@kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=kda@linux-powerpc.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=kys@microsoft.com \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=robh@kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@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.