kthread: convert remaining users to kthread_create_worker
Subsystems (7)
v2 cover kthread: convert remaining users to kthread_create_worker
kthread_worker_fn() has carried a FIXME for a decade: it assigns worker->task = current because the old kthread_run(kthread_worker_fn) callers never told the worker what task it was. The new kthread_create_worker*() API sets worker->task before the worker starts, so the self assignment is dead code.
This series converts the four remaining users of the old pattern (ivtv, encx24j600, sc16is7xx, cpufreq_schedutil) to the new API, then removes the self assignment from kthread_worker_fn() while keeping a WARN_ON() as a sanity check for any out-of-tree users.
v1 -> v2:
- Keep WARN_ON() as a bare sanity check (Frederic, Peter)
- Add comment explaining why the WARN_ON() is there
- Fix subject and changelog wording
Bradley Morgan (5):
media: ivtv: convert to kthread_run_worker
net: encx24j600: convert to kthread_run_worker
tty: sc16is7xx: convert to kthread_run_worker
cpufreq: schedutil: convert to kthread_create_worker
kthread: remove worker->task self assignment
drivers/media/pci/ivtv/ivtv-driver.c | 14 ++++---- drivers/media/pci/ivtv/ivtv-driver.h | 3 +- drivers/net/ethernet/microchip/encx24j600.c | 20 +++++------ drivers/tty/serial/sc16is7xx.c | 39 ++++++++++----------- kernel/kthread.c | 8 ++--- kernel/sched/cpufreq_schedutil.c | 33 ++++++++--------- 6 files changed, 50 insertions(+), 67 deletions(-)
Signature · 1 line
2.47.3
PATCH v2 1/5 media: ivtv: convert to kthread_run_worker
Convert ivtv to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
--- drivers/media/pci/ivtv/ivtv-driver.c | 14 ++++++-------- drivers/media/pci/ivtv/ivtv-driver.h | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/media/pci/ivtv/ivtv-driver.c +6 -8
@@ -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);
drivers/media/pci/ivtv/ivtv-driver.h +1 -2
@@ -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) */
Signature · 1 line
2.47.3
Re: [PATCH v2 1/5] media: ivtv: convert to kthread_run_worker
Quoted 3 lines · Bradley Morgan
Convert ivtv to use
kthread_run_worker()instead of the deprecatedkthread_run(kthread_worker_fn)pattern. The new API setsworker->taskbefore the worker starts.
This doesn't compile, I'm aware. Fixing in V3, everything else should compile.
Received a off list mail from the CI.
Quoted 56 lines
Signed-off-by Bradley Morgan <[email protected]>---
drivers/media/pci/ivtv/ivtv-driver.c| 14 ++++++--------drivers/media/pci/ivtv/ivtv-driver.h| 3 +--2 files changed, 7 insertions(+), 10 deletions(-)drivers/media/pci/ivtv/ivtv-driver.c +3
-5@@ -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:drivers/media/pci/ivtv/ivtv-driver.c +1
-1-kthread_stop (itv->irq_worker_task); +kthread_destroy_worker (itv->irq_worker);err:
if (retval == 0) retval = -ENODEV;drivers/media/pci/ivtv/ivtv-driver.c +2
-2@@ -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);drivers/media/pci/ivtv/ivtv-driver.h +0
-0
drivers/media/pci/ivtv/ivtv-driver.h struct ivtv { · line 674
Quoted 9 lines
drivers/media/pci/ivtv/ivtv-driver.h +1
-2@@ -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) */
[email protected]
AI reviewRe: [PATCH v2 1/5] media: ivtv: convert to kthread_run_worker
In reply to Bradley MorganThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] kthread_queue_work() receives a double pointer instead of a pointer to kthread_worker, leading to…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] kthread_queue_work() receives a double pointer instead of a pointer to kthread_worker, leading to a build error or runtime memory corruption.
- [High] kthread_destroy_worker() is called before free_irq(), creating a Use-After-Free race condition with the interrupt handler. --
commit a504d2685cd2f4c4e6b93a81c847d55367eae1c0
Author: Bradley Morgan <[email protected]>
media: ivtv: convert to kthread_run_worker
Convert ivtv to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
Quoted 4 lines
drivers/media/pci/ivtv/ivtv-driver.c +0
-0
[ ... ]
drivers/media/pci/ivtv/ivtv-driver.c static void ivtv_remove(struct pci_dev *pdev) · line 1374
Quoted 8 lines
drivers/media/pci/ivtv/ivtv-driver.c +2
-2@@ -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);
[Severity: High]
Does this create a use-after-free race condition with the interrupt handler?
kthread_destroy_worker() frees the dynamically allocated worker structure here, but free_irq() is called later in ivtv_remove():
drivers/media/pci/ivtv/ivtv-driver.c:ivtv_remove() {
...
kthread_destroy_worker(itv->irq_worker);
...
free_irq(itv->pdev->irq, (void *)itv);
...
}Because free_irq() is the synchronization point that guarantees no interrupt handlers are still running, an in-flight ivtv_irq_handler() on another CPU can survive past kthread_destroy_worker().
If the handler subsequently attempts to queue work, it will dereference the already-freed irq_worker pointer, causing a kernel panic.
Quoted 8 lines
drivers/media/pci/ivtv/ivtv-driver.c +0
-0ivtv_streams_cleanup (itv);ivtv_udma_free (itv);drivers/media/pci/ivtv/ivtv-driver.h +0
-0
drivers/media/pci/ivtv/ivtv-driver.h struct ivtv { · line 671
Quoted 6 lines
drivers/media/pci/ivtv/ivtv-driver.h +1
-2@@ -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 */
[Severity: High]
Does this change from a struct to a pointer cause a build error or memory corruption in ivtv_irq_handler()?
Because irq_worker is now a pointer, the unmodified call site in ivtv_irq_handler() now passes a double pointer:
drivers/media/pci/ivtv/ivtv-irq.c:ivtv_irq_handler() {
...
kthread_queue_work(&itv->irq_worker, &itv->irq_work);
...
}This violates the API contract and will cause a build failure with modern compilers due to incompatible pointer types.
If the warning is ignored or coerced, kthread_queue_work() will treat the offset within struct ivtv as a kthread_worker object, corrupting adjacent fields when it acquires the spinlock, leading to a kernel crash.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v2 1/5] media: ivtv: convert to kthread_run_worker
Quoted 3 lines · On 5 September 2026 10:40:37 BST, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider:
- [High]kthread_queue_work()receives a double pointer instead of a pointer tokthread_worker, leading to a build error or runtime memory corruption.
Aware (sorta?)
Quoted 1 line
- [High]
kthread_destroy_worker()is called beforefree_irq(), creating a Use-After-Free race condition with the interrupt handler.
Oh!
Quoted 80 lines
--
commit
a504d2685cd2f4c4e6b93a81c847d55367eae1c0
Author: Bradley Morgan <[email protected]>media: ivtv: convert to
kthread_run_workerConvert ivtv to use
kthread_run_worker()instead of the deprecatedkthread_run(kthread_worker_fn)pattern. The new API setsworker->taskbefore the worker starts.Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/media/pci/ivtv/ivtv-driver.cQuoted 3 lines
index
b9ea56ec9593f..6f0e0e46deb5b100644drivers/media/pci/ivtv/ivtv-driver.c +0
-0[ ... ]
drivers/media/pci/ivtv/ivtv-driver.c static void ivtv_remove(struct pci_dev *pdev) · line 1374
Quoted 8 lines
drivers/media/pci/ivtv/ivtv-driver.c +2
-2@@ -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);[Severity: High]
Does this create a use-after-free race condition with the interrupt handler?
kthread_destroy_worker()frees the dynamically allocated worker structure here,
butfree_irq()is called later inivtv_remove():drivers/media/pci/ivtv/ivtv-driver.c:ivtv_remove() { ... kthread_destroy_worker(itv->irq_worker); ... free_irq(itv->pdev->irq, (void *)itv); ... }Because
free_irq()is the synchronization point that guarantees no interrupt
handlers are still running, an in-flightivtv_irq_handler()on another CPU can survive pastkthread_destroy_worker().If the handler subsequently attempts to queue work, it will dereference the
already-freedirq_workerpointer, causing a kernel panic.Review
Quoted 4 lines
drivers/media/pci/ivtv/ivtv-driver.c +0
-0ivtv_streams_cleanup (itv);ivtv_udma_free (itv);(quoted diff) +0
-0
b/drivers/media/pci/ivtv/ivtv-driver.hdrivers/media/pci/ivtv/ivtv-driver.h struct ivtv { · line 671
Quoted 10 lines
index
f1f18911332e8..41789a50d1ca6100644drivers/media/pci/ivtv/ivtv-driver.h +1
-2@@ -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 */ [Severity: High]
Does this change from a struct to a pointer cause a build error or memory corruption inivtv_irq_handler()?Because
irq_workeris now a pointer, the unmodified call site inivtv_irq_handler()now passes a double pointer:drivers/media/pci/ivtv/ivtv-irq.c:ivtv_irq_handler() { ... kthread_queue_work(&itv->irq_worker, &itv->irq_work); ... }
Quoted 8 lines
This violates the API contract and will cause a build failure with modern compilers due to incompatible pointer types.
If the warning is ignored or coerced,
kthread_queue_work()will treat the offset within struct ivtv as akthread_workerobject, corrupting adjacent fields when it acquires the spinlock, leading to a kernel crash.
PATCH v2 2/5 net: encx24j600: convert to kthread_run_worker
In reply to Bradley MorganConvert encx24j600 to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
--- drivers/net/ethernet/microchip/encx24j600.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/net/ethernet/microchip/encx24j600.c +8 -12
@@ -49,8 +49,7 @@ struct encx24j600_priv {struct mutex lock;/* device access lock */ struct encx24j600_context ctx;struct sk_buff *tx_skb; -struct task_struct *kworker_task; -struct kthread_worker kworker; +struct kthread_worker *kworker;struct kthread_work tx_work;struct kthread_work setrx_work;u16 next_packet;
@@ -823,7 +822,7 @@ static void encx24j600_set_multicast_list(struct net_device *dev) }if (oldfilter != priv->rxfilter) -kthread_queue_work (&priv->kworker, &priv->setrx_work); +kthread_queue_work (priv->kworker, &priv->setrx_work); }static void encx24j600_hw_tx (struct encx24j600_priv *priv)
@@ -884,7 +883,7 @@ static netdev_tx_t encx24j600_tx(struct sk_buff *skb, struct net_device *dev)/* Remember the skb for deferred processing */ priv->tx_skb = skb; -kthread_queue_work (&priv->kworker, &priv->tx_work); +kthread_queue_work (priv->kworker, &priv->tx_work);return NETDEV_TX_OK ; }
@@ -1046,15 +1045,12 @@ static int encx24j600_spi_probe(struct spi_device *spi)/* Initialize the device HW to the consistent state */ encx24j600_hw_init (priv); -kthread_init_worker (&priv->kworker);kthread_init_work (&priv->tx_work, encx24j600_tx_proc);kthread_init_work (&priv->setrx_work, encx24j600_setrx_proc); - priv->kworker_task =kthread_run (kthread_worker_fn, &priv->kworker, -"encx24j600" ); - -if (IS_ERR (priv->kworker_task)) { - ret =PTR_ERR (priv->kworker_task); + priv->kworker =kthread_run_worker (0 ,"encx24j600" ); +if (IS_ERR (priv->kworker)) { + ret =PTR_ERR (priv->kworker); goto out_free; }
@@ -1087,7 +1083,7 @@ static int encx24j600_spi_probe(struct spi_device *spi) out_unregister:unregister_netdev (priv->ndev); out_stop: -kthread_stop (priv->kworker_task); +kthread_destroy_worker (priv->kworker); out_free:free_netdev (ndev);
@@ -1100,7 +1096,7 @@ static void encx24j600_spi_remove(struct spi_device *spi)struct encx24j600_priv *priv =dev_get_drvdata (&spi->dev);unregister_netdev (priv->ndev); -kthread_stop (priv->kworker_task); +kthread_destroy_worker (priv->kworker);free_netdev (priv->ndev); }
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v2 2/5] net: encx24j600: convert to kthread_run_worker
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing state cleanup for priv->tx_skb in TX timeout, interface stop, and device removal paths leads to memory leaks, data races, and potential BUG() panics.
- [High] Hardware memory structures read over SPI are not converted from little-endian to CPU endianness.
--
commit d2a821de33aec8b828ff820d968fcd13ce493790
Author: Bradley Morgan <[email protected]>
net: encx24j600: convert to kthread_run_worker
Convert encx24j600 to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
drivers/net/ethernet/microchip/encx24j600.c static netdev_tx_t encx24j600_tx(struct sk_buff *skb, struct net_device *dev) · line 886
Quoted 9 lines
drivers/net/ethernet/microchip/encx24j600.c +1
-1@@ -884,7 +883,7 @@ static netdev_tx_t encx24j600_tx(struct sk_buff *skb, struct net_device *dev)/* Remember the skb for deferred processing */ priv->tx_skb = skb; -kthread_queue_work (&priv->kworker, &priv->tx_work); +kthread_queue_work (priv->kworker, &priv->tx_work);
[Severity: High]
This is a pre-existing issue, but is there a missing state cleanup for priv->tx_skb in the TX timeout path?
If a TX timeout occurs, encx24j600_tx_timeout() wakes the queue without cleaning up priv->tx_skb or clearing pending TX state. The next TX here unconditionally overwrites priv->tx_skb, leaking the previous packet.
Furthermore, a delayed hardware interrupt for the previous packet can arrive and trigger encx24j600_tx_complete(), which frees the new priv->tx_skb and sets it to NULL. When encx24j600_tx_complete() subsequently fires for the new packet, it sees priv->tx_skb is NULL and calls BUG():
drivers/net/ethernet/microchip/encx24j600.c:encx24j600_tx_complete() {
if (!priv->tx_skb) {
BUG();
return;
}...
Alternatively, encx24j600_hw_tx() may run concurrently with the delayed interrupt, reading priv->tx_skb->len when it has been set to NULL, causing a NULL pointer dereference.
[ ... ]
drivers/net/ethernet/microchip/encx24j600.c static void encx24j600_spi_remove(struct spi_device *spi) · line 1102
Quoted 9 lines
drivers/net/ethernet/microchip/encx24j600.c +1
-1@@ -1100,7 +1096,7 @@ static void encx24j600_spi_remove(struct spi_device *spi)struct encx24j600_priv *priv =dev_get_drvdata (&spi->dev);unregister_netdev (priv->ndev); -kthread_stop (priv->kworker_task); +kthread_destroy_worker (priv->kworker);free_netdev (priv->ndev); }
[Severity: High]
This is also a pre-existing issue, but does device removal strand the un-freed priv->tx_skb?
During driver removal in encx24j600_spi_remove(), the kworker is destroyed, and then the driver private data is freed without cleaning up priv->tx_skb, which results in a memory leak.
[Severity: High]
This is another pre-existing issue, but are the hardware memory structures read over SPI properly converted from little-endian to CPU endianness?
The 8-byte Receive Status Vector is read directly from the SPI interface into a struct rsv using encx24j600_raw_read() in encx24j600_rx_packets():
encx24j600_raw_read(priv, RRXDATA, (u8 *)&rsv, sizeof(rsv));
However, struct rsv in drivers/net/ethernet/microchip/encx24j600_hw.h uses native CPU types without using explicit __le16 and __le32 types:
struct rsv {
u16 next_packet;
u16 len;
u32 rxstat;
};On a big-endian system, won't the raw bytes be misinterpreted? For example, a packet length of 60 (0x003C) would be read as 0x3C00 (15360), which exceeds MAX_FRAMELEN and causes the packet to be dropped. The corrupted next_packet pointer would then be written back to the device's ERXTAIL register, destroying the receive ring buffer state.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v2 2/5] net: encx24j600: convert to kthread_run_worker
Quoted 6 lines · On 5 September 2026 10:40:38 BST, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing state cleanup forpriv->tx_skbin TX timeout, interface stop, and device removal paths leads to memory leaks, data races, and potentialBUG()panics.
- [High] Hardware memory structures read over SPI are not converted from little-endian to CPU endianness.
Meh. No thanks.
Quoted 89 lines
--
commit
d2a821de33aec8b828ff820d968fcd13ce493790
Author: Bradley Morgan <[email protected]>net: encx24j600: convert to
kthread_run_workerConvert encx24j600 to use
kthread_run_worker()instead of the deprecatedkthread_run(kthread_worker_fn)pattern. The new API setsworker->taskbefore the worker starts.Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/net/ethernet/microchip/encx24j600.cdrivers/net/ethernet/microchip/encx24j600.c static netdev_tx_t encx24j600_tx(struct sk_buff
Quoted 3 lines
drivers/net/ethernet/microchip/encx24j600.c +0
-0@@ -884,7 +883,7 @@ static netdev_tx_t encx24j600_tx(struct sk_buff*skb, struct
net_device*dev)drivers/net/ethernet/microchip/encx24j600.c static netdev_tx_t encx24j600_tx(struct sk_buff *skb, struct net_device *dev) · line 886
Quoted 5 lines
drivers/net/ethernet/microchip/encx24j600.c +1
-1/* Remember the skb for deferred processing */ priv->tx_skb = skb; -kthread_queue_work (&priv->kworker, &priv->tx_work); +kthread_queue_work (priv->kworker, &priv->tx_work);[Severity: High]
This is a pre-existing issue, but is there a missing state cleanup forpriv->tx_skbin the TX timeout path?If a TX timeout occurs,
encx24j600_tx_timeout()wakes the queue without cleaning uppriv->tx_skbor clearing pending TX state. The next TX here unconditionally overwritespriv->tx_skb, leaking the previous packet.Furthermore, a delayed hardware interrupt for the previous packet can arrive
and triggerencx24j600_tx_complete(), which frees the newpriv->tx_skband sets it to NULL. Whenencx24j600_tx_complete()subsequently fires for the new packet, it seespriv->tx_skbis NULL and callsBUG():drivers/net/ethernet/microchip/encx24j600.c:encx24j600_tx_complete() { if (!priv->tx_skb) { BUG(); return; }...
Alternatively,
encx24j600_hw_tx()may run concurrently with the delayed interrupt, readingpriv->tx_skb->lenwhen it has been set to NULL, causing a NULL pointer dereference.[ ... ]
drivers/net/ethernet/microchip/encx24j600.c static void encx24j600_spi_remove(struct
Quoted 1 line
drivers/net/ethernet/microchip/encx24j600.c +0
-0@@ -1100,7 +1096,7 @@ static void encx24j600_spi_remove(struct
spi_device*spi)drivers/net/ethernet/microchip/encx24j600.c static void encx24j600_spi_remove(struct spi_device *spi) · line 1102
Quoted 8 lines
drivers/net/ethernet/microchip/encx24j600.c +1
-1struct encx24j600_priv *priv =dev_get_drvdata (&spi->dev);unregister_netdev (priv->ndev); -kthread_stop (priv->kworker_task); +kthread_destroy_worker (priv->kworker);free_netdev (priv->ndev); }[Severity: High]
This is also a pre-existing issue, but does device removal strand the un-freedpriv->tx_skb?During driver removal in
encx24j600_spi_remove(), the kworker is destroyed,
and then the driver private data is freed without cleaning uppriv->tx_skb,
which results in a memory leak.[Severity: High]
This is another pre-existing issue, but are the hardware memory structures read over SPI properly converted from little-endian to CPU endianness?The 8-byte Receive Status Vector is read directly from the SPI interface into a struct rsv using
encx24j600_raw_read()inencx24j600_rx_packets():
encx24j600_raw_read(priv, RRXDATA, (u8 *)&rsv, sizeof(rsv));However, struct rsv in
drivers/net/ethernet/microchip/encx24j600_hw.huses native CPU types without using explicit__le16and__le32types:struct rsv { u16 next_packet; u16 len; u32 rxstat; };
Quoted 10 lines
On a big-endian system, won't the raw bytes be misinterpreted? For example,
a packet length of 60 (0x003C) would be read as0x3C00(15360), which exceedsMAX_FRAMELENand causes the packet to be dropped. The corruptednext_packet
pointer would then be written back to the device's ERXTAIL register, destroying the receive ring buffer state.
PATCH v2 3/5 tty: sc16is7xx: convert to kthread_run_worker
In reply to Bradley MorganConvert sc16is7xx to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
--- drivers/tty/serial/sc16is7xx.c | 39 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 21 deletions(-)
drivers/tty/serial/sc16is7xx.c +18 -21
@@ -306,8 +306,7 @@ struct sc16is7xx_port {unsigned long gpio_valid_mask;#endif u8 mctrl_mask; -struct kthread_worker kworker; -struct task_struct *kworker_task; +struct kthread_worker *kworker;struct kthread_delayed_work poll_work;bool polling;struct sc16is7xx_one p[];
@@ -434,7 +433,7 @@ static void sc16is7xx_ier_clear(struct uart_port *port, u8 bit) one->config.flags |=SC16IS7XX_RECONF_IER ; one->config.ier_mask |= bit; one->config.ier_val &= ~bit; -kthread_queue_work (&s->kworker, &one->reg_work); +kthread_queue_work (s->kworker, &one->reg_work); }static void sc16is7xx_ier_set (struct uart_port *port,u8 bit)
@@ -447,7 +446,7 @@ static void sc16is7xx_ier_set(struct uart_port *port, u8 bit) one->config.flags |=SC16IS7XX_RECONF_IER ; one->config.ier_mask |= bit; one->config.ier_val |= bit; -kthread_queue_work (&s->kworker, &one->reg_work); +kthread_queue_work (s->kworker, &one->reg_work); }static void sc16is7xx_stop_tx (struct uart_port *port)
@@ -813,7 +812,7 @@ static void sc16is7xx_poll_proc(struct kthread_work *ws)sc16is7xx_irq (0 , s);/* Setup delay based on SC16IS7XX_POLL_PERIOD_MS */ -kthread_queue_delayed_work (&s->kworker, &s->poll_work, +kthread_queue_delayed_work (s->kworker, &s->poll_work,msecs_to_jiffies (SC16IS7XX_POLL_PERIOD_MS )); }
@@ -900,7 +899,7 @@ static void sc16is7xx_ms_proc(struct kthread_work *ws) scoped_guard(mutex, &one->lock)sc16is7xx_update_mlines (one); -kthread_queue_delayed_work (&s->kworker, &one->ms_work,HZ ); +kthread_queue_delayed_work (s->kworker, &one->ms_work,HZ ); } }
@@ -911,7 +910,7 @@ static void sc16is7xx_enable_ms(struct uart_port *port)lockdep_assert_held_once (&port->lock); -kthread_queue_delayed_work (&s->kworker, &one->ms_work,0 ); +kthread_queue_delayed_work (s->kworker, &one->ms_work,0 ); }static void sc16is7xx_start_tx (struct uart_port *port)
@@ -919,7 +918,7 @@ static void sc16is7xx_start_tx(struct uart_port *port)struct sc16is7xx_port *s =dev_get_drvdata (port->dev);struct sc16is7xx_one *one =to_sc16is7xx_one (port); -kthread_queue_work (&s->kworker, &one->tx_work); +kthread_queue_work (s->kworker, &one->tx_work); }static void sc16is7xx_throttle (struct uart_port *port)
@@ -968,7 +967,7 @@ static void sc16is7xx_set_mctrl(struct uart_port *port, unsigned int mctrl)struct sc16is7xx_one *one =to_sc16is7xx_one (port); one->config.flags |=SC16IS7XX_RECONF_MD ; -kthread_queue_work (&s->kworker, &one->reg_work); +kthread_queue_work (s->kworker, &one->reg_work); }static void sc16is7xx_break_ctl (struct uart_port *port,int break_state)
@@ -1098,7 +1097,7 @@ static int sc16is7xx_config_rs485(struct uart_port *port, struct ktermios *termi } one->config.flags |=SC16IS7XX_RECONF_RS485 ; -kthread_queue_work (&s->kworker, &one->reg_work); +kthread_queue_work (s->kworker, &one->reg_work);return 0 ; }
@@ -1159,7 +1158,7 @@ static int sc16is7xx_startup(struct uart_port *port)uart_port_unlock_irqrestore (port, flags);if (s->polling) -kthread_queue_delayed_work (&s->kworker, &s->poll_work, +kthread_queue_delayed_work (s->kworker, &s->poll_work,msecs_to_jiffies (SC16IS7XX_POLL_PERIOD_MS ));return 0 ;
@@ -1186,7 +1185,7 @@ static void sc16is7xx_shutdown(struct uart_port *port)if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); +kthread_flush_worker (s->kworker); }static const char *sc16is7xx_type (struct uart_port *port)
@@ -1595,14 +1594,12 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype, s->devtype = devtype;dev_set_drvdata (dev, s); -kthread_init_worker (&s->kworker); - s->kworker_task =kthread_run (kthread_worker_fn, &s->kworker, -"sc16is7xx" ); -if (IS_ERR (s->kworker_task)) { - ret =PTR_ERR (s->kworker_task); + s->kworker =kthread_run_worker (0 ,"sc16is7xx" ); +if (IS_ERR (s->kworker)) { + ret =PTR_ERR (s->kworker); goto out_clk; } -sched_set_fifo (s->kworker_task); +sched_set_fifo (s->kworker->task); ret =sc16is7xx_reset (dev, regmaps[0 ]);if (ret)
@@ -1676,7 +1673,7 @@ int sc16is7xx_probe(struct device *dev, const struct sc16is7xx_devtype *devtype, } out_kthread: -kthread_stop (s->kworker_task); +kthread_destroy_worker (s->kworker); out_clk:clk_disable_unprepare (s->clk);
@@ -1705,8 +1702,8 @@ void sc16is7xx_remove(struct device *dev)if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); -kthread_stop (s->kworker_task); +kthread_flush_worker (s->kworker); +kthread_destroy_worker (s->kworker);clk_disable_unprepare (s->clk); }
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v2 3/5] tty: sc16is7xx: convert to kthread_run_worker
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] The explicitly allocated kthread worker is destroyed before the devm-managed threaded IRQ handler is freed, causing a Use-After-Free.
Pre-existing issues:
- [High] Closing any single port cancels the shared polling timer, starving all other active ports on the same multi-port chip. --
commit 3bc3e4920cc0fac18e8f989a3296c6b4222d065c
Author: Bradley Morgan <[email protected]>
tty: sc16is7xx: convert to kthread_run_worker
Convert sc16is7xx to use kthread_run_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
drivers/tty/serial/sc16is7xx.c static void sc16is7xx_shutdown(struct uart_port *port) · line 1189
Quoted 11 lines
drivers/tty/serial/sc16is7xx.c +1
-1@@ -1186,7 +1185,7 @@ static void sc16is7xx_shutdown(struct uart_port *port)if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); +kthread_flush_worker (s->kworker); }
[Severity: High]
This is a pre-existing issue, but does closing any single port cancel the shared polling timer for all ports?
In polling mode, s->poll_work is shared across all ports on the chip. If one port is closed, sc16is7xx_shutdown() unconditionally cancels s->poll_work, which seems to starve any other active ports on the same chip.
drivers/tty/serial/sc16is7xx.c void sc16is7xx_remove(struct device *dev) · line 1709
Quoted 11 lines
drivers/tty/serial/sc16is7xx.c +2
-2@@ -1705,8 +1702,8 @@ void sc16is7xx_remove(struct device *dev)if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); -kthread_stop (s->kworker_task); +kthread_flush_worker (s->kworker); +kthread_destroy_worker (s->kworker);clk_disable_unprepare (s->clk); }
[Severity: High]
Can kthread_destroy_worker() lead to a use-after-free if the threaded IRQ handler fires concurrently?
The driver uses devm_request_threaded_irq() in sc16is7xx_probe() to manage its interrupt, meaning the IRQ handler remains active until after sc16is7xx_remove() returns and devres cleans it up.
If an interrupt fires or an in-flight threaded IRQ executes in parallel right after kthread_destroy_worker() frees s->kworker, the IRQ handler could call functions like sc16is7xx_ier_clear() which enqueue work:
drivers/tty/serial/sc16is7xx.c:sc16is7xx_ier_clear() {
...
kthread_queue_work(s->kworker, &one->reg_work);
}This would dereference the freed s->kworker pointer. Previously kworker was embedded in the sc16is7xx_port struct, so stopping the task was safe from a use-after-free, but now kthread_destroy_worker() frees the dynamically allocated worker before the IRQ handler is disabled.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Re: [PATCH v2 3/5] tty: sc16is7xx: convert to kthread_run_worker
Quoted 6 lines · On 5 September 2026 10:40:35 BST, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] The explicitly allocated kthread worker is destroyed before the devm-managed threaded IRQ handler is freed, causing a Use-After-Free.
Awesome. Seriously
Quoted 68 lines
Pre-existing issues:
- [High] Closing any single port cancels the shared polling timer, starving all other active ports on the same multi-port chip. --commit
3bc3e4920cc0fac18e8f989a3296c6b4222d065c
Author: Bradley Morgan <[email protected]>tty: sc16is7xx: convert to
kthread_run_workerConvert sc16is7xx to use
kthread_run_worker()instead of the deprecatedkthread_run(kthread_worker_fn)pattern. The new API setsworker->taskbefore the worker starts.Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/tty/serial/sc16is7xx.cdrivers/tty/serial/sc16is7xx.c static void sc16is7xx_shutdown(struct uart_port
Quoted 4 lines
index
7107a0fb1e7bb..2cfc1f2900091100644drivers/tty/serial/sc16is7xx.c +0
-0@@ -1186,7 +1185,7 @@ static void sc16is7xx_shutdown(struct uart_port*port)
drivers/tty/serial/sc16is7xx.c static void sc16is7xx_shutdown(struct uart_port *port) · line 1189
Quoted 6 lines
drivers/tty/serial/sc16is7xx.c +1
-1if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); +kthread_flush_worker (s->kworker); }[Severity: High]
This is a pre-existing issue, but does closing any single port cancel the shared polling timer for all ports?In polling mode,
s->poll_workis shared across all ports on the chip. If one port is closed,sc16is7xx_shutdown()unconditionally cancelss->poll_work,
which seems to starve any other active ports on the same chip.drivers/tty/serial/sc16is7xx.c void sc16is7xx_remove(struct device *dev) · line 1709
Quoted 11 lines
drivers/tty/serial/sc16is7xx.c +2
-2@@ -1705,8 +1702,8 @@ void sc16is7xx_remove(struct device *dev)if (s->polling)kthread_cancel_delayed_work_sync (&s->poll_work); -kthread_flush_worker (&s->kworker); -kthread_stop (s->kworker_task); +kthread_flush_worker (s->kworker); +kthread_destroy_worker (s->kworker);clk_disable_unprepare (s->clk); }[Severity: High]
Cankthread_destroy_worker()lead to a use-after-free if the threaded IRQ handler fires concurrently?The driver uses
devm_request_threaded_irq()insc16is7xx_probe()to manage its
interrupt, meaning the IRQ handler remains active until aftersc16is7xx_remove()returns and devres cleans it up.If an interrupt fires or an in-flight threaded IRQ executes in parallel right
afterkthread_destroy_worker()freess->kworker, the IRQ handler could call
functions likesc16is7xx_ier_clear()which enqueue work:drivers/tty/serial/sc16is7xx.c:sc16is7xx_ier_clear() { ... kthread_queue_work(s->kworker, &one->reg_work); }
Quoted 8 lines
This would dereference the freed
s->kworkerpointer. Previously kworker was
embedded in thesc16is7xx_portstruct, so stopping the task was safe from a
use-after-free, but nowkthread_destroy_worker()frees the dynamically allocated worker before the IRQ handler is disabled.
PATCH v2 4/5 cpufreq: schedutil: convert to kthread_create_worker
In reply to Bradley MorganConvert cpufreq_schedutil to use kthread_create_worker() instead of the deprecated kthread_run(kthread_worker_fn) pattern. The new API sets worker->task before the worker starts.
--- kernel/sched/cpufreq_schedutil.c | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-)
kernel/sched/cpufreq_schedutil.c +14 -19
@@ -31,8 +31,7 @@ struct sugov_policy {struct irq_work irq_work;struct kthread_work work;struct mutex work_lock; -struct kthread_worker worker; -struct task_struct *thread; +struct kthread_worker *worker;bool work_in_progress;bool limits_changed;
@@ -586,7 +585,7 @@ static void sugov_irq_work(struct irq_work *irq_work) sg_policy = container_of(irq_work, struct sugov_policy, irq_work); -kthread_queue_work (&sg_policy->worker, &sg_policy->work); +kthread_queue_work (sg_policy->worker, &sg_policy->work); }/************************** sysfs interface ************************/
@@ -669,7 +668,6 @@ static void sugov_policy_free(struct sugov_policy *sg_policy)static int sugov_kthread_create (struct sugov_policy *sg_policy) { -struct task_struct *thread;struct sched_attr attr = { .size =sizeof (struct sched_attr ), .sched_policy =SCHED_DEADLINE ,
@@ -692,32 +690,29 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)return 0 ;kthread_init_work (&sg_policy->work, sugov_work); -kthread_init_worker (&sg_policy->worker); - thread =kthread_create (kthread_worker_fn, &sg_policy->worker, -"sugov:%d" , -cpumask_first (policy->related_cpus)); -if (IS_ERR (thread)) { -pr_err ("failed to create sugov thread: %pe\n" , thread); -return PTR_ERR (thread); + sg_policy->worker =kthread_create_worker (0 ,"sugov:%d" , +cpumask_first (policy->related_cpus)); +if (IS_ERR (sg_policy->worker)) { +pr_err ("failed to create sugov thread: %pe\n" , sg_policy->worker); +return PTR_ERR (sg_policy->worker); } - ret =sched_setattr_nocheck (thread, &attr); + ret =sched_setattr_nocheck (sg_policy->worker->task, &attr);if (ret) { -kthread_stop (thread); +kthread_destroy_worker (sg_policy->worker);pr_warn ("%s: failed to set SCHED_DEADLINE\n" , __func__);return ret; } - sg_policy->thread = thread;if (policy->dvfs_possible_from_any_cpu) -set_cpus_allowed_ptr (thread, policy->related_cpus); +set_cpus_allowed_ptr (sg_policy->worker->task, policy->related_cpus);else -kthread_bind_mask (thread, policy->related_cpus); +kthread_bind_mask (sg_policy->worker->task, policy->related_cpus);init_irq_work (&sg_policy->irq_work, sugov_irq_work);mutex_init (&sg_policy->work_lock); -wake_up_process (thread); +wake_up_process (sg_policy->worker->task);return 0 ; }
@@ -728,8 +723,8 @@ static void sugov_kthread_stop(struct sugov_policy *sg_policy)if (sg_policy->policy->fast_switch_enabled)return ; -kthread_flush_worker (&sg_policy->worker); -kthread_stop (sg_policy->thread); +kthread_flush_worker (sg_policy->worker); +kthread_destroy_worker (sg_policy->worker);mutex_destroy (&sg_policy->work_lock); }
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v2 4/5] cpufreq: schedutil: convert to kthread_create_worker
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines
Convert
cpufreq_schedutilto usekthread_create_worker()instead of the deprecatedkthread_run(kthread_worker_fn)pattern. The new API setsworker->taskbefore the worker starts.Signed-off-by Bradley Morgan <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH v2 5/5 kthread: remove worker->task self assignment
In reply to Bradley MorganAll kthread worker users now create their workers with kthread_create_worker*(), which sets worker->task before the worker starts. The self assignment in kthread_worker_fn() is dead code now.
Remove the assignment but keep the WARN_ON() as a sanity check for any OOT users still using the old API.
--- kernel/kthread.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/kthread.c +3 -5
@@ -987,12 +987,10 @@ int kthread_worker_fn(void *worker_ptr)struct kthread_worker *worker = worker_ptr;struct kthread_work *work; -/* -* FIXME: Update the check and remove the assignment when all kthread -* worker users are created using kthread_create_worker*() functions. +/* All workers are created with worker->task set. If this fires, +* the caller is broken. */ -WARN_ON (worker->task && worker->task != current); - worker->task = current; +WARN_ON (worker->task != current);if (worker->flags &KTW_FREEZABLE )set_freezable ();
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v2 5/5] kthread: remove worker->task self assignment
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Removing the self-assignment `worker->task = current;` breaks out-of-tree (OOT) users of the old…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Removing the self-assignment worker->task = current; breaks out-of-tree (OOT) users of the old kthread_run(kthread_worker_fn, ...) API, causing them to permanently deadlock due to missed wakeups. --
commit 4e8323d40e4fe5053d4171cbca8193f9bd6080b8
Author: Bradley Morgan <[email protected]>
kthread: remove worker->task self assignment
All kthread worker users now create their workers with kthread_create_worker*(), which sets worker->task before the worker starts. The self assignment in kthread_worker_fn() is removed, leaving a warning check for out-of-tree users.
Quoted 7 lines
kernel/kthread.c +0
-0@@ -987,12 +987,10 @@ int kthread_worker_fn(void *worker_ptr)struct kthread_worker *worker = worker_ptr;struct kthread_work *work;
kernel/kthread.c int kthread_worker_fn(void *worker_ptr) · line 993
Quoted 10 lines
kernel/kthread.c +3
-5-/* -* FIXME: Update the check and remove the assignment when all kthread -* worker users are created using kthread_create_worker*() functions. +/* All workers are created with worker->task set. If this fires, +* the caller is broken. */ -WARN_ON (worker->task && worker->task != current); - worker->task = current; +WARN_ON (worker->task != current);
[Severity: Medium]
Does removing this assignment cause out-of-tree users of the old kthread_run() API to hang permanently?
Because the self-assignment is removed, worker->task will remain NULL for any callers still using the old API. When new work is inserted, the wakeup will be silently skipped in kthread_insert_work():
kernel/kthread.c:kthread_insert_work() {
...
if (!worker->current_work && likely(worker->task))
wake_up_process(worker->task);
...
}This means the warning intended as a sanity check turns into a silent, fatal breakage where the worker hangs in TASK_INTERRUPTIBLE and queued work is never processed.
Quoted 3 lines
kernel/kthread.c +0
-0if (worker->flags &KTW_FREEZABLE )set_freezable ();
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Re: [PATCH v2 5/5] kthread: remove worker->task self assignment
Quoted 3 lines · On 5 September 2026 10:40:38 BST, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:
- [Medium] Removing the self-assignmentworker->task = current;breaks out-of-tree (OOT) users of the oldkthread_run(kthread_worker_fn, ...)API, causing them to permanently deadlock due to missed wakeups.
Deliberate!!! They deserve whatever crap they get if after all this they haven't converted their caller.
Quoted 48 lines
--
commit
4e8323d40e4fe5053d4171cbca8193f9bd6080b8
Author: Bradley Morgan <[email protected]>kthread: remove
worker->taskself assignmentAll kthread worker users now create their workers with kthread_create_worker*(),
which setsworker->taskbefore the worker starts. The self assignment inkthread_worker_fn()is removed, leaving a warning check for out-of-tree users.Quoted 7 lines
kernel/kthread.c +0
-0@@ -987,12 +987,10 @@ int kthread_worker_fn(void *worker_ptr)struct kthread_worker *worker = worker_ptr;struct kthread_work *work;kernel/kthread.c int kthread_worker_fn(void *worker_ptr) · line 993
Quoted 10 lines
kernel/kthread.c +3
-5-/* -* FIXME: Update the check and remove the assignment when all kthread -* worker users are created using kthread_create_worker*() functions. +/* All workers are created with worker->task set. If this fires, +* the caller is broken. */ -WARN_ON (worker->task && worker->task != current); - worker->task = current; +WARN_ON (worker->task != current);[Severity: Medium]
Does removing this assignment cause out-of-tree users of the oldkthread_run()API to hang permanently?Because the self-assignment is removed,
worker->taskwill remain NULL for any
callers still using the old API. When new work is inserted, the wakeup will be
silently skipped inkthread_insert_work():kernel/kthread.c:kthread_insert_work() { ... if (!worker->current_work && likely(worker->task)) wake_up_process(worker->task); ... }
Quoted 11 lines
This means the warning intended as a sanity check turns into a silent, fatal
breakage where the worker hangs inTASK_INTERRUPTIBLEand queued work is never
processed.Quoted 3 lines
kernel/kthread.c +0
-0if (worker->flags &KTW_FREEZABLE )set_freezable ();
kernel test robot
build botRe: [PATCH v2 5/5] kthread: remove worker->task self assignment
In reply to Bradley Morgankernel test robot noticed the following build errors:
Hi Bradley,
kernel test robot noticed the following build errors:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on tty/tty-next tty/tty-linus rafael-pm/linux-next rafael-pm/bleeding-edge brauner-vfs/vfs.all linus/master v7.3-rc1 next-20260904] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Bradley-Morgan/media-ivtv-convert-to-kthread_run_worker/20260904-093753 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing patch link: https://lore.kernel.org/r/c925e99c73bea9e0cdab656ba09453df7e81dcb2.1788513591.git.brads%40mainlining.org patch subject: [PATCH v2 5/5] kthread: remove worker->task self assignment config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20260905/[email protected]/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 0edd1b088cc36b4faee80358c925a91e16006258) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260905/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/media/pci/ivtv/ivtv-irq.c:1053:22: error: incompatible pointer types passing 'struct kthread_worker **' to parameter of type 'struct kthread_worker *'; remove & [-Wincompatible-pointer-types]
1053 | kthread_queue_work(&itv->irq_worker, &itv->irq_work);
| ^~~~~~~~~~~~~~~~ include/linux/kthread.h:263:48: note: passing argument to parameter 'worker' here
263 | bool kthread_queue_work(struct kthread_worker *worker,
| ^
1 error generated.
vim +1053 drivers/media/pci/ivtv/ivtv-irq.c
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 917
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 918 irqreturn_t ivtv_irq_handler(int irq, void *dev_id)
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 919 {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 920 struct ivtv *itv = (struct ivtv *)dev_id;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 921 u32 combo;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 922 u32 stat;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 923 int i;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 924 u8 vsync_force = 0;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 925
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 926 spin_lock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 927 /* get contents of irq status register */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 928 stat = read_reg(IVTV_REG_IRQSTATUS);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 929
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 930 combo = ~itv->irqmask & stat;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 931
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 932 /* Clear out IRQ */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 933 if (combo) write_reg(combo, IVTV_REG_IRQSTATUS);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 934
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 935 if (0 == combo) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 936 /* The vsync interrupt is unusual and clears itself. If we
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 937 * took too long, we may have missed it. Do some checks
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 938 */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 939 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 940 /* vsync is enabled, see if we're in a new field */
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 941 if ((itv->last_vsync_field & 1) !=
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 942 (read_reg(IVTV_REG_DEC_LINE_FIELD) & 1)) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 943 /* New field, looks like we missed it */
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 944 IVTV_DEBUG_YUV("VSync interrupt missed %d\n",
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 945 read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 946 vsync_force = 1;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 947 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 948 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 949
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 950 if (!vsync_force) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 951 /* No Vsync expected, wasn't for us */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 952 spin_unlock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 953 return IRQ_NONE;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 954 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 955 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 956
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 957 /* Exclude interrupts noted below from the output, otherwise the log is flooded with
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 958 these messages */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 959 if (combo & ~0xff6d0400)
bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 960 IVTV_DEBUG_HI_IRQ("======= valid IRQ bits: 0x%08x ======\n", combo);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 961
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 962 if (combo & IVTV_IRQ_DEC_DMA_COMPLETE) {
bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 963 IVTV_DEBUG_HI_IRQ("DEC DMA COMPLETE\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 964 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 965
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 966 if (combo & IVTV_IRQ_DMA_READ) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 967 ivtv_irq_dma_read(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 968 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 969
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 970 if (combo & IVTV_IRQ_ENC_DMA_COMPLETE) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 971 ivtv_irq_enc_dma_complete(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 972 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 973
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 974 if (combo & IVTV_IRQ_ENC_PIO_COMPLETE) {
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 975 ivtv_irq_enc_pio_complete(itv);
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 976 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 977
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 978 if (combo & IVTV_IRQ_DMA_ERR) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 979 ivtv_irq_dma_err(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 980 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 981
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 982 if (combo & IVTV_IRQ_ENC_START_CAP) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 983 ivtv_irq_enc_start_cap(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 984 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 985
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 986 if (combo & IVTV_IRQ_ENC_VBI_CAP) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 987 ivtv_irq_enc_vbi_cap(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 988 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 989
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 990 if (combo & IVTV_IRQ_DEC_VBI_RE_INSERT) {
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 991 ivtv_irq_dec_vbi_reinsert(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 992 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 993
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 994 if (combo & IVTV_IRQ_ENC_EOS) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 995 IVTV_DEBUG_IRQ("ENC EOS\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 996 set_bit(IVTV_F_I_EOS, &itv->i_flags);
fd8b281a2809d2 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-23 997 wake_up(&itv->eos_waitq);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 998 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 999
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1000 if (combo & IVTV_IRQ_DEC_DATA_REQ) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1001 ivtv_irq_dec_data_req(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1002 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1003
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1004 /* Decoder Vertical Sync - We can't rely on 'combo', so check if vsync enabled */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1005 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1006 ivtv_irq_vsync(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1007 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1008
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1009 if (combo & IVTV_IRQ_ENC_VIM_RST) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1010 IVTV_DEBUG_IRQ("VIM RST\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1011 /*ivtv_vapi(itv, CX2341X_ENC_REFRESH_INPUT, 0); */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1012 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1013
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1014 if (combo & IVTV_IRQ_DEC_AUD_MODE_CHG) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1015 IVTV_DEBUG_INFO("Stereo mode changed\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1016 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1017
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1018 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_DMA, &itv->i_flags)) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1019 itv->irq_rr_idx++;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1020 for (i = 0; i < IVTV_MAX_STREAMS; i++) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1021 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1022 struct ivtv_stream *s = &itv->streams[idx];
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1023
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1024 if (!test_and_clear_bit(IVTV_F_S_DMA_PENDING, &s->s_flags))
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1025 continue;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1026 if (s->type >= IVTV_DEC_STREAM_TYPE_MPG)
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1027 ivtv_dma_dec_start(s);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1028 else
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1029 ivtv_dma_enc_start(s);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1030 break;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1031 }
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1032
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1033 if (i == IVTV_MAX_STREAMS &&
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1034 test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags))
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1035 ivtv_udma_start(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1036 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1037
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1038 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_PIO, &itv->i_flags)) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1039 itv->irq_rr_idx++;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1040 for (i = 0; i < IVTV_MAX_STREAMS; i++) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1041 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1042 struct ivtv_stream *s = &itv->streams[idx];
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1043
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1044 if (!test_and_clear_bit(IVTV_F_S_PIO_PENDING, &s->s_flags))
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1045 continue;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1046 if (s->type == IVTV_DEC_STREAM_TYPE_VBI || s->type < IVTV_DEC_STREAM_TYPE_MPG)
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1047 ivtv_dma_enc_start(s);
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1048 break;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1049 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1050 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1051
2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1052 if (test_and_clear_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags)) {
3989144f863ac5 drivers/media/pci/ivtv/ivtv-irq.c Petr Mladek 2016-10-11 @1053 kthread_queue_work(&itv->irq_worker, &itv->irq_work);
2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1054 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1055
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1056 spin_unlock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1057
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1058 /* If we've just handled a 'forced' vsync, it's safest to say it
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1059 * wasn't ours. Another device may have triggered it at just
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1060 * the right time.
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1061 */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1062 return vsync_force ? IRQ_NONE : IRQ_HANDLED;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1063 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1064 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 5/5] kthread: remove worker->task self assignment
Quoted 8 lines · kernel test robot
Hi Bradley,
kernel test robot noticed the following build errors:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on tty/tty-next tty/tty-linus rafael-pm/linux-next rafael-pm/bleeding-edge brauner-vfs/vfs.all linus/master v7.3-rc1 next-20260904]
Aware. Will fix.
Quoted 212 lines
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/Bradley-Morgan/media-ivtv-convert-to-kthread_run_worker/20260904-093753 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testingpatch link:
https://lore.kernel.org/r/c925e99c73bea9e0cdab656ba09453df7e81dcb2.1788513591.git.brads%40mainlining.org
patch subject: [PATCH v2 5/5] kthread: removeworker->taskself assignment
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20260905/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project0edd1b088cc36b4faee80358c925a91e16006258) reproduce (this is a W=1 build):
(https://download.01.org/0day-ci/archive/20260905/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/All errors (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/media/pci/ivtv/ivtv-irq.c:1053:22: error: incompatible pointertypes passing 'struct
kthread_worker**' to parameter of type 'structkthread_worker*'; remove & [-Wincompatible-pointer-types]1053 | kthread_queue_work(&itv->irq_worker, &itv->irq_work); | ^~~~~~~~~~~~~~~~
include/linux/kthread.h:263:48: note: passing argument to parameter 'worker' here
263 | bool kthread_queue_work(structkthread_worker*worker,
| ^
1 error generated.vim +1053
drivers/media/pci/ivtv/ivtv-irq.c
1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil
2007-04-27 9171a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil
2007-04-27 918irqreturn_tivtv_irq_handler(int irq, void *dev_id)1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil
2007-04-27 919 {1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 920 struct ivtv *itv = (struct ivtv *)dev_id; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 921 u32 combo; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 922 u32 stat; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 923 int i; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 924 u8 vsync_force = 0; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 925 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 926 spin_lock(&itv->dma_reg_lock); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 927 /* get contents of irq status register */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 928 stat = read_reg(IVTV_REG_IRQSTATUS);
1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil
2007-04-27 9291a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-04-27 930 combo = ~itv->irqmask & stat;1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil
2007-04-27 9311a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 932 /* Clear out IRQ */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 933 if (combo) write_reg(combo, IVTV_REG_IRQSTATUS); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 934 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 935 if (0 == combo) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 936 /* The vsync interrupt is unusual and clears itself. If we 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 937 * took too long, we may have missed it. Do some checks 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 938 */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 939 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 940 /* vsync is enabled, see if we're in a new field */ 4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 941 if ((itv->last_vsync_field & 1) != 4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 942 (read_reg(IVTV_REG_DEC_LINE_FIELD) & 1)) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 943 /* New field, looks like we missed it */ 4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 944 IVTV_DEBUG_YUV("VSync interrupt missed %d\n", 4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 945 read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 946 vsync_force = 1; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 947 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 948 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 949 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 950 if (!vsync_force) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 951 /* No Vsync expected, wasn't for us */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 952 spin_unlock(&itv->dma_reg_lock); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 953 return IRQ_NONE; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 954 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 955 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 956 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 957 /* Exclude interrupts noted below from the output, otherwise the log is flooded with 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 958 these messages */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 959 if (combo & ~0xff6d0400) bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 960 IVTV_DEBUG_HI_IRQ("======= valid IRQ bits: 0x%08x ======\n", combo); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 961 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 962 if (combo & IVTV_IRQ_DEC_DMA_COMPLETE) { bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 963 IVTV_DEBUG_HI_IRQ("DEC DMA COMPLETE\n"); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 964 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 965 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 966 if (combo & IVTV_IRQ_DMA_READ) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 967 ivtv_irq_dma_read(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 968 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 969 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 970 if (combo & IVTV_IRQ_ENC_DMA_COMPLETE) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 971 ivtv_irq_enc_dma_complete(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 972 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 973 dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 974 if (combo & IVTV_IRQ_ENC_PIO_COMPLETE) { dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 975 ivtv_irq_enc_pio_complete(itv); dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 976 } dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 977 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 978 if (combo & IVTV_IRQ_DMA_ERR) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 979 ivtv_irq_dma_err(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 980 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 981 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 982 if (combo & IVTV_IRQ_ENC_START_CAP) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 983 ivtv_irq_enc_start_cap(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 984 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 985 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 986 if (combo & IVTV_IRQ_ENC_VBI_CAP) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 987 ivtv_irq_enc_vbi_cap(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 988 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 989 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 990 if (combo & IVTV_IRQ_DEC_VBI_RE_INSERT) { dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 991 ivtv_irq_dec_vbi_reinsert(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 992 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 993 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 994 if (combo & IVTV_IRQ_ENC_EOS) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 995 IVTV_DEBUG_IRQ("ENC EOS\n"); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 996 set_bit(IVTV_F_I_EOS, &itv->i_flags); fd8b281a2809d2 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-23 997 wake_up(&itv->eos_waitq); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 998 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 999 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1000 if (combo & IVTV_IRQ_DEC_DATA_REQ) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1001 ivtv_irq_dec_data_req(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1002 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1003 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1004 /* Decoder Vertical Sync - We can't rely on 'combo', so check if vsync enabled */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1005 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1006 ivtv_irq_vsync(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1007 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1008 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1009 if (combo & IVTV_IRQ_ENC_VIM_RST) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1010 IVTV_DEBUG_IRQ("VIM RST\n"); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1011 /*ivtv_vapi(itv, CX2341X_ENC_REFRESH_INPUT, 0); */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1012 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1013 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1014 if (combo & IVTV_IRQ_DEC_AUD_MODE_CHG) { 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1015 IVTV_DEBUG_INFO("Stereo mode changed\n"); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1016 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1017 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1018 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_DMA, &itv->i_flags)) { 33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1019 itv->irq_rr_idx++; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1020 for (i = 0; i < IVTV_MAX_STREAMS; i++) { 33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1021 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1022 struct ivtv_stream *s = &itv->streams[idx]; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1023 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1024 if (!test_and_clear_bit(IVTV_F_S_DMA_PENDING, &s->s_flags)) 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1025 continue; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1026 if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1027 ivtv_dma_dec_start(s); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1028 else 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1029 ivtv_dma_enc_start(s); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1030 break; 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1031 } b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1032 b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1033 if (i == IVTV_MAX_STREAMS && b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1034 test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags)) 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1035 ivtv_udma_start(itv); 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1036 } 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1037 dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1038 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_PIO, &itv->i_flags)) { 33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1039 itv->irq_rr_idx++; dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1040 for (i = 0; i < IVTV_MAX_STREAMS; i++) { 33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1041 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS; dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1042 struct ivtv_stream *s = &itv->streams[idx]; dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1043 dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1044 if (!test_and_clear_bit(IVTV_F_S_PIO_PENDING, &s->s_flags)) dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1045 continue; dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1046 if (s->type == IVTV_DEC_STREAM_TYPE_VBI || s->type < IVTV_DEC_STREAM_TYPE_MPG) dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1047 ivtv_dma_enc_start(s); dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1048 break; dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1049 } dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1050 } dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1051 2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1052 if (test_and_clear_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags)) { 3989144f863ac5 drivers/media/pci/ivtv/ivtv-irq.c Petr Mladek 2016-10-11 @1053 kthread_queue_work(&itv->irq_worker, &itv->irq_work); 2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1054 }
dc02d50a6d71cbdrivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-05-19 10551a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-04-27 1056spin_unlock(&itv->dma_reg_lock);1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-04-27 10571a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1058 /* If we've just handled a 'forced' vsync, it's safest to say it 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1059 * wasn't ours. Another device may have triggered it at just 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1060 * the right time. 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1061 */ 1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1062 return vsync_force ? IRQ_NONE : IRQ_HANDLED;
Quoted 8 lines
1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-04-27 1063 }1a0adaf37c30e8drivers/media/video/ivtv/ivtv-irq.cHans Verkuil 2007-04-27 1064--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v2 5/5] kthread: remove worker->task self assignment
In reply to Bradley Morgankernel test robot noticed the following build errors:
Hi Bradley,
kernel test robot noticed the following build errors:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on tty/tty-next tty/tty-linus rafael-pm/linux-next rafael-pm/bleeding-edge brauner-vfs/vfs.all linus/master v7.3-rc1 next-20260904] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Bradley-Morgan/media-ivtv-convert-to-kthread_run_worker/20260904-093753 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing patch link: https://lore.kernel.org/r/c925e99c73bea9e0cdab656ba09453df7e81dcb2.1788513591.git.brads%40mainlining.org patch subject: [PATCH v2 5/5] kthread: remove worker->task self assignment config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260905/[email protected]/config) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260905/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/media/pci/ivtv/ivtv-irq.c:1053:22: error: incompatible pointer types passing 'struct kthread_worker **' to parameter of type 'struct kthread_worker *'; remove & [-Werror,-Wincompatible-pointer-types]
1053 | kthread_queue_work(&itv->irq_worker, &itv->irq_work);
| ^~~~~~~~~~~~~~~~ include/linux/kthread.h:263:48: note: passing argument to parameter 'worker' here
263 | bool kthread_queue_work(struct kthread_worker *worker,
| ^
1 error generated.
vim +1053 drivers/media/pci/ivtv/ivtv-irq.c
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 917
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 918 irqreturn_t ivtv_irq_handler(int irq, void *dev_id)
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 919 {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 920 struct ivtv *itv = (struct ivtv *)dev_id;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 921 u32 combo;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 922 u32 stat;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 923 int i;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 924 u8 vsync_force = 0;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 925
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 926 spin_lock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 927 /* get contents of irq status register */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 928 stat = read_reg(IVTV_REG_IRQSTATUS);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 929
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 930 combo = ~itv->irqmask & stat;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 931
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 932 /* Clear out IRQ */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 933 if (combo) write_reg(combo, IVTV_REG_IRQSTATUS);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 934
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 935 if (0 == combo) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 936 /* The vsync interrupt is unusual and clears itself. If we
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 937 * took too long, we may have missed it. Do some checks
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 938 */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 939 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 940 /* vsync is enabled, see if we're in a new field */
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 941 if ((itv->last_vsync_field & 1) !=
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 942 (read_reg(IVTV_REG_DEC_LINE_FIELD) & 1)) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 943 /* New field, looks like we missed it */
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 944 IVTV_DEBUG_YUV("VSync interrupt missed %d\n",
4e1af31aaaa8cc drivers/media/video/ivtv/ivtv-irq.c Andy Walls 2010-03-13 945 read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 946 vsync_force = 1;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 947 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 948 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 949
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 950 if (!vsync_force) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 951 /* No Vsync expected, wasn't for us */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 952 spin_unlock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 953 return IRQ_NONE;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 954 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 955 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 956
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 957 /* Exclude interrupts noted below from the output, otherwise the log is flooded with
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 958 these messages */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 959 if (combo & ~0xff6d0400)
bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 960 IVTV_DEBUG_HI_IRQ("======= valid IRQ bits: 0x%08x ======\n", combo);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 961
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 962 if (combo & IVTV_IRQ_DEC_DMA_COMPLETE) {
bd58df6d522d5a drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-07-10 963 IVTV_DEBUG_HI_IRQ("DEC DMA COMPLETE\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 964 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 965
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 966 if (combo & IVTV_IRQ_DMA_READ) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 967 ivtv_irq_dma_read(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 968 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 969
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 970 if (combo & IVTV_IRQ_ENC_DMA_COMPLETE) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 971 ivtv_irq_enc_dma_complete(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 972 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 973
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 974 if (combo & IVTV_IRQ_ENC_PIO_COMPLETE) {
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 975 ivtv_irq_enc_pio_complete(itv);
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 976 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 977
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 978 if (combo & IVTV_IRQ_DMA_ERR) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 979 ivtv_irq_dma_err(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 980 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 981
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 982 if (combo & IVTV_IRQ_ENC_START_CAP) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 983 ivtv_irq_enc_start_cap(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 984 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 985
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 986 if (combo & IVTV_IRQ_ENC_VBI_CAP) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 987 ivtv_irq_enc_vbi_cap(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 988 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 989
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 990 if (combo & IVTV_IRQ_DEC_VBI_RE_INSERT) {
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 991 ivtv_irq_dec_vbi_reinsert(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 992 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 993
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 994 if (combo & IVTV_IRQ_ENC_EOS) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 995 IVTV_DEBUG_IRQ("ENC EOS\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 996 set_bit(IVTV_F_I_EOS, &itv->i_flags);
fd8b281a2809d2 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-23 997 wake_up(&itv->eos_waitq);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 998 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 999
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1000 if (combo & IVTV_IRQ_DEC_DATA_REQ) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1001 ivtv_irq_dec_data_req(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1002 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1003
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1004 /* Decoder Vertical Sync - We can't rely on 'combo', so check if vsync enabled */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1005 if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1006 ivtv_irq_vsync(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1007 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1008
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1009 if (combo & IVTV_IRQ_ENC_VIM_RST) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1010 IVTV_DEBUG_IRQ("VIM RST\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1011 /*ivtv_vapi(itv, CX2341X_ENC_REFRESH_INPUT, 0); */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1012 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1013
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1014 if (combo & IVTV_IRQ_DEC_AUD_MODE_CHG) {
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1015 IVTV_DEBUG_INFO("Stereo mode changed\n");
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1016 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1017
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1018 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_DMA, &itv->i_flags)) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1019 itv->irq_rr_idx++;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1020 for (i = 0; i < IVTV_MAX_STREAMS; i++) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1021 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1022 struct ivtv_stream *s = &itv->streams[idx];
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1023
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1024 if (!test_and_clear_bit(IVTV_F_S_DMA_PENDING, &s->s_flags))
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1025 continue;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1026 if (s->type >= IVTV_DEC_STREAM_TYPE_MPG)
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1027 ivtv_dma_dec_start(s);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1028 else
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1029 ivtv_dma_enc_start(s);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1030 break;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1031 }
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1032
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1033 if (i == IVTV_MAX_STREAMS &&
b6e436b263b354 drivers/media/video/ivtv/ivtv-irq.c Ian Armstrong 2009-12-21 1034 test_bit(IVTV_F_I_UDMA_PENDING, &itv->i_flags))
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1035 ivtv_udma_start(itv);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1036 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1037
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1038 if ((combo & IVTV_IRQ_DMA) && !test_bit(IVTV_F_I_PIO, &itv->i_flags)) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1039 itv->irq_rr_idx++;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1040 for (i = 0; i < IVTV_MAX_STREAMS; i++) {
33bc4dea0ece37 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-18 1041 int idx = (i + itv->irq_rr_idx) % IVTV_MAX_STREAMS;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1042 struct ivtv_stream *s = &itv->streams[idx];
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1043
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1044 if (!test_and_clear_bit(IVTV_F_S_PIO_PENDING, &s->s_flags))
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1045 continue;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1046 if (s->type == IVTV_DEC_STREAM_TYPE_VBI || s->type < IVTV_DEC_STREAM_TYPE_MPG)
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1047 ivtv_dma_enc_start(s);
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1048 break;
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1049 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1050 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1051
2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1052 if (test_and_clear_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags)) {
3989144f863ac5 drivers/media/pci/ivtv/ivtv-irq.c Petr Mladek 2016-10-11 @1053 kthread_queue_work(&itv->irq_worker, &itv->irq_work);
2f3a98931f51be drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-08-25 1054 }
dc02d50a6d71cb drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-05-19 1055
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1056 spin_unlock(&itv->dma_reg_lock);
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1057
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1058 /* If we've just handled a 'forced' vsync, it's safest to say it
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1059 * wasn't ours. Another device may have triggered it at just
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1060 * the right time.
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1061 */
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1062 return vsync_force ? IRQ_NONE : IRQ_HANDLED;
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1063 }
1a0adaf37c30e8 drivers/media/video/ivtv/ivtv-irq.c Hans Verkuil 2007-04-27 1064 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Jakub Kicinski
maintainerQuoted 4 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_worker
Please send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignment
Then after the next merge window when trees converge send this one out
Quoted 11 lines · Jakub Kicinski
Quoted 4 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerPlease send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one out
hi, I was hoping one person could merge it with acks from all subsystems
Jakub Kicinski
maintainerQuoted 7 lines · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
Quoted 6 lines · Jakub Kicinski
Quoted 4 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_worker
Quoted 7 lines
Quoted 5 lines
Please send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one out
hi, I was hoping one person could merge it with acks from all subsystems
Not how this works.
Quoted 11 lines · Jakub Kicinski
Quoted 1 line · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
On 4 September 2026 16:54:18 BST, Jakub Kicinski <[email protected]>
Quoted 8 lines · wrote:
Quoted 8 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
Quoted 4 lines
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerPlease send these 4 to appropriate subsystems
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one out
hi, I was hoping one person could merge it with acks from all subsystems
Not how this works.
Ugh, I've seen it before happen.
Look, fine, I'll do a V3 soon, WITH ONLY the subsystem changes, all separate, all sent over to their respective maintainers, then when all thathas been merged and there's the next merge window, then whatever, I'll send then the kthread removal
IMHO this is a massive annoyance though.. because what if one of the driverfolks doesn't wanna respond to me!?!
--- Thanks!
https://lore.kernel.org/all/[email protected]/
Greg Kroah-Hartman
maintainerQuoted 21 lines · Bradley Morgan
Quoted 11 lines · Jakub Kicinski
Quoted 1 line · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
On 4 September 2026 16:54:18 BST, Jakub Kicinski <[email protected]>
Quoted 8 lines · wrote:
Quoted 8 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
Quoted 4 lines
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerPlease send these 4 to appropriate subsystems
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one out
hi, I was hoping one person could merge it with acks from all subsystems
Not how this works.
Ugh, I've seen it before happen.
Quoted 7 lines
Look, fine, I'll do a V3 soon, WITH ONLY the subsystem changes, all separate, all sent over to their respective maintainers, then when all thathas been merged and there's the next merge window, then whatever, I'll send then the kthread removal
IMHO this is a massive annoyance though.. because what if one of the driverfolks doesn't wanna respond to me!?!
Then, after trying for the normal way, you can make the driver change at the same time. But to circumvent the "normal way" thinking it might not work, is not the best thing to do.
thanks,
greg k-h
Quoted 29 lines · Greg Kroah-Hartman
Quoted 1 line · Bradley Morgan
On 4 September 2026 22:10:32 BST, Jakub Kicinski <[email protected]>
Quoted 9 lines · wrote:
Quoted 9 lines · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
Quoted 1 line
On 4 September 2026 16:54:18 BST, Jakub Kicinski <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
Quoted 4 lines
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Please send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one
out
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
hi, I was hoping one person could merge it with acks from all
subsystems
Quoted 7 lines
Quoted 2 lines
Not how this works.
Ugh, I've seen it before happen.
Look, fine, I'll do a V3 soon, WITH ONLY the subsystem changes, all separate, all sent over to their respective maintainers, then when all thathas been merged and there's the next merge window, then whatever,
I'll
Quoted 9 lines
Quoted 4 lines
send then the kthread removal
IMHO this is a massive annoyance though.. because what if one of the driverfolks doesn't wanna respond to me!?!
Then, after trying for the normal way, you can make the driver change at the same time. But to circumvent the "normal way" thinking it might not work, is not the best thing to do.
Greg!
Right, okay, Ill tell you more.
For features being added, where many drivers from different subsystems get covered at once, what they tend to do is:
A: send all patches, rely on all maintainers to merge their own crap, which is a mess
B: Have a designated merger, who merges all the changes at once, no chance of regression because it's all bundled up.
C: send drivers first, then send the feature. So then driver maintainers can merge their crap, then the main feature gets merged in merge window
I prefer B, because it's easier that way, akpm is usually des merger hence I CCed him.
Or tip tree?
Honestly, if I had to be honest, C is a very annoying way, because of what I said above, if driver maintainer thinks I'm some newbie idiot or something, then what will I do? He won't merge it!
Quoted 3 lines
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 55 lines · Bradley Morgan
Quoted 29 lines · Greg Kroah-Hartman
Quoted 1 line · Bradley Morgan
On 4 September 2026 22:10:32 BST, Jakub Kicinski <[email protected]>
Quoted 9 lines · wrote:
Quoted 9 lines · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
Quoted 1 line
On 4 September 2026 16:54:18 BST, Jakub Kicinski <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
Quoted 4 lines
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Please send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this one
out
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
hi, I was hoping one person could merge it with acks from all
subsystems
Quoted 7 lines
Quoted 2 lines
Not how this works.
Ugh, I've seen it before happen.
Look, fine, I'll do a V3 soon, WITH ONLY the subsystem changes, all separate, all sent over to their respective maintainers, then when all thathas been merged and there's the next merge window, then whatever,
I'll
Quoted 9 lines
Quoted 4 lines
send then the kthread removal
IMHO this is a massive annoyance though.. because what if one of the driverfolks doesn't wanna respond to me!?!
Then, after trying for the normal way, you can make the driver change at the same time. But to circumvent the "normal way" thinking it might not work, is not the best thing to do.
Greg!
Right, okay, Ill tell you more.
For features being added, where many drivers from different subsystems get covered at once, what they tend to do is:
A: send all patches, rely on all maintainers to merge their own crap, which is a mess
B: Have a designated merger, who merges all the changes at once, no chance of regression because it's all bundled up.
C: send drivers first, then send the feature. So then driver maintainers can merge their crap, then the main feature gets merged in merge window
Quoted 8 lines
I prefer B, because it's easier that way, akpm is usually des merger hence I CCed him.
Or tip tree?
Honestly, if I had to be honest, C is a very annoying way, because of what I said above, if driver maintainer thinks I'm some newbie idiot or something, then what will I do? He won't merge it!
To quote a longtime kernel developer years ago, "Kernel development is hard, let's go shopping."
Sorry, but yes, it can be difficult to touch cross-subsystem stuff like this, always has been. Just be patient.
good luck!
greg k-h
Quoted 75 lines · Greg Kroah-Hartman
Quoted 14 lines · Bradley Morgan
Quoted 12 lines · Greg Kroah-Hartman
Quoted 1 line · Bradley Morgan
On 4 September 2026 22:10:32 BST, Jakub Kicinski <[email protected]>
Quoted 9 lines · wrote:
Quoted 9 lines · On Fri, 04 Sep 2026 16:56:30 +0100 Bradley Morgan wrote:
Quoted 1 line
On 4 September 2026 16:54:18 BST, Jakub Kicinski <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines · On Fri, 4 Sep 2026 09:37:21 +0000 Bradley Morgan wrote:
Quoted 4 lines
media: ivtv: convert to
kthread_run_worker
net: encx24j600: convert tokthread_run_worker
tty: sc16is7xx: convert tokthread_run_worker
cpufreq: schedutil: convert tokthread_create_workerQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Please send these 4 to appropriate subsystems
Quoted 1 line
kthread: remove
worker->taskself assignmentThen after the next merge window when trees converge send this
one
Quoted 10 lines
Quoted 10 lines
out
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
hi, I was hoping one person could merge it with acks from all
subsystems
Quoted 6 lines
Quoted 2 lines
Not how this works.
Ugh, I've seen it before happen.
Look, fine, I'll do a V3 soon, WITH ONLY the subsystem changes, all separate, all sent over to their respective maintainers, then when
all
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
thathas been merged and there's the next merge window, then whatever,
I'll
Quoted 4 lines
send then the kthread removal
IMHO this is a massive annoyance though.. because what if one of the driverfolks doesn't wanna respond to me!?!
Then, after trying for the normal way, you can make the driver change
at
Quoted 1 line
Quoted 1 line
the same time. But to circumvent the "normal way" thinking it might
not
Quoted 8 lines
Quoted 2 lines
work, is not the best thing to do.
Greg!
Right, okay, Ill tell you more.
For features being added, where many drivers from different subsystems
get
Quoted 3 lines
covered at once, what they tend to do is:
A: send all patches, rely on all maintainers to merge their own crap,
which is a mess
Quoted 2 lines
B: Have a designated merger, who merges all the changes at once, no
chance of regression because it's all bundled up.
Quoted 3 lines
C: send drivers first, then send the feature. So then driver maintainers
can merge their crap, then the main feature gets merged in merge window
Quoted 2 lines
I prefer B, because it's easier that way, akpm is usually des merger
hence
Quoted 5 lines
I CCed him.
Or tip tree?
Honestly, if I had to be honest, C is a very annoying way, because of
what
Quoted 2 lines
I said above, if driver maintainer thinks I'm some newbie idiot or something, then what will I do? He won't merge it!
Quoted 7 lines
To quote a longtime kernel developer years ago, "Kernel development is hard, let's go shopping."
Sorry, but yes, it can be difficult to touch cross-subsystem stuff like this, always has been. Just be patient.
good luck!
Yes. Ack.
I feel this is convoluted.
(I do mean sashiko did start crying! , sigh)
But tbh, B is the best option. For me atleast. Is C a requirement?
Quoted 2 lines
greg k-h