From: Bradley Morgan <include@grrlz.net>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
brads@mainlining.org
Subject: [PATCH 1/5] media: ivtv: convert to kthread_run_worker
Date: Sat, 29 Aug 2026 16:13:35 +0000 [thread overview]
Message-ID: <20260829161336.17646-1-include@grrlz.net> (raw)
In-Reply-To: <20260829161150.16301-1-include@grrlz.net>
From: Bradley Morgan <brads@mainlining.org>
Embedding a kthread_worker and running kthread_worker_fn yourself is
the old way. Convert ivtv to kthread_run_worker(), dropping the
separate irq_worker_task pointer.
This is part of removing the worker->task self-assignment in
kthread_worker_fn().
Signed-off-by: Bradley Morgan <brads@mainlining.org>
---
drivers/media/pci/ivtv/ivtv-driver.c | 14 ++++++--------
drivers/media/pci/ivtv/ivtv-driver.h | 3 +--
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index b9ea56ec9593..6f0e0e46deb5 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -703,15 +703,13 @@ static int ivtv_init_struct1(struct ivtv *itv)
spin_lock_init(&itv->lock);
spin_lock_init(&itv->dma_reg_lock);
- kthread_init_worker(&itv->irq_worker);
- itv->irq_worker_task = kthread_run(kthread_worker_fn, &itv->irq_worker,
- "%s", itv->v4l2_dev.name);
- if (IS_ERR(itv->irq_worker_task)) {
+ itv->irq_worker = kthread_run_worker(0, "%s", itv->v4l2_dev.name);
+ if (IS_ERR(itv->irq_worker)) {
IVTV_ERR("Could not create ivtv task\n");
return -1;
}
/* must use the FIFO scheduler as it is realtime sensitive */
- sched_set_fifo(itv->irq_worker_task);
+ sched_set_fifo(itv->irq_worker->task);
kthread_init_work(&itv->irq_work, ivtv_irq_work_handler);
@@ -1232,7 +1230,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
v4l2_ctrl_handler_free(&itv->cxhdl.hdl);
exit_ivtv_i2c(itv);
free_worker:
- kthread_stop(itv->irq_worker_task);
+ kthread_destroy_worker(itv->irq_worker);
err:
if (retval == 0)
retval = -ENODEV;
@@ -1372,8 +1370,8 @@ static void ivtv_remove(struct pci_dev *pdev)
timer_shutdown_sync(&itv->dma_timer);
/* Kill irq worker */
- kthread_flush_worker(&itv->irq_worker);
- kthread_stop(itv->irq_worker_task);
+ kthread_flush_worker(itv->irq_worker);
+ kthread_destroy_worker(itv->irq_worker);
ivtv_streams_cleanup(itv);
ivtv_udma_free(itv);
diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h
index 000e8beecc7c..091bc44f13bc 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.h
+++ b/drivers/media/pci/ivtv/ivtv-driver.h
@@ -668,8 +668,7 @@ struct ivtv {
/* Interrupts & DMA */
u32 irqmask; /* active interrupts */
u32 irq_rr_idx; /* round-robin stream index */
- struct kthread_worker irq_worker; /* kthread worker for PIO/YUV/VBI actions */
- struct task_struct *irq_worker_task; /* task for irq_worker */
+ struct kthread_worker *irq_worker; /* kthread worker for PIO/YUV/VBI actions */
struct kthread_work irq_work; /* kthread work entry */
spinlock_t dma_reg_lock; /* lock access to DMA engine registers */
int cur_dma_stream; /* index of current stream doing DMA (-1 if none) */
--
2.47.3
next prev parent reply other threads:[~2026-08-29 16:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 16:11 [RESEND PATCH 0/5] kthread: remove worker->task self-assignment Bradley Morgan
2026-08-29 16:13 ` Bradley Morgan [this message]
2026-08-29 16:15 ` [PATCH 2/5] net: encx24j600: convert to kthread_run_worker Bradley Morgan
2026-08-29 16:16 ` [PATCH 3/5] tty: sc16is7xx: " Bradley Morgan
2026-08-29 16:17 ` [PATCH 4/5] cpufreq: schedutil: convert to kthread_create_worker Bradley Morgan
2026-08-29 16:18 ` [PATCH] kthread: remove worker->task self-assignment Bradley Morgan
-- strict thread matches above, loose matches on Subject: below --
2026-08-29 15:55 [PATCH 1/5] media: ivtv: convert to kthread_run_worker Bradley Morgan
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=20260829161336.17646-1-include@grrlz.net \
--to=include@grrlz.net \
--cc=awalls@md.metrocast.net \
--cc=brads@mainlining.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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 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®