From: Kun Luo <luokun485@gmail.com>
To: Mathias Nyman <mathias.nyman@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Lu Baolu <baolu.lu@linux.intel.com>,
Kun Luo <luokun485@gmail.com>
Subject: [PATCH] xhci: dbgtty: convert rx push tasklet to BH workqueue
Date: Thu, 8 Oct 2026 20:06:05 +0800 [thread overview]
Message-ID: <20261008120605.174601-1-luokun485@gmail.com> (raw)
The kernel is converting remaining tasklet users to BH workqueues so
softirq handling can go through the workqueue path. The dbc TTY rx
push path is a straightforward bottom-half: schedule from IRQ /
unthrottle, run the same work, kill on port teardown.
Replace the tasklet with system_bh_wq. Behavior stays in softirq
context, so existing locking is unchanged.
Compile-tested only.
Signed-off-by: Kun Luo <luokun485@gmail.com>
---
drivers/usb/host/xhci-dbgcap.h | 2 +-
drivers/usb/host/xhci-dbgtty.c | 17 +++++++++--------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/xhci-dbgcap.h b/drivers/usb/host/xhci-dbgcap.h
index 5b18efb2c1ea..78e9b5e674a3 100644
--- a/drivers/usb/host/xhci-dbgcap.h
+++ b/drivers/usb/host/xhci-dbgcap.h
@@ -127,7 +127,7 @@ struct dbc_port {
struct list_head read_pool;
struct list_head read_queue;
unsigned int n_read;
- struct tasklet_struct push;
+ struct work_struct push;
struct list_head write_pool;
unsigned int tx_boundary;
diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c
index 3d51e8d82659..c18215751d92 100644
--- a/drivers/usb/host/xhci-dbgtty.c
+++ b/drivers/usb/host/xhci-dbgtty.c
@@ -11,6 +11,7 @@
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/idr.h>
+#include <linux/workqueue.h>
#include "xhci.h"
#include "xhci-dbgcap.h"
@@ -189,9 +190,9 @@ dbc_read_complete(struct xhci_dbc *dbc, struct dbc_request *req)
}
}
- /* defer moving data from req to tty buffer to a tasklet */
+ /* defer moving data from req to tty buffer to BH workqueue */
list_add_tail(&req->list_pool, &port->read_queue);
- tasklet_schedule(&port->push);
+ queue_work(system_bh_wq, &port->push);
out:
spin_unlock_irqrestore(&port->port_lock, flags);
}
@@ -384,7 +385,7 @@ static void dbc_tty_unthrottle(struct tty_struct *tty)
unsigned long flags;
spin_lock_irqsave(&port->port_lock, flags);
- tasklet_schedule(&port->push);
+ queue_work(system_bh_wq, &port->push);
spin_unlock_irqrestore(&port->port_lock, flags);
}
@@ -400,13 +401,13 @@ static const struct tty_operations dbc_tty_ops = {
.unthrottle = dbc_tty_unthrottle,
};
-static void dbc_rx_push(struct tasklet_struct *t)
+static void dbc_rx_push(struct work_struct *work)
{
struct dbc_request *req;
struct tty_struct *tty;
unsigned long flags;
bool disconnect = false;
- struct dbc_port *port = from_tasklet(port, t, push);
+ struct dbc_port *port = from_work(port, work, push);
struct list_head *queue = &port->read_queue;
int untransferred;
@@ -438,7 +439,7 @@ static void dbc_rx_push(struct tasklet_struct *t)
}
if (!list_empty(queue))
- tasklet_schedule(&port->push);
+ queue_work(system_bh_wq, &port->push);
if (!disconnect)
dbc_start_rx(port);
@@ -467,7 +468,7 @@ xhci_dbc_tty_init_port(struct xhci_dbc *dbc, struct dbc_port *port)
{
tty_port_init(&port->port);
spin_lock_init(&port->port_lock);
- tasklet_setup(&port->push, dbc_rx_push);
+ INIT_WORK(&port->push, dbc_rx_push);
INIT_LIST_HEAD(&port->read_pool);
INIT_LIST_HEAD(&port->read_queue);
INIT_LIST_HEAD(&port->write_pool);
@@ -479,7 +480,7 @@ xhci_dbc_tty_init_port(struct xhci_dbc *dbc, struct dbc_port *port)
static void
xhci_dbc_tty_exit_port(struct dbc_port *port)
{
- tasklet_kill(&port->push);
+ cancel_work_sync(&port->push);
tty_port_destroy(&port->port);
}
--
2.54.0
reply other threads:[~2026-10-08 12:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261008120605.174601-1-luokun485@gmail.com \
--to=luokun485@gmail.com \
--cc=baolu.lu@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®