Re: [Openipmi-developer] [PATCH 2/9] dma: Convert from tasklet to BH workqueue

2024-03-27 Thread Vinod Koul
Hi Allen,

Subsytem is dmaengine, can you rename this to dmaengine: ...

On 27-03-24, 16:03, Allen Pais wrote:
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.

Thanks for conversion, am happy with BH alternative as it helps in
dmaengine where we need shortest possible time between tasklet and
interrupt handling to maximize dma performance

> 
> This patch converts drivers/dma/* from tasklet to BH workqueue.

> 
> Based on the work done by Tejun Heo 
> Branch: git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> 
> Signed-off-by: Allen Pais 
> ---
>  drivers/dma/altera-msgdma.c   | 15 
>  drivers/dma/apple-admac.c | 15 
>  drivers/dma/at_hdmac.c|  2 +-
>  drivers/dma/at_xdmac.c| 15 
>  drivers/dma/bcm2835-dma.c |  2 +-
>  drivers/dma/dma-axi-dmac.c|  2 +-
>  drivers/dma/dma-jz4780.c  |  2 +-
>  .../dma/dw-axi-dmac/dw-axi-dmac-platform.c|  2 +-
>  drivers/dma/dw-edma/dw-edma-core.c|  2 +-
>  drivers/dma/dw/core.c | 13 +++
>  drivers/dma/dw/regs.h |  3 +-
>  drivers/dma/ep93xx_dma.c  | 15 
>  drivers/dma/fsl-edma-common.c |  2 +-
>  drivers/dma/fsl-qdma.c|  2 +-
>  drivers/dma/fsl_raid.c| 11 +++---
>  drivers/dma/fsl_raid.h|  2 +-
>  drivers/dma/fsldma.c  | 15 
>  drivers/dma/fsldma.h  |  3 +-
>  drivers/dma/hisi_dma.c|  2 +-
>  drivers/dma/hsu/hsu.c |  2 +-
>  drivers/dma/idma64.c  |  4 +--
>  drivers/dma/img-mdc-dma.c |  2 +-
>  drivers/dma/imx-dma.c | 27 +++---
>  drivers/dma/imx-sdma.c|  6 ++--
>  drivers/dma/ioat/dma.c| 17 -
>  drivers/dma/ioat/dma.h|  5 +--
>  drivers/dma/ioat/init.c   |  2 +-
>  drivers/dma/k3dma.c   | 19 +-
>  drivers/dma/mediatek/mtk-cqdma.c  | 35 ++-
>  drivers/dma/mediatek/mtk-hsdma.c  |  2 +-
>  drivers/dma/mediatek/mtk-uart-apdma.c |  4 +--
>  drivers/dma/mmp_pdma.c| 13 +++
>  drivers/dma/mmp_tdma.c| 11 +++---
>  drivers/dma/mpc512x_dma.c | 17 -
>  drivers/dma/mv_xor.c  | 13 +++
>  drivers/dma/mv_xor.h  |  5 +--
>  drivers/dma/mv_xor_v2.c   | 23 ++--
>  drivers/dma/mxs-dma.c | 13 +++
>  drivers/dma/nbpfaxi.c | 15 
>  drivers/dma/owl-dma.c |  2 +-
>  drivers/dma/pch_dma.c | 17 -
>  drivers/dma/pl330.c   | 31 
>  drivers/dma/plx_dma.c | 13 +++
>  drivers/dma/ppc4xx/adma.c | 17 -
>  drivers/dma/ppc4xx/adma.h |  5 +--
>  drivers/dma/pxa_dma.c |  2 +-
>  drivers/dma/qcom/bam_dma.c| 35 ++-
>  drivers/dma/qcom/gpi.c| 18 +-
>  drivers/dma/qcom/hidma.c  | 11 +++---
>  drivers/dma/qcom/hidma.h  |  5 +--
>  drivers/dma/qcom/hidma_ll.c   | 11 +++---
>  drivers/dma/qcom/qcom_adm.c   |  2 +-
>  drivers/dma/sa11x0-dma.c  | 27 +++---
>  drivers/dma/sf-pdma/sf-pdma.c | 23 ++--
>  drivers/dma/sf-pdma/sf-pdma.h |  5 +--
>  drivers/dma/sprd-dma.c|  2 +-
>  drivers/dma/st_fdma.c |  2 +-
>  drivers/dma/ste_dma40.c   | 17 -
>  drivers/dma/sun6i-dma.c   | 33 -
>  drivers/dma/tegra186-gpc-dma.c|  2 +-
>  drivers/dma/tegra20-apb-dma.c | 19 +-
>  drivers/dma/tegra210-adma.c   |  2 +-
>  drivers/dma/ti/edma.c |  2 +-
>  drivers/dma/ti/k3-udma.c  | 11 +++---
>  drivers/dma/ti/omap-dma.c |  2 +-
>  drivers/dma/timb_dma.c| 23 ++--
>  drivers/dma/txx9dmac.c| 29 +++
>  drivers/dma/txx9dmac.h  

Re: [Openipmi-developer] [PATCH 9/9] mmc: Convert from tasklet to BH workqueue

2024-03-27 Thread Jernej Škrabec
Dne sreda, 27. marec 2024 ob 17:03:14 CET je Allen Pais napisal(a):
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts drivers/infiniband/* from tasklet to BH workqueue.

infiniband -> mmc

Best regards,
Jernej

> 
> Based on the work done by Tejun Heo 
> Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> 
> Signed-off-by: Allen Pais 





___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH 4/9] USB: Convert from tasklet to BH workqueue

2024-03-27 Thread Alan Stern
On Wed, Mar 27, 2024 at 04:03:09PM +, Allen Pais wrote:
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts drivers/infiniband/* from tasklet to BH workqueue.
> 
> Based on the work done by Tejun Heo 
> Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> 
> Signed-off-by: Allen Pais 
> ---

> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index c0e005670d67..88d8e1c366cd 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c

> @@ -1662,10 +1663,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
>   usb_put_urb(urb);
>  }
>  
> -static void usb_giveback_urb_bh(struct work_struct *work)
> +static void usb_giveback_urb_bh(struct work_struct *t)
>  {
> - struct giveback_urb_bh *bh =
> - container_of(work, struct giveback_urb_bh, bh);
> + struct giveback_urb_bh *bh = from_work(bh, t, bh);
>   struct list_head local_list;
>  
>   spin_lock_irq(>lock);

Is there any reason for this apparently pointless change of a local
variable's name?

Alan Stern


___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH 6/9] ipmi: Convert from tasklet to BH workqueue

2024-03-27 Thread Corey Minyard
On Wed, Mar 27, 2024 at 04:03:11PM +, Allen Pais wrote:
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts drivers/infiniband/* from tasklet to BH workqueue.

I think you mean drivers/char/ipmi/* here.

I believe that work queues items are execute single-threaded for a work
queue, so this should be good.  I need to test this, though.  It may be
that an IPMI device can have its own work queue; it may not be important
to run it in bh context.

-corey

> 
> Based on the work done by Tejun Heo 
> Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> 
> Signed-off-by: Allen Pais 
> ---
>  drivers/char/ipmi/ipmi_msghandler.c | 30 ++---
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
> b/drivers/char/ipmi/ipmi_msghandler.c
> index b0eedc4595b3..fce2a2dbdc82 100644
> --- a/drivers/char/ipmi/ipmi_msghandler.c
> +++ b/drivers/char/ipmi/ipmi_msghandler.c
> @@ -36,12 +36,13 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #define IPMI_DRIVER_VERSION "39.2"
>  
>  static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
>  static int ipmi_init_msghandler(void);
> -static void smi_recv_tasklet(struct tasklet_struct *t);
> +static void smi_recv_work(struct work_struct *t);
>  static void handle_new_recv_msgs(struct ipmi_smi *intf);
>  static void need_waiter(struct ipmi_smi *intf);
>  static int handle_one_recv_msg(struct ipmi_smi *intf,
> @@ -498,13 +499,13 @@ struct ipmi_smi {
>   /*
>* Messages queued for delivery.  If delivery fails (out of memory
>* for instance), They will stay in here to be processed later in a
> -  * periodic timer interrupt.  The tasklet is for handling received
> +  * periodic timer interrupt.  The work is for handling received
>* messages directly from the handler.
>*/
>   spinlock_t   waiting_rcv_msgs_lock;
>   struct list_head waiting_rcv_msgs;
>   atomic_t watchdog_pretimeouts_to_deliver;
> - struct tasklet_struct recv_tasklet;
> + struct work_struct recv_work;
>  
>   spinlock_t xmit_msgs_lock;
>   struct list_head   xmit_msgs;
> @@ -704,7 +705,7 @@ static void clean_up_interface_data(struct ipmi_smi *intf)
>   struct cmd_rcvr  *rcvr, *rcvr2;
>   struct list_head list;
>  
> - tasklet_kill(>recv_tasklet);
> + cancel_work_sync(>recv_work);
>  
>   free_smi_msg_list(>waiting_rcv_msgs);
>   free_recv_msg_list(>waiting_events);
> @@ -1319,7 +1320,7 @@ static void free_user(struct kref *ref)
>  {
>   struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
>  
> - /* SRCU cleanup must happen in task context. */
> + /* SRCU cleanup must happen in work context. */
>   queue_work(remove_work_wq, >remove_work);
>  }
>  
> @@ -3605,8 +3606,7 @@ int ipmi_add_smi(struct module *owner,
>   intf->curr_seq = 0;
>   spin_lock_init(>waiting_rcv_msgs_lock);
>   INIT_LIST_HEAD(>waiting_rcv_msgs);
> - tasklet_setup(>recv_tasklet,
> -  smi_recv_tasklet);
> + INIT_WORK(>recv_work, smi_recv_work);
>   atomic_set(>watchdog_pretimeouts_to_deliver, 0);
>   spin_lock_init(>xmit_msgs_lock);
>   INIT_LIST_HEAD(>xmit_msgs);
> @@ -4779,7 +4779,7 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf)
>* To preserve message order, quit if we
>* can't handle a message.  Add the message
>* back at the head, this is safe because this
> -  * tasklet is the only thing that pulls the
> +  * work is the only thing that pulls the
>* messages.
>*/
>   list_add(_msg->link, >waiting_rcv_msgs);
> @@ -4812,10 +4812,10 @@ static void handle_new_recv_msgs(struct ipmi_smi 
> *intf)
>   }
>  }
>  
> -static void smi_recv_tasklet(struct tasklet_struct *t)
> +static void smi_recv_work(struct work_struct *t)
>  {
>   unsigned long flags = 0; /* keep us warning-free. */
> - struct ipmi_smi *intf = from_tasklet(intf, t, recv_tasklet);
> + struct ipmi_smi *intf = from_work(intf, t, recv_work);
>   int run_to_completion = intf->run_to_completion;
>   struct ipmi_smi_msg *newmsg = NULL;
>  
> @@ -4866,7 +4866,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,
>  
>   /*
>* To preserve message order, we keep a queue and deliver from
> -  * a tasklet.
> +  * a work.
>*/
>   if (!run_to_completion)
>   spin_lock_irqsave(>waiting_rcv_msgs_lock, flags);
> @@ -4887,9 

[Openipmi-developer] [PATCH 7/9] s390: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Note: Not tested. Please test/review.

Signed-off-by: Allen Pais 
---
 drivers/s390/block/dasd.c  | 42 
 drivers/s390/block/dasd_int.h  | 10 +++---
 drivers/s390/char/con3270.c| 27 
 drivers/s390/crypto/ap_bus.c   | 24 +++---
 drivers/s390/crypto/ap_bus.h   |  2 +-
 drivers/s390/crypto/zcrypt_msgtype50.c |  2 +-
 drivers/s390/crypto/zcrypt_msgtype6.c  |  4 +--
 drivers/s390/net/ctcm_fsms.c   |  4 +--
 drivers/s390/net/ctcm_main.c   | 15 -
 drivers/s390/net/ctcm_main.h   |  5 +--
 drivers/s390/net/ctcm_mpc.c| 12 +++
 drivers/s390/net/ctcm_mpc.h|  7 ++--
 drivers/s390/net/lcs.c | 26 +++
 drivers/s390/net/lcs.h |  2 +-
 drivers/s390/net/qeth_core_main.c  |  2 +-
 drivers/s390/scsi/zfcp_qdio.c  | 45 +-
 drivers/s390/scsi/zfcp_qdio.h  |  9 +++---
 17 files changed, 117 insertions(+), 121 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 0a97cfedd706..c6f9910f0a98 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -54,8 +54,8 @@ MODULE_LICENSE("GPL");
  * SECTION: prototypes for static functions of dasd.c
  */
 static int dasd_flush_block_queue(struct dasd_block *);
-static void dasd_device_tasklet(unsigned long);
-static void dasd_block_tasklet(unsigned long);
+static void dasd_device_work(struct work_struct *);
+static void dasd_block_work(struct work_struct *);
 static void do_kick_device(struct work_struct *);
 static void do_reload_device(struct work_struct *);
 static void do_requeue_requests(struct work_struct *);
@@ -114,9 +114,8 @@ struct dasd_device *dasd_alloc_device(void)
dasd_init_chunklist(>erp_chunks, device->erp_mem, PAGE_SIZE);
dasd_init_chunklist(>ese_chunks, device->ese_mem, PAGE_SIZE * 
2);
spin_lock_init(>mem_lock);
-   atomic_set(>tasklet_scheduled, 0);
-   tasklet_init(>tasklet, dasd_device_tasklet,
-(unsigned long) device);
+   atomic_set(>work_scheduled, 0);
+   INIT_WORK(>bh, dasd_device_work);
INIT_LIST_HEAD(>ccw_queue);
timer_setup(>timer, dasd_device_timeout, 0);
INIT_WORK(>kick_work, do_kick_device);
@@ -154,9 +153,8 @@ struct dasd_block *dasd_alloc_block(void)
/* open_count = 0 means device online but not in use */
atomic_set(>open_count, -1);
 
-   atomic_set(>tasklet_scheduled, 0);
-   tasklet_init(>tasklet, dasd_block_tasklet,
-(unsigned long) block);
+   atomic_set(>work_scheduled, 0);
+   INIT_WORK(>bh, dasd_block_work);
INIT_LIST_HEAD(>ccw_queue);
spin_lock_init(>queue_lock);
INIT_LIST_HEAD(>format_list);
@@ -2148,12 +2146,12 @@ EXPORT_SYMBOL_GPL(dasd_flush_device_queue);
 /*
  * Acquire the device lock and process queues for the device.
  */
-static void dasd_device_tasklet(unsigned long data)
+static void dasd_device_work(struct work_struct *t)
 {
-   struct dasd_device *device = (struct dasd_device *) data;
+   struct dasd_device *device = from_work(device, t, bh);
struct list_head final_queue;
 
-   atomic_set (>tasklet_scheduled, 0);
+   atomic_set (>work_scheduled, 0);
INIT_LIST_HEAD(_queue);
spin_lock_irq(get_ccwdev_lock(device->cdev));
/* Check expire time of first request on the ccw queue. */
@@ -2174,15 +2172,15 @@ static void dasd_device_tasklet(unsigned long data)
 }
 
 /*
- * Schedules a call to dasd_tasklet over the device tasklet.
+ * Schedules a call to dasd_work over the device wq.
  */
 void dasd_schedule_device_bh(struct dasd_device *device)
 {
/* Protect against rescheduling. */
-   if (atomic_cmpxchg (>tasklet_scheduled, 0, 1) != 0)
+   if (atomic_cmpxchg (>work_scheduled, 0, 1) != 0)
return;
dasd_get_device(device);
-   tasklet_hi_schedule(>tasklet);
+   queue_work(system_bh_highpri_wq, >bh);
 }
 EXPORT_SYMBOL(dasd_schedule_device_bh);
 
@@ -2595,7 +2593,7 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
else
rc = -EIO;
 
-   /* kick tasklets */
+   /* kick works */
dasd_schedule_device_bh(device);
if (device->block)
dasd_schedule_block_bh(device->block);
@@ -2891,15 +2889,15 @@ static void __dasd_block_start_head(struct dasd_block 

[Openipmi-developer] [PATCH 5/9] mailbox: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/mailbox/bcm-pdc-mailbox.c | 21 +++--
 drivers/mailbox/imx-mailbox.c | 16 
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/mailbox/bcm-pdc-mailbox.c 
b/drivers/mailbox/bcm-pdc-mailbox.c
index 1768d3d5aaa0..242e7504a628 100644
--- a/drivers/mailbox/bcm-pdc-mailbox.c
+++ b/drivers/mailbox/bcm-pdc-mailbox.c
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define PDC_SUCCESS  0
 
@@ -293,8 +294,8 @@ struct pdc_state {
 
unsigned int pdc_irq;
 
-   /* tasklet for deferred processing after DMA rx interrupt */
-   struct tasklet_struct rx_tasklet;
+   /* work for deferred processing after DMA rx interrupt */
+   struct work_struct rx_work;
 
/* Number of bytes of receive status prior to each rx frame */
u32 rx_status_len;
@@ -952,18 +953,18 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)
iowrite32(intstatus, pdcs->pdc_reg_vbase + PDC_INTSTATUS_OFFSET);
 
/* Wakeup IRQ thread */
-   tasklet_schedule(>rx_tasklet);
+   queue_work(system_bh_wq, >rx_work);
return IRQ_HANDLED;
 }
 
 /**
- * pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after
+ * pdc_work_cb() - Work callback that runs the deferred processing after
  * a DMA receive interrupt. Reenables the receive interrupt.
  * @t: Pointer to the Altera sSGDMA channel structure
  */
-static void pdc_tasklet_cb(struct tasklet_struct *t)
+static void pdc_work_cb(struct work_struct *t)
 {
-   struct pdc_state *pdcs = from_tasklet(pdcs, t, rx_tasklet);
+   struct pdc_state *pdcs = from_work(pdcs, t, rx_work);
 
pdc_receive(pdcs);
 
@@ -1577,8 +1578,8 @@ static int pdc_probe(struct platform_device *pdev)
 
pdc_hw_init(pdcs);
 
-   /* Init tasklet for deferred DMA rx processing */
-   tasklet_setup(>rx_tasklet, pdc_tasklet_cb);
+   /* Init work for deferred DMA rx processing */
+   INIT_WORK(>rx_work, pdc_work_cb);
 
err = pdc_interrupts_init(pdcs);
if (err)
@@ -1595,7 +1596,7 @@ static int pdc_probe(struct platform_device *pdev)
return PDC_SUCCESS;
 
 cleanup_buf_pool:
-   tasklet_kill(>rx_tasklet);
+   cancel_work_sync(>rx_work);
dma_pool_destroy(pdcs->rx_buf_pool);
 
 cleanup_ring_pool:
@@ -1611,7 +1612,7 @@ static void pdc_remove(struct platform_device *pdev)
 
pdc_free_debugfs();
 
-   tasklet_kill(>rx_tasklet);
+   cancel_work_sync(>rx_work);
 
pdc_hw_disable(pdcs);
 
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index 5c1d09cad761..933727f89431 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mailbox.h"
 
@@ -80,7 +81,7 @@ struct imx_mu_con_priv {
charirq_desc[IMX_MU_CHAN_NAME_SIZE];
enum imx_mu_chan_type   type;
struct mbox_chan*chan;
-   struct tasklet_struct   txdb_tasklet;
+   struct work_struct  txdb_work;
 };
 
 struct imx_mu_priv {
@@ -232,7 +233,7 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv,
break;
case IMX_MU_TYPE_TXDB:
imx_mu_xcr_rmw(priv, IMX_MU_GCR, 
IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0);
-   tasklet_schedule(>txdb_tasklet);
+   queue_work(system_bh_wq, >txdb_work);
break;
case IMX_MU_TYPE_TXDB_V2:
imx_mu_xcr_rmw(priv, IMX_MU_GCR, 
IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0);
@@ -420,7 +421,7 @@ static int imx_mu_seco_tx(struct imx_mu_priv *priv, struct 
imx_mu_con_priv *cp,
}
 
/* Simulate hack for mbox framework */
-   tasklet_schedule(>txdb_tasklet);
+   queue_work(system_bh_wq, >txdb_work);
 
break;
default:
@@ -484,9 +485,9 @@ static int imx_mu_seco_rxdb(struct imx_mu_priv *priv, 
struct imx_mu_con_priv *cp
return err;
 }
 
-static void imx_mu_txdb_tasklet(unsigned long data)
+static void imx_mu_txdb_work(struct work_struct *t)
 {
-   struct imx_mu_con_priv *cp = (struct imx_mu_con_priv *)data;
+   struct imx_mu_con_priv *cp = from_work(cp, t, txdb_work);
 
mbox_chan_txdone(cp->chan, 0);
 }
@@ -570,8 +571,7 @@ static int imx_mu_startup(struct mbox_chan *chan)
 
if (cp->type == IMX_MU_TYPE_TXDB) 

[Openipmi-developer] [PATCH 2/9] dma: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/dma/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/dma/altera-msgdma.c   | 15 
 drivers/dma/apple-admac.c | 15 
 drivers/dma/at_hdmac.c|  2 +-
 drivers/dma/at_xdmac.c| 15 
 drivers/dma/bcm2835-dma.c |  2 +-
 drivers/dma/dma-axi-dmac.c|  2 +-
 drivers/dma/dma-jz4780.c  |  2 +-
 .../dma/dw-axi-dmac/dw-axi-dmac-platform.c|  2 +-
 drivers/dma/dw-edma/dw-edma-core.c|  2 +-
 drivers/dma/dw/core.c | 13 +++
 drivers/dma/dw/regs.h |  3 +-
 drivers/dma/ep93xx_dma.c  | 15 
 drivers/dma/fsl-edma-common.c |  2 +-
 drivers/dma/fsl-qdma.c|  2 +-
 drivers/dma/fsl_raid.c| 11 +++---
 drivers/dma/fsl_raid.h|  2 +-
 drivers/dma/fsldma.c  | 15 
 drivers/dma/fsldma.h  |  3 +-
 drivers/dma/hisi_dma.c|  2 +-
 drivers/dma/hsu/hsu.c |  2 +-
 drivers/dma/idma64.c  |  4 +--
 drivers/dma/img-mdc-dma.c |  2 +-
 drivers/dma/imx-dma.c | 27 +++---
 drivers/dma/imx-sdma.c|  6 ++--
 drivers/dma/ioat/dma.c| 17 -
 drivers/dma/ioat/dma.h|  5 +--
 drivers/dma/ioat/init.c   |  2 +-
 drivers/dma/k3dma.c   | 19 +-
 drivers/dma/mediatek/mtk-cqdma.c  | 35 ++-
 drivers/dma/mediatek/mtk-hsdma.c  |  2 +-
 drivers/dma/mediatek/mtk-uart-apdma.c |  4 +--
 drivers/dma/mmp_pdma.c| 13 +++
 drivers/dma/mmp_tdma.c| 11 +++---
 drivers/dma/mpc512x_dma.c | 17 -
 drivers/dma/mv_xor.c  | 13 +++
 drivers/dma/mv_xor.h  |  5 +--
 drivers/dma/mv_xor_v2.c   | 23 ++--
 drivers/dma/mxs-dma.c | 13 +++
 drivers/dma/nbpfaxi.c | 15 
 drivers/dma/owl-dma.c |  2 +-
 drivers/dma/pch_dma.c | 17 -
 drivers/dma/pl330.c   | 31 
 drivers/dma/plx_dma.c | 13 +++
 drivers/dma/ppc4xx/adma.c | 17 -
 drivers/dma/ppc4xx/adma.h |  5 +--
 drivers/dma/pxa_dma.c |  2 +-
 drivers/dma/qcom/bam_dma.c| 35 ++-
 drivers/dma/qcom/gpi.c| 18 +-
 drivers/dma/qcom/hidma.c  | 11 +++---
 drivers/dma/qcom/hidma.h  |  5 +--
 drivers/dma/qcom/hidma_ll.c   | 11 +++---
 drivers/dma/qcom/qcom_adm.c   |  2 +-
 drivers/dma/sa11x0-dma.c  | 27 +++---
 drivers/dma/sf-pdma/sf-pdma.c | 23 ++--
 drivers/dma/sf-pdma/sf-pdma.h |  5 +--
 drivers/dma/sprd-dma.c|  2 +-
 drivers/dma/st_fdma.c |  2 +-
 drivers/dma/ste_dma40.c   | 17 -
 drivers/dma/sun6i-dma.c   | 33 -
 drivers/dma/tegra186-gpc-dma.c|  2 +-
 drivers/dma/tegra20-apb-dma.c | 19 +-
 drivers/dma/tegra210-adma.c   |  2 +-
 drivers/dma/ti/edma.c |  2 +-
 drivers/dma/ti/k3-udma.c  | 11 +++---
 drivers/dma/ti/omap-dma.c |  2 +-
 drivers/dma/timb_dma.c| 23 ++--
 drivers/dma/txx9dmac.c| 29 +++
 drivers/dma/txx9dmac.h|  5 +--
 drivers/dma/virt-dma.c|  9 ++---
 drivers/dma/virt-dma.h|  9 ++---
 drivers/dma/xgene-dma.c   | 21 +--
 drivers/dma/xilinx/xilinx_dma.c   | 23 ++--
 drivers/dma/xilinx/xilinx_dpdma.c | 21 +--
 drivers/dma/xilinx/zynqmp_dma.c   | 21 +--
 74 files changed, 442 insertions(+), 395 deletions(-)

diff --git 

Re: [Openipmi-developer] [PATCH 4/9] USB: Convert from tasklet to BH workqueue

2024-03-27 Thread Duncan Sands
Hi Allen, the usbatm bits look very reasonable to me.  Unfortunately I don't 
have the hardware to test any more.  Still, for what it's worth:


Signed-off-by: Duncan Sands 


___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


[Openipmi-developer] [PATCH 8/9] drivers/media/*: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/media/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/media/pci/bt8xx/bt878.c   |  8 ++--
 drivers/media/pci/bt8xx/bt878.h   |  3 +-
 drivers/media/pci/bt8xx/dvb-bt8xx.c   |  9 ++--
 drivers/media/pci/ddbridge/ddbridge.h |  3 +-
 drivers/media/pci/mantis/hopper_cards.c   |  2 +-
 drivers/media/pci/mantis/mantis_cards.c   |  2 +-
 drivers/media/pci/mantis/mantis_common.h  |  3 +-
 drivers/media/pci/mantis/mantis_dma.c |  5 ++-
 drivers/media/pci/mantis/mantis_dma.h |  2 +-
 drivers/media/pci/mantis/mantis_dvb.c | 12 +++---
 drivers/media/pci/ngene/ngene-core.c  | 23 ++-
 drivers/media/pci/ngene/ngene.h   |  5 ++-
 drivers/media/pci/smipcie/smipcie-main.c  | 18 
 drivers/media/pci/smipcie/smipcie.h   |  3 +-
 drivers/media/pci/ttpci/budget-av.c   |  3 +-
 drivers/media/pci/ttpci/budget-ci.c   | 27 ++--
 drivers/media/pci/ttpci/budget-core.c | 10 ++---
 drivers/media/pci/ttpci/budget.h  |  5 ++-
 drivers/media/pci/tw5864/tw5864-core.c|  2 +-
 drivers/media/pci/tw5864/tw5864-video.c   | 13 +++---
 drivers/media/pci/tw5864/tw5864.h |  7 ++--
 drivers/media/platform/intel/pxa_camera.c | 15 +++
 drivers/media/platform/marvell/mcam-core.c| 11 ++---
 drivers/media/platform/marvell/mcam-core.h|  3 +-
 .../st/sti/c8sectpfe/c8sectpfe-core.c | 15 +++
 .../st/sti/c8sectpfe/c8sectpfe-core.h |  2 +-
 drivers/media/radio/wl128x/fmdrv.h|  7 ++--
 drivers/media/radio/wl128x/fmdrv_common.c | 41 ++-
 drivers/media/rc/mceusb.c |  2 +-
 drivers/media/usb/ttusb-dec/ttusb_dec.c   | 21 +-
 30 files changed, 151 insertions(+), 131 deletions(-)

diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index 90972d6952f1..983ec29108f0 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -300,8 +300,8 @@ static irqreturn_t bt878_irq(int irq, void *dev_id)
}
if (astat & BT878_ARISCI) {
bt->finished_block = (stat & BT878_ARISCS) >> 28;
-   if (bt->tasklet.callback)
-   tasklet_schedule(>tasklet);
+   if (bt->work.func)
+   queue_work(system_bh_wq,
break;
}
count++;
@@ -478,8 +478,8 @@ static int bt878_probe(struct pci_dev *dev, const struct 
pci_device_id *pci_id)
btwrite(0, BT878_AINT_MASK);
bt878_num++;
 
-   if (!bt->tasklet.func)
-   tasklet_disable(>tasklet);
+   if (!bt->work.func)
+   disable_work_sync(>work);
 
return 0;
 
diff --git a/drivers/media/pci/bt8xx/bt878.h b/drivers/media/pci/bt8xx/bt878.h
index fde8db293c54..b9ce78e5116b 100644
--- a/drivers/media/pci/bt8xx/bt878.h
+++ b/drivers/media/pci/bt8xx/bt878.h
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "bt848.h"
 #include "bttv.h"
@@ -120,7 +121,7 @@ struct bt878 {
dma_addr_t risc_dma;
u32 risc_pos;
 
-   struct tasklet_struct tasklet;
+   struct work_struct work;
int shutdown;
 };
 
diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c 
b/drivers/media/pci/bt8xx/dvb-bt8xx.c
index 390cbba6c065..8c0e1fa764a4 100644
--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -39,9 +40,9 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 #define IF_FREQUENCYx6 217/* 6 * 36.167MHz */
 
-static void dvb_bt8xx_task(struct tasklet_struct *t)
+static void dvb_bt8xx_task(struct work_struct *t)
 {
-   struct bt878 *bt = from_tasklet(bt, t, tasklet);
+   struct bt878 *bt = from_work(bt, t, work);
struct dvb_bt8xx_card *card = dev_get_drvdata(>adapter->dev);
 
dprintk("%d\n", card->bt->finished_block);
@@ -782,7 +783,7 @@ static int dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, 
u32 type)
goto err_disconnect_frontend;
}
 
-   tasklet_setup(>bt->tasklet, dvb_bt8xx_task);
+   INIT_WORK(>bt->work, dvb_bt8xx_task);
 
frontend_init(card, type);
 
@@ -922,7 +923,7 @@ static void dvb_bt8xx_remove(struct bttv_sub_device *sub)
dprintk("dvb_bt8xx: unloading 

[Openipmi-developer] [PATCH 9/9] mmc: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/mmc/host/atmel-mci.c  | 35 -
 drivers/mmc/host/au1xmmc.c| 37 -
 drivers/mmc/host/cb710-mmc.c  | 15 ++--
 drivers/mmc/host/cb710-mmc.h  |  3 +-
 drivers/mmc/host/dw_mmc.c | 25 ---
 drivers/mmc/host/dw_mmc.h |  9 ++-
 drivers/mmc/host/omap.c   | 17 +++--
 drivers/mmc/host/renesas_sdhi.h   |  3 +-
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 24 +++---
 drivers/mmc/host/renesas_sdhi_sys_dmac.c  |  9 +--
 drivers/mmc/host/sdhci-bcm-kona.c |  2 +-
 drivers/mmc/host/tifm_sd.c| 15 ++--
 drivers/mmc/host/tmio_mmc.h   |  3 +-
 drivers/mmc/host/tmio_mmc_core.c  |  4 +-
 drivers/mmc/host/uniphier-sd.c| 13 ++--
 drivers/mmc/host/via-sdmmc.c  | 25 ---
 drivers/mmc/host/wbsd.c   | 75 ++-
 drivers/mmc/host/wbsd.h   | 10 +--
 18 files changed, 167 insertions(+), 157 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index dba826db739a..0a92a7fd020f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -284,12 +285,12 @@ struct atmel_mci_dma {
  * EVENT_DATA_ERROR is pending.
  * @stop_cmdr: Value to be loaded into CMDR when the stop command is
  * to be sent.
- * @tasklet: Tasklet running the request state machine.
+ * @work: Work running the request state machine.
  * @pending_events: Bitmask of events flagged by the interrupt handler
- * to be processed by the tasklet.
+ * to be processed by the work.
  * @completed_events: Bitmask of events which the state machine has
  * processed.
- * @state: Tasklet state.
+ * @state: Work state.
  * @queue: List of slots waiting for access to the controller.
  * @need_clock_update: Update the clock rate before the next request.
  * @need_reset: Reset controller before next request.
@@ -363,7 +364,7 @@ struct atmel_mci {
u32 data_status;
u32 stop_cmdr;
 
-   struct tasklet_struct   tasklet;
+   struct work_struct  work;
unsigned long   pending_events;
unsigned long   completed_events;
enum atmel_mci_statestate;
@@ -761,7 +762,7 @@ static void atmci_timeout_timer(struct timer_list *t)
host->need_reset = 1;
host->state = STATE_END_REQUEST;
smp_wmb();
-   tasklet_schedule(>tasklet);
+   queue_work(system_bh_wq, >work);
 }
 
 static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host,
@@ -983,7 +984,7 @@ static void atmci_pdc_complete(struct atmel_mci *host)
 
dev_dbg(>pdev->dev, "(%s) set pending xfer complete\n", __func__);
atmci_set_pending(host, EVENT_XFER_COMPLETE);
-   tasklet_schedule(>tasklet);
+   queue_work(system_bh_wq, >work);
 }
 
 static void atmci_dma_cleanup(struct atmel_mci *host)
@@ -997,7 +998,7 @@ static void atmci_dma_cleanup(struct atmel_mci *host)
 }
 
 /*
- * This function is called by the DMA driver from tasklet context.
+ * This function is called by the DMA driver from work context.
  */
 static void atmci_dma_complete(void *arg)
 {
@@ -1020,7 +1021,7 @@ static void atmci_dma_complete(void *arg)
dev_dbg(>pdev->dev,
"(%s) set pending xfer complete\n", __func__);
atmci_set_pending(host, EVENT_XFER_COMPLETE);
-   tasklet_schedule(>tasklet);
+   queue_work(system_bh_wq, >work);
 
/*
 * Regardless of what the documentation says, we have
@@ -1033,7 +1034,7 @@ static void atmci_dma_complete(void *arg)
 * haven't seen all the potential error bits yet.
 *
 * The interrupt handler will schedule a different
-* tasklet to finish things up when the data transfer
+* work to finish things up when the data transfer
 * is completely done.
 *
 * We may not complete the mmc request here anyway
@@ -1765,9 +1766,9 @@ static void atmci_detect_change(struct timer_list *t)
}
 }
 
-static void atmci_tasklet_func(struct tasklet_struct *t)
+static 

[Openipmi-developer] [PATCH 6/9] ipmi: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/char/ipmi/ipmi_msghandler.c | 30 ++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index b0eedc4595b3..fce2a2dbdc82 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -36,12 +36,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #define IPMI_DRIVER_VERSION "39.2"
 
 static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
 static int ipmi_init_msghandler(void);
-static void smi_recv_tasklet(struct tasklet_struct *t);
+static void smi_recv_work(struct work_struct *t);
 static void handle_new_recv_msgs(struct ipmi_smi *intf);
 static void need_waiter(struct ipmi_smi *intf);
 static int handle_one_recv_msg(struct ipmi_smi *intf,
@@ -498,13 +499,13 @@ struct ipmi_smi {
/*
 * Messages queued for delivery.  If delivery fails (out of memory
 * for instance), They will stay in here to be processed later in a
-* periodic timer interrupt.  The tasklet is for handling received
+* periodic timer interrupt.  The work is for handling received
 * messages directly from the handler.
 */
spinlock_t   waiting_rcv_msgs_lock;
struct list_head waiting_rcv_msgs;
atomic_t watchdog_pretimeouts_to_deliver;
-   struct tasklet_struct recv_tasklet;
+   struct work_struct recv_work;
 
spinlock_t xmit_msgs_lock;
struct list_head   xmit_msgs;
@@ -704,7 +705,7 @@ static void clean_up_interface_data(struct ipmi_smi *intf)
struct cmd_rcvr  *rcvr, *rcvr2;
struct list_head list;
 
-   tasklet_kill(>recv_tasklet);
+   cancel_work_sync(>recv_work);
 
free_smi_msg_list(>waiting_rcv_msgs);
free_recv_msg_list(>waiting_events);
@@ -1319,7 +1320,7 @@ static void free_user(struct kref *ref)
 {
struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
 
-   /* SRCU cleanup must happen in task context. */
+   /* SRCU cleanup must happen in work context. */
queue_work(remove_work_wq, >remove_work);
 }
 
@@ -3605,8 +3606,7 @@ int ipmi_add_smi(struct module *owner,
intf->curr_seq = 0;
spin_lock_init(>waiting_rcv_msgs_lock);
INIT_LIST_HEAD(>waiting_rcv_msgs);
-   tasklet_setup(>recv_tasklet,
-smi_recv_tasklet);
+   INIT_WORK(>recv_work, smi_recv_work);
atomic_set(>watchdog_pretimeouts_to_deliver, 0);
spin_lock_init(>xmit_msgs_lock);
INIT_LIST_HEAD(>xmit_msgs);
@@ -4779,7 +4779,7 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf)
 * To preserve message order, quit if we
 * can't handle a message.  Add the message
 * back at the head, this is safe because this
-* tasklet is the only thing that pulls the
+* work is the only thing that pulls the
 * messages.
 */
list_add(_msg->link, >waiting_rcv_msgs);
@@ -4812,10 +4812,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf)
}
 }
 
-static void smi_recv_tasklet(struct tasklet_struct *t)
+static void smi_recv_work(struct work_struct *t)
 {
unsigned long flags = 0; /* keep us warning-free. */
-   struct ipmi_smi *intf = from_tasklet(intf, t, recv_tasklet);
+   struct ipmi_smi *intf = from_work(intf, t, recv_work);
int run_to_completion = intf->run_to_completion;
struct ipmi_smi_msg *newmsg = NULL;
 
@@ -4866,7 +4866,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,
 
/*
 * To preserve message order, we keep a queue and deliver from
-* a tasklet.
+* a work.
 */
if (!run_to_completion)
spin_lock_irqsave(>waiting_rcv_msgs_lock, flags);
@@ -4887,9 +4887,9 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,
spin_unlock_irqrestore(>xmit_msgs_lock, flags);
 
if (run_to_completion)
-   smi_recv_tasklet(>recv_tasklet);
+   smi_recv_work(>recv_work);
else
-   tasklet_schedule(>recv_tasklet);
+   queue_work(system_bh_wq, >recv_work);
 }
 EXPORT_SYMBOL(ipmi_smi_msg_received);
 
@@ -4899,7 +4899,7 @@ void ipmi_smi_watchdog_pretimeout(struct 

[Openipmi-developer] [PATCH 3/9] IB: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h|  3 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c   | 21 ++--
 drivers/infiniband/hw/bnxt_re/qplib_fp.h   |  2 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 25 ---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.h |  2 +-
 drivers/infiniband/hw/erdma/erdma.h|  3 +-
 drivers/infiniband/hw/erdma/erdma_eq.c | 11 ---
 drivers/infiniband/hw/hfi1/rc.c|  2 +-
 drivers/infiniband/hw/hfi1/sdma.c  | 37 +++---
 drivers/infiniband/hw/hfi1/sdma.h  |  9 +++---
 drivers/infiniband/hw/hfi1/tid_rdma.c  |  6 ++--
 drivers/infiniband/hw/irdma/ctrl.c |  2 +-
 drivers/infiniband/hw/irdma/hw.c   | 24 +++---
 drivers/infiniband/hw/irdma/main.h |  5 +--
 drivers/infiniband/hw/qib/qib.h|  7 ++--
 drivers/infiniband/hw/qib/qib_iba7322.c|  9 +++---
 drivers/infiniband/hw/qib/qib_rc.c | 16 +-
 drivers/infiniband/hw/qib/qib_ruc.c|  4 +--
 drivers/infiniband/hw/qib/qib_sdma.c   | 11 ---
 drivers/infiniband/sw/rdmavt/qp.c  |  2 +-
 20 files changed, 106 insertions(+), 95 deletions(-)

diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h 
b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
index 9dca451ed522..f511c8415806 100644
--- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h
+++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
@@ -42,6 +42,7 @@
 #include 
 #include "hw_counters.h"
 #include 
+#include 
 #define ROCE_DRV_MODULE_NAME   "bnxt_re"
 
 #define BNXT_RE_DESC   "Broadcom NetXtreme-C/E RoCE Driver"
@@ -162,7 +163,7 @@ struct bnxt_re_dev {
u8  cur_prio_map;
 
/* FP Notification Queue (CQ & SRQ) */
-   struct tasklet_struct   nq_task;
+   struct work_struct  nq_work;
 
/* RCFW Channel */
struct bnxt_qplib_rcfw  rcfw;
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c 
b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 439d0c7c5d0c..052906982cdf 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "roce_hsi.h"
@@ -294,9 +295,9 @@ static void __wait_for_all_nqes(struct bnxt_qplib_cq *cq, 
u16 cnq_events)
}
 }
 
-static void bnxt_qplib_service_nq(struct tasklet_struct *t)
+static void bnxt_qplib_service_nq(struct work_struct *t)
 {
-   struct bnxt_qplib_nq *nq = from_tasklet(nq, t, nq_tasklet);
+   struct bnxt_qplib_nq *nq = from_work(nq, t, nq_work);
struct bnxt_qplib_hwq *hwq = >hwq;
struct bnxt_qplib_cq *cq;
int budget = nq->budget;
@@ -394,7 +395,7 @@ void bnxt_re_synchronize_nq(struct bnxt_qplib_nq *nq)
int budget = nq->budget;
 
nq->budget = nq->hwq.max_elements;
-   bnxt_qplib_service_nq(>nq_tasklet);
+   bnxt_qplib_service_nq(>nq_work);
nq->budget = budget;
 }
 
@@ -409,7 +410,7 @@ static irqreturn_t bnxt_qplib_nq_irq(int irq, void 
*dev_instance)
prefetch(bnxt_qplib_get_qe(hwq, sw_cons, NULL));
 
/* Fan out to CPU affinitized kthreads? */
-   tasklet_schedule(>nq_tasklet);
+   queue_work(system_bh_wq, >nq_work);
 
return IRQ_HANDLED;
 }
@@ -430,8 +431,8 @@ void bnxt_qplib_nq_stop_irq(struct bnxt_qplib_nq *nq, bool 
kill)
nq->name = NULL;
 
if (kill)
-   tasklet_kill(>nq_tasklet);
-   tasklet_disable(>nq_tasklet);
+   cancel_work_sync(>nq_work);
+   disable_work_sync(>nq_work);
 }
 
 void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq)
@@ -465,9 +466,9 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int 
nq_indx,
 
nq->msix_vec = msix_vector;
if (need_init)
-   tasklet_setup(>nq_tasklet, bnxt_qplib_service_nq);
+   INIT_WORK(>nq_work, bnxt_qplib_service_nq);
else
-   tasklet_enable(>nq_tasklet);
+   enable_and_queue_work(system_bh_wq, >nq_work);
 
nq->name = kasprintf(GFP_KERNEL, "bnxt_re-nq-%d@pci:%s",
 nq_indx, pci_name(res->pdev));
@@ -477,7 +478,7 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int 
nq_indx,
if (rc) {
kfree(nq->name);
nq->name = NULL;
-   tasklet_disable(>nq_tasklet);
+   disable_work_sync(>nq_work);
   

[Openipmi-developer] [PATCH 1/9] hyperv: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/hv/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/hv/channel.c  |  8 
 drivers/hv/channel_mgmt.c |  5 ++---
 drivers/hv/connection.c   |  9 +
 drivers/hv/hv.c   |  3 +--
 drivers/hv/hv_balloon.c   |  4 ++--
 drivers/hv/hv_fcopy.c |  8 
 drivers/hv/hv_kvp.c   |  8 
 drivers/hv/hv_snapshot.c  |  8 
 drivers/hv/hyperv_vmbus.h |  9 +
 drivers/hv/vmbus_drv.c| 19 ++-
 include/linux/hyperv.h|  2 +-
 11 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index adbf674355b2..876d78eb4dce 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -859,7 +859,7 @@ void vmbus_reset_channel_cb(struct vmbus_channel *channel)
unsigned long flags;
 
/*
-* vmbus_on_event(), running in the per-channel tasklet, can race
+* vmbus_on_event(), running in the per-channel work, can race
 * with vmbus_close_internal() in the case of SMP guest, e.g., when
 * the former is accessing channel->inbound.ring_buffer, the latter
 * could be freeing the ring_buffer pages, so here we must stop it
@@ -871,7 +871,7 @@ void vmbus_reset_channel_cb(struct vmbus_channel *channel)
 * and that the channel ring buffer is no longer being accessed, cf.
 * the calls to napi_disable() in netvsc_device_remove().
 */
-   tasklet_disable(>callback_event);
+   disable_work_sync(>callback_event);
 
/* See the inline comments in vmbus_chan_sched(). */
spin_lock_irqsave(>sched_lock, flags);
@@ -880,8 +880,8 @@ void vmbus_reset_channel_cb(struct vmbus_channel *channel)
 
channel->sc_creation_callback = NULL;
 
-   /* Re-enable tasklet for use on re-open */
-   tasklet_enable(>callback_event);
+   /* Re-enable work for use on re-open */
+   enable_and_queue_work(system_bh_wq, >callback_event);
 }
 
 static int vmbus_close_internal(struct vmbus_channel *channel)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 2f4d09ce027a..58397071a0de 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -353,8 +353,7 @@ static struct vmbus_channel *alloc_channel(void)
 
INIT_LIST_HEAD(>sc_list);
 
-   tasklet_init(>callback_event,
-vmbus_on_event, (unsigned long)channel);
+   INIT_WORK(>callback_event, vmbus_on_event);
 
hv_ringbuffer_pre_init(channel);
 
@@ -366,7 +365,7 @@ static struct vmbus_channel *alloc_channel(void)
  */
 static void free_channel(struct vmbus_channel *channel)
 {
-   tasklet_kill(>callback_event);
+   cancel_work_sync(>callback_event);
vmbus_remove_channel_attr_group(channel);
 
kobject_put(>kobj);
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 3cabeeabb1ca..f2a3394a8303 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -372,12 +372,13 @@ struct vmbus_channel *relid2channel(u32 relid)
  * 3. Once we return, enable signaling from the host. Once this
  *state is set we check to see if additional packets are
  *available to read. In this case we repeat the process.
- *If this tasklet has been running for a long time
+ *If this work has been running for a long time
  *then reschedule ourselves.
  */
-void vmbus_on_event(unsigned long data)
+void vmbus_on_event(struct work_struct *t)
 {
-   struct vmbus_channel *channel = (void *) data;
+   struct vmbus_channel *channel = from_work(channel, t,
+   callback_event);
void (*callback_fn)(void *context);
 
trace_vmbus_on_event(channel);
@@ -401,7 +402,7 @@ void vmbus_on_event(unsigned long data)
return;
 
hv_begin_read(>inbound);
-   tasklet_schedule(>callback_event);
+   queue_work(system_bh_wq, >callback_event);
 }
 
 /*
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index a8ad728354cb..2af92f08f9ce 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -119,8 +119,7 @@ int hv_synic_alloc(void)
for_each_present_cpu(cpu) {
hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
 
-   tasklet_init(_cpu->msg_dpc,
-vmbus_on_msg_dpc, (unsigned long) hv_cpu);
+   INIT_WORK(_cpu->msg_dpc, vmbus_on_msg_dpc);
 
if (ms_hyperv.paravisor_present && hv_isolation_type_tdx()) {

[Openipmi-developer] [PATCH 0/9] Convert Tasklets to BH Workqueues

2024-03-27 Thread Allen Pais
This patch series represents a significant shift in how asynchronous
execution in the bottom half (BH) context is handled within the kernel.
Traditionally, tasklets have been the go-to mechanism for such operations.
This series introduces the conversion of existing tasklet implementations
to the newly supported BH workqueues, marking a pivotal enhancement
in how asynchronous tasks are managed and executed.

Background and Motivation:
Tasklets have served as the kernel's lightweight mechanism for
scheduling bottom-half processing, providing a simple interface
for deferring work from interrupt context. There have been increasing
requests and motivations to deprecate and eventually remove tasklets
in favor of more modern and flexible mechanisms.

Introduction of BH Workqueues:
BH workqueues are designed to behave similarly to regular workqueues
with the added benefit of execution in the BH context.

Conversion Details:
The conversion process involved identifying all instances where
tasklets were used within the kernel and replacing them with BH workqueue
implementations.

This patch series is a first step toward broader adoption of BH workqueues
across the kernel, and soon other subsystems using tasklets will undergo
a similar transition. The groundwork laid here could serve as a
blueprint for such future conversions.

Testing Request:
In addition to a thorough review of these changes,
I kindly request that the reviwers engage in both functional and
performance testing of this patch series. Specifically, benchmarks
that measure interrupt handling efficiency, latency, and throughput.

I welcome your feedback, suggestions, and any further discussion on this
patch series.


Additional Info:
Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Allen Pais (9):
  hyperv: Convert from tasklet to BH workqueue
  dma: Convert from tasklet to BH workqueue
  IB: Convert from tasklet to BH workqueue
  USB: Convert from tasklet to BH workqueue
  mailbox: Convert from tasklet to BH workqueue
  ipmi: Convert from tasklet to BH workqueue
  s390: Convert from tasklet to BH workqueue
  drivers/media/*: Convert from tasklet to BH workqueue
  mmc: Convert from tasklet to BH workqueue

 drivers/char/ipmi/ipmi_msghandler.c   | 30 
 drivers/dma/altera-msgdma.c   | 15 ++--
 drivers/dma/apple-admac.c | 15 ++--
 drivers/dma/at_hdmac.c|  2 +-
 drivers/dma/at_xdmac.c| 15 ++--
 drivers/dma/bcm2835-dma.c |  2 +-
 drivers/dma/dma-axi-dmac.c|  2 +-
 drivers/dma/dma-jz4780.c  |  2 +-
 .../dma/dw-axi-dmac/dw-axi-dmac-platform.c|  2 +-
 drivers/dma/dw-edma/dw-edma-core.c|  2 +-
 drivers/dma/dw/core.c | 13 ++--
 drivers/dma/dw/regs.h |  3 +-
 drivers/dma/ep93xx_dma.c  | 15 ++--
 drivers/dma/fsl-edma-common.c |  2 +-
 drivers/dma/fsl-qdma.c|  2 +-
 drivers/dma/fsl_raid.c| 11 +--
 drivers/dma/fsl_raid.h|  2 +-
 drivers/dma/fsldma.c  | 15 ++--
 drivers/dma/fsldma.h  |  3 +-
 drivers/dma/hisi_dma.c|  2 +-
 drivers/dma/hsu/hsu.c |  2 +-
 drivers/dma/idma64.c  |  4 +-
 drivers/dma/img-mdc-dma.c |  2 +-
 drivers/dma/imx-dma.c | 27 +++
 drivers/dma/imx-sdma.c|  6 +-
 drivers/dma/ioat/dma.c| 17 +++--
 drivers/dma/ioat/dma.h|  5 +-
 drivers/dma/ioat/init.c   |  2 +-
 drivers/dma/k3dma.c   | 19 ++---
 drivers/dma/mediatek/mtk-cqdma.c  | 35 -
 drivers/dma/mediatek/mtk-hsdma.c  |  2 +-
 drivers/dma/mediatek/mtk-uart-apdma.c |  4 +-
 drivers/dma/mmp_pdma.c| 13 ++--
 drivers/dma/mmp_tdma.c| 11 +--
 drivers/dma/mpc512x_dma.c | 17 +++--
 drivers/dma/mv_xor.c  | 13 ++--
 drivers/dma/mv_xor.h  |  5 +-
 drivers/dma/mv_xor_v2.c   | 23 +++---
 drivers/dma/mxs-dma.c | 13 ++--
 drivers/dma/nbpfaxi.c | 15 ++--
 drivers/dma/owl-dma.c |  2 +-
 drivers/dma/pch_dma.c | 17 +++--
 drivers/dma/pl330.c   | 31 
 drivers/dma/plx_dma.c | 13 ++--
 drivers/dma/ppc4xx/adma.c | 17 +++--
 drivers/dma/ppc4xx/adma.h |  5 +-
 drivers/dma/pxa_dma.c |  2 +-
 drivers/dma/qcom/bam_dma.c| 35 -
 

[Openipmi-developer] [PATCH 4/9] USB: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts drivers/infiniband/* from tasklet to BH workqueue.

Based on the work done by Tejun Heo 
Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10

Signed-off-by: Allen Pais 
---
 drivers/usb/atm/usbatm.c| 55 +++--
 drivers/usb/atm/usbatm.h|  3 +-
 drivers/usb/core/hcd.c  | 22 ++--
 drivers/usb/gadget/udc/fsl_qe_udc.c | 21 +--
 drivers/usb/gadget/udc/fsl_qe_udc.h |  4 +--
 drivers/usb/host/ehci-sched.c   |  2 +-
 drivers/usb/host/fhci-hcd.c |  3 +-
 drivers/usb/host/fhci-sched.c   | 10 +++---
 drivers/usb/host/fhci.h |  5 +--
 drivers/usb/host/xhci-dbgcap.h  |  3 +-
 drivers/usb/host/xhci-dbgtty.c  | 15 
 include/linux/usb/cdc_ncm.h |  2 +-
 include/linux/usb/usbnet.h  |  2 +-
 13 files changed, 76 insertions(+), 71 deletions(-)

diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 2da6615fbb6f..74849f24e52e 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -17,7 +17,7 @@
  * - Removed the limit on the number of devices
  * - Module now autoloads on device plugin
  * - Merged relevant parts of sarlib
- * - Replaced the kernel thread with a tasklet
+ * - Replaced the kernel thread with a work
  * - New packet transmission code
  * - Changed proc file contents
  * - Fixed all known SMP races
@@ -68,6 +68,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef VERBOSE_DEBUG
 static int usbatm_print_packet(struct usbatm_data *instance, const unsigned 
char *data, int len);
@@ -249,7 +250,7 @@ static void usbatm_complete(struct urb *urb)
/* vdbg("%s: urb 0x%p, status %d, actual_length %d",
 __func__, urb, status, urb->actual_length); */
 
-   /* Can be invoked from task context, protect against interrupts */
+   /* Can be invoked from work context, protect against interrupts */
spin_lock_irqsave(>lock, flags);
 
/* must add to the back when receiving; doesn't matter when sending */
@@ -269,7 +270,7 @@ static void usbatm_complete(struct urb *urb)
/* throttle processing in case of an error */
mod_timer(>delay, jiffies + 
msecs_to_jiffies(THROTTLE_MSECS));
} else
-   tasklet_schedule(>tasklet);
+   queue_work(system_bh_wq, >work);
 }
 
 
@@ -511,10 +512,10 @@ static unsigned int usbatm_write_cells(struct usbatm_data 
*instance,
 **  receive  **
 **/
 
-static void usbatm_rx_process(struct tasklet_struct *t)
+static void usbatm_rx_process(struct work_struct *t)
 {
-   struct usbatm_data *instance = from_tasklet(instance, t,
-   rx_channel.tasklet);
+   struct usbatm_data *instance = from_work(instance, t,
+   rx_channel.work);
struct urb *urb;
 
while ((urb = usbatm_pop_urb(>rx_channel))) {
@@ -565,10 +566,10 @@ static void usbatm_rx_process(struct tasklet_struct *t)
 **  send  **
 ***/
 
-static void usbatm_tx_process(struct tasklet_struct *t)
+static void usbatm_tx_process(struct work_struct *t)
 {
-   struct usbatm_data *instance = from_tasklet(instance, t,
-   tx_channel.tasklet);
+   struct usbatm_data *instance = from_work(instance, t,
+   tx_channel.work);
struct sk_buff *skb = instance->current_skb;
struct urb *urb = NULL;
const unsigned int buf_size = instance->tx_channel.buf_size;
@@ -632,13 +633,13 @@ static void usbatm_cancel_send(struct usbatm_data 
*instance,
}
spin_unlock_irq(>sndqueue.lock);
 
-   tasklet_disable(>tx_channel.tasklet);
+   disable_work_sync(>tx_channel.work);
if ((skb = instance->current_skb) && (UDSL_SKB(skb)->atm.vcc == vcc)) {
atm_dbg(instance, "%s: popping current skb (0x%p)\n", __func__, 
skb);
instance->current_skb = NULL;
usbatm_pop(vcc, skb);
}
-   tasklet_enable(>tx_channel.tasklet);
+   enable_and_queue_work(system_bh_wq, >tx_channel.work);
 }
 
 static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
@@ -677,7 +678,7 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct 
sk_buff *skb)
ctrl->crc = crc32_be(~0, skb->data, skb->len);
 
skb_queue_tail(>sndqueue, skb);
-   tasklet_schedule(>tx_channel.tasklet);
+   queue_work(system_bh_wq, 

Re: [Openipmi-developer] [PATCH 4/9] USB: Convert from tasklet to BH workqueue

2024-03-27 Thread Allen
> > The only generic interface to execute asynchronously in the BH context is
> > tasklet; however, it's marked deprecated and has some design flaws. To
> > replace tasklets, BH workqueue support was recently added. A BH workqueue
> > behaves similarly to regular workqueues except that the queued work items
> > are executed in the BH context.
> >
> > This patch converts drivers/infiniband/* from tasklet to BH workqueue.
>
> No it does not, I think your changelog is wrong :(

Whoops, sorry about that. I messed up the commit messages. I will fix it in v2.
>
> >
> > Based on the work done by Tejun Heo 
> > Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> >
> > Signed-off-by: Allen Pais 
> > ---
> >  drivers/usb/atm/usbatm.c| 55 +++--
> >  drivers/usb/atm/usbatm.h|  3 +-
> >  drivers/usb/core/hcd.c  | 22 ++--
> >  drivers/usb/gadget/udc/fsl_qe_udc.c | 21 +--
> >  drivers/usb/gadget/udc/fsl_qe_udc.h |  4 +--
> >  drivers/usb/host/ehci-sched.c   |  2 +-
> >  drivers/usb/host/fhci-hcd.c |  3 +-
> >  drivers/usb/host/fhci-sched.c   | 10 +++---
> >  drivers/usb/host/fhci.h |  5 +--
> >  drivers/usb/host/xhci-dbgcap.h  |  3 +-
> >  drivers/usb/host/xhci-dbgtty.c  | 15 
> >  include/linux/usb/cdc_ncm.h |  2 +-
> >  include/linux/usb/usbnet.h  |  2 +-
> >  13 files changed, 76 insertions(+), 71 deletions(-)
> >
> > diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
> > index 2da6615fbb6f..74849f24e52e 100644
> > --- a/drivers/usb/atm/usbatm.c
> > +++ b/drivers/usb/atm/usbatm.c
> > @@ -17,7 +17,7 @@
> >   *   - Removed the limit on the number of devices
> >   *   - Module now autoloads on device plugin
> >   *   - Merged relevant parts of sarlib
> > - *   - Replaced the kernel thread with a tasklet
> > + *   - Replaced the kernel thread with a work
>
> a "work"?
 will fix the comments.

>
> >   *   - New packet transmission code
> >   *   - Changed proc file contents
> >   *   - Fixed all known SMP races
> > @@ -68,6 +68,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
> >  #ifdef VERBOSE_DEBUG
> >  static int usbatm_print_packet(struct usbatm_data *instance, const 
> > unsigned char *data, int len);
> > @@ -249,7 +250,7 @@ static void usbatm_complete(struct urb *urb)
> >   /* vdbg("%s: urb 0x%p, status %d, actual_length %d",
> >__func__, urb, status, urb->actual_length); */
> >
> > - /* Can be invoked from task context, protect against interrupts */
> > + /* Can be invoked from work context, protect against interrupts */
>
> "workqueue"?  This too seems wrong.
>
> Same for other comment changes in this patch.

Thanks for the quick review, I will fix the comments and send out v2.

- Alle

> thanks,
>
> greg k-h
>


___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH 4/9] USB: Convert from tasklet to BH workqueue

2024-03-27 Thread Greg KH
On Wed, Mar 27, 2024 at 04:03:09PM +, Allen Pais wrote:
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts drivers/infiniband/* from tasklet to BH workqueue.

No it does not, I think your changelog is wrong :(

> 
> Based on the work done by Tejun Heo 
> Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> 
> Signed-off-by: Allen Pais 
> ---
>  drivers/usb/atm/usbatm.c| 55 +++--
>  drivers/usb/atm/usbatm.h|  3 +-
>  drivers/usb/core/hcd.c  | 22 ++--
>  drivers/usb/gadget/udc/fsl_qe_udc.c | 21 +--
>  drivers/usb/gadget/udc/fsl_qe_udc.h |  4 +--
>  drivers/usb/host/ehci-sched.c   |  2 +-
>  drivers/usb/host/fhci-hcd.c |  3 +-
>  drivers/usb/host/fhci-sched.c   | 10 +++---
>  drivers/usb/host/fhci.h |  5 +--
>  drivers/usb/host/xhci-dbgcap.h  |  3 +-
>  drivers/usb/host/xhci-dbgtty.c  | 15 
>  include/linux/usb/cdc_ncm.h |  2 +-
>  include/linux/usb/usbnet.h  |  2 +-
>  13 files changed, 76 insertions(+), 71 deletions(-)
> 
> diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
> index 2da6615fbb6f..74849f24e52e 100644
> --- a/drivers/usb/atm/usbatm.c
> +++ b/drivers/usb/atm/usbatm.c
> @@ -17,7 +17,7 @@
>   *   - Removed the limit on the number of devices
>   *   - Module now autoloads on device plugin
>   *   - Merged relevant parts of sarlib
> - *   - Replaced the kernel thread with a tasklet
> + *   - Replaced the kernel thread with a work

a "work"?

>   *   - New packet transmission code
>   *   - Changed proc file contents
>   *   - Fixed all known SMP races
> @@ -68,6 +68,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #ifdef VERBOSE_DEBUG
>  static int usbatm_print_packet(struct usbatm_data *instance, const unsigned 
> char *data, int len);
> @@ -249,7 +250,7 @@ static void usbatm_complete(struct urb *urb)
>   /* vdbg("%s: urb 0x%p, status %d, actual_length %d",
>__func__, urb, status, urb->actual_length); */
>  
> - /* Can be invoked from task context, protect against interrupts */
> + /* Can be invoked from work context, protect against interrupts */

"workqueue"?  This too seems wrong.

Same for other comment changes in this patch.

thanks,

greg k-h


___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer