]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: Expand all create*_workqueue() invocations
authorBart Van Assche <bvanassche@acm.org>
Thu, 22 Aug 2024 19:59:05 +0000 (12:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 23 Aug 2024 01:28:55 +0000 (21:28 -0400)
The workqueue maintainer wants to remove the create*_workqueue() macros
because these macros always set the WQ_MEM_RECLAIM flag and because these
only support literal workqueue names. Hence this patch that replaces the
create*_workqueue() invocations with the definition of this macro. The
WQ_MEM_RECLAIM flag has been retained because I think that flag is necessary
for workqueues created by storage drivers. This patch has been generated by
running spatch and git clang-format. spatch has been invoked as follows:

spatch --in-place --sp-file expand-create-workqueue.spatch $(git grep -lEw 'create_(freezable_|singlethread_|)workqueue' */scsi */ufs)

The contents of the expand-create-workqueue.spatch file is as follows:

@@
expression name;
@@
-create_workqueue(name)
+alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, name)
@@
expression name;
@@
-create_freezable_workqueue(name)
+alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1, name)
@@
expression name;
@@
-create_singlethread_workqueue(name)
+alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name)

Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240822195944.654691-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
25 files changed:
drivers/scsi/bfa/bfad_im.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/device_handler/scsi_dh_rdac.c
drivers/scsi/elx/efct/efct_lio.c
drivers/scsi/esas2r/esas2r_init.c
drivers/scsi/fcoe/fcoe_sysfs.c
drivers/scsi/fnic/fnic_main.c
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/libfc/fc_exch.c
drivers/scsi/libfc/fc_rport.c
drivers/scsi/libsas/sas_init.c
drivers/scsi/megaraid/megaraid_sas_fusion.c
drivers/scsi/mpi3mr/mpi3mr_fw.c
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/myrb.c
drivers/scsi/myrs.c
drivers/scsi/qedf/qedf_main.c
drivers/scsi/qedi/qedi_main.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/snic/snic_main.c
drivers/scsi/stex.c
drivers/scsi/vmw_pvscsi.c
drivers/ufs/core/ufshcd.c

index a9d3d8562d3c174d5a70d228a0e41a937f3895a1..a1d015356063ae0184627959ba7356c312e42aad 100644 (file)
@@ -768,7 +768,8 @@ bfad_thread_workq(struct bfad_s *bfad)
        bfa_trc(bfad, 0);
        snprintf(im->drv_workq_name, KOBJ_NAME_LEN, "bfad_wq_%d",
                 bfad->inst_no);
-       im->drv_workq = create_singlethread_workqueue(im->drv_workq_name);
+       im->drv_workq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                               im->drv_workq_name);
        if (!im->drv_workq)
                return BFA_STATUS_FAILED;
 
index 1078c20c5ef670b446a4f02c0465119e4f6fdc21..f49783b89d04f428797bbd869cfc8d7a49a5328a 100644 (file)
@@ -2363,8 +2363,8 @@ static int _bnx2fc_create(struct net_device *netdev,
        interface->vlan_id = vlan_id;
        interface->tm_timeout = BNX2FC_TM_TIMEOUT;
 
-       interface->timer_work_queue =
-                       create_singlethread_workqueue("bnx2fc_timer_wq");
+       interface->timer_work_queue = alloc_ordered_workqueue(
+               "%s", WQ_MEM_RECLAIM, "bnx2fc_timer_wq");
        if (!interface->timer_work_queue) {
                printk(KERN_ERR PFX "ulp_init could not create timer_wq\n");
                rc = -EINVAL;
index f8a09e3eba582c8bf50ebab9d352db718d7b1ef8..6e1b252cea0e21f5d1229ea2eaf03e9cbf043c4c 100644 (file)
@@ -822,7 +822,8 @@ static int __init rdac_init(void)
        /*
         * Create workqueue to handle mode selects for rdac
         */
-       kmpath_rdacd = create_singlethread_workqueue("kmpath_rdacd");
+       kmpath_rdacd =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "kmpath_rdacd");
        if (!kmpath_rdacd) {
                scsi_unregister_device_handler(&rdac_dh);
                printk(KERN_ERR "kmpath_rdacd creation failed.\n");
index 6a6ec32c46bdf3a1d532e988a6c98e7fc13f6a6e..9ac69356b13e08629c1949a7ba237ec07dfa5db1 100644 (file)
@@ -1114,7 +1114,8 @@ int efct_scsi_tgt_new_device(struct efct *efct)
        atomic_set(&efct->tgt_efct.watermark_hit, 0);
        atomic_set(&efct->tgt_efct.initiator_count, 0);
 
-       lio_wq = create_singlethread_workqueue("efct_lio_worker");
+       lio_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                        "efct_lio_worker");
        if (!lio_wq) {
                efc_log_err(efct, "workqueue create failed\n");
                return -EIO;
index c1a5ab662dc8883fde5dee61d8b1fbcd482825ff..ff1fa3160c617f0c4310574ce864eacac324ce66 100644 (file)
@@ -313,7 +313,8 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
        esas2r_fw_event_off(a);
        snprintf(a->fw_event_q_name, ESAS2R_KOBJ_NAME_LEN, "esas2r/%d",
                 a->index);
-       a->fw_event_q = create_singlethread_workqueue(a->fw_event_q_name);
+       a->fw_event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                               a->fw_event_q_name);
 
        init_waitqueue_head(&a->buffered_ioctl_waiter);
        init_waitqueue_head(&a->nvram_waiter);
index 7d3b904af9e80f8f052be1900d8fce2918bb36a9..06357bbf6b2c0759650d1f0792e9b949d5e95e9b 100644 (file)
@@ -799,16 +799,16 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
 
        snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name),
                 "ctlr_wq_%d", ctlr->id);
-       ctlr->work_q = create_singlethread_workqueue(
-               ctlr->work_q_name);
+       ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                              ctlr->work_q_name);
        if (!ctlr->work_q)
                goto out_del;
 
        snprintf(ctlr->devloss_work_q_name,
                 sizeof(ctlr->devloss_work_q_name),
                 "ctlr_dl_wq_%d", ctlr->id);
-       ctlr->devloss_work_q = create_singlethread_workqueue(
-               ctlr->devloss_work_q_name);
+       ctlr->devloss_work_q = alloc_ordered_workqueue(
+               "%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name);
        if (!ctlr->devloss_work_q)
                goto out_del_q;
 
index 29eead383eb9a478bb71643eaac1a4e302418f0f..0044717d4486c68ec998d015aa6380b9010da19f 100644 (file)
@@ -1161,14 +1161,16 @@ static int __init fnic_init_module(void)
                goto err_create_fnic_ioreq_slab;
        }
 
-       fnic_event_queue = create_singlethread_workqueue("fnic_event_wq");
+       fnic_event_queue =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_event_wq");
        if (!fnic_event_queue) {
                printk(KERN_ERR PFX "fnic work queue create failed\n");
                err = -ENOMEM;
                goto err_create_fnic_workq;
        }
 
-       fnic_fip_queue = create_singlethread_workqueue("fnic_fip_q");
+       fnic_fip_queue =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_fip_q");
        if (!fnic_fip_queue) {
                printk(KERN_ERR PFX "fnic FIP work queue create failed\n");
                err = -ENOMEM;
index ec1a3e7ee94d30819695720ff057e021ab377f38..6219807ce3b9e1788d9a518e3637a585af8b3d55 100644 (file)
@@ -2302,7 +2302,8 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba)
 
        hisi_hba->last_slot_index = 0;
 
-       hisi_hba->wq = create_singlethread_workqueue(dev_name(dev));
+       hisi_hba->wq =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, dev_name(dev));
        if (!hisi_hba->wq) {
                dev_err(dev, "sas_alloc: failed to create workqueue\n");
                goto err_out;
index 2fca17cf8b5188be92c019c7df6e73b4c0fee973..639f72f2891109ddc2e281db76dc24e1f482bcc7 100644 (file)
@@ -3537,7 +3537,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev,
        init_completion(&vscsi->unconfig);
 
        snprintf(wq_name, 24, "ibmvscsis%s", dev_name(&vdev->dev));
-       vscsi->work_q = create_workqueue(wq_name);
+       vscsi->work_q = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, wq_name);
        if (!vscsi->work_q) {
                rc = -ENOMEM;
                dev_err(&vscsi->dev, "create_workqueue failed\n");
index 1d91c457527f3817f8ce4cacc34a98907d2aedb7..f84a7e6ae379d6851c4b9a9b7c088e4991d2226e 100644 (file)
@@ -2693,7 +2693,8 @@ int fc_setup_exch_mgr(void)
        fc_cpu_order = ilog2(roundup_pow_of_two(nr_cpu_ids));
        fc_cpu_mask = (1 << fc_cpu_order) - 1;
 
-       fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue");
+       fc_exch_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                                   "fc_exch_workqueue");
        if (!fc_exch_workqueue)
                goto err;
        return 0;
index 33da3c1085f06b97cbb9e5986acbb11dc006328d..308cb4872f968adaf637a7c524e70efee46f40c2 100644 (file)
@@ -2263,7 +2263,8 @@ struct fc4_prov fc_rport_t0_prov = {
  */
 int fc_setup_rport(void)
 {
-       rport_event_queue = create_singlethread_workqueue("fc_rport_eq");
+       rport_event_queue =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fc_rport_eq");
        if (!rport_event_queue)
                return -ENOMEM;
        return 0;
index 9c8cc723170d16e6fbf701a13a6f23a8f4995094..8566bb1208a057b8ac98a7da4878a9256bdd55f9 100644 (file)
@@ -122,12 +122,12 @@ int sas_register_ha(struct sas_ha_struct *sas_ha)
 
        error = -ENOMEM;
        snprintf(name, sizeof(name), "%s_event_q", dev_name(sas_ha->dev));
-       sas_ha->event_q = create_singlethread_workqueue(name);
+       sas_ha->event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name);
        if (!sas_ha->event_q)
                goto Undo_ports;
 
        snprintf(name, sizeof(name), "%s_disco_q", dev_name(sas_ha->dev));
-       sas_ha->disco_q = create_singlethread_workqueue(name);
+       sas_ha->disco_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name);
        if (!sas_ha->disco_q)
                goto Undo_event_q;
 
index 6c1fb8149553a866e5c6d9e6a2e0d25855904a29..1eec23da28e2d63f5a00f8e5e9d10d2a53c93579 100644 (file)
@@ -1988,8 +1988,8 @@ megasas_fusion_start_watchdog(struct megasas_instance *instance)
                 sizeof(instance->fault_handler_work_q_name),
                 "poll_megasas%d_status", instance->host->host_no);
 
-       instance->fw_fault_work_q =
-               create_singlethread_workqueue(instance->fault_handler_work_q_name);
+       instance->fw_fault_work_q = alloc_ordered_workqueue(
+               "%s", WQ_MEM_RECLAIM, instance->fault_handler_work_q_name);
        if (!instance->fw_fault_work_q) {
                dev_err(&instance->pdev->dev, "Failed from %s %d\n",
                        __func__, __LINE__);
index c196dc14ad2063b7514bcd934a03be8adcaf2abd..7c739468dca5d7aa13364fefff2f6316ccb44eb5 100644 (file)
@@ -2742,8 +2742,8 @@ void mpi3mr_start_watchdog(struct mpi3mr_ioc *mrioc)
        snprintf(mrioc->watchdog_work_q_name,
            sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name,
            mrioc->id);
-       mrioc->watchdog_work_q =
-           create_singlethread_workqueue(mrioc->watchdog_work_q_name);
+       mrioc->watchdog_work_q = alloc_ordered_workqueue(
+               "%s", WQ_MEM_RECLAIM, mrioc->watchdog_work_q_name);
        if (!mrioc->watchdog_work_q) {
                ioc_err(mrioc, "%s: failed (line=%d)\n", __func__, __LINE__);
                return;
index b2bcf4a27ddcdec154889a7bb4ef5d255c1aedb2..2d3eeda5a6a0d440b348e26d5d33f20ed658dd95 100644 (file)
@@ -846,8 +846,8 @@ mpt3sas_base_start_watchdog(struct MPT3SAS_ADAPTER *ioc)
        snprintf(ioc->fault_reset_work_q_name,
            sizeof(ioc->fault_reset_work_q_name), "poll_%s%d_status",
            ioc->driver_name, ioc->id);
-       ioc->fault_reset_work_q =
-               create_singlethread_workqueue(ioc->fault_reset_work_q_name);
+       ioc->fault_reset_work_q = alloc_ordered_workqueue(
+               "%s", WQ_MEM_RECLAIM, ioc->fault_reset_work_q_name);
        if (!ioc->fault_reset_work_q) {
                ioc_err(ioc, "%s: failed (line=%d)\n", __func__, __LINE__);
                return;
index f684eb5e04898aff3a2d164bad4649dab716861f..140dc0e9ceadb542f1440a3fac47b4d2ae48a795 100644 (file)
@@ -114,7 +114,8 @@ static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb)
 
        snprintf(cb->work_q_name, sizeof(cb->work_q_name),
                 "myrb_wq_%d", cb->host->host_no);
-       cb->work_q = create_singlethread_workqueue(cb->work_q_name);
+       cb->work_q =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cb->work_q_name);
        if (!cb->work_q) {
                dma_pool_destroy(cb->dcdb_pool);
                cb->dcdb_pool = NULL;
index e824be9d9bbb94f1c1f88bf3da591d7e585dcf8d..8a8f26633cda218a6595d85abfcb9512c35df524 100644 (file)
@@ -2208,7 +2208,8 @@ static bool myrs_create_mempools(struct pci_dev *pdev, struct myrs_hba *cs)
 
        snprintf(cs->work_q_name, sizeof(cs->work_q_name),
                 "myrs_wq_%d", shost->host_no);
-       cs->work_q = create_singlethread_workqueue(cs->work_q_name);
+       cs->work_q =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cs->work_q_name);
        if (!cs->work_q) {
                dma_pool_destroy(cs->dcdb_pool);
                cs->dcdb_pool = NULL;
index 4813087e58a157e12271c96a327e913d4a7358a8..119afcaf6e13bc563cc06ca9d67f3c7ff17d436b 100644 (file)
@@ -3374,7 +3374,8 @@ retry_probe:
 
        sprintf(host_buf, "qedf_%u_link",
            qedf->lport->host->host_no);
-       qedf->link_update_wq = create_workqueue(host_buf);
+       qedf->link_update_wq =
+               alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
        INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update);
        INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery);
        INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump);
@@ -3585,8 +3586,7 @@ retry_probe:
 
        /* Start LL2 processing thread */
        snprintf(host_buf, 20, "qedf_%d_ll2", host->host_no);
-       qedf->ll2_recv_wq =
-               create_workqueue(host_buf);
+       qedf->ll2_recv_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
        if (!qedf->ll2_recv_wq) {
                QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n");
                rc = -ENOMEM;
@@ -3629,7 +3629,7 @@ retry_probe:
 
        sprintf(host_buf, "qedf_%u_timer", qedf->lport->host->host_no);
        qedf->timer_work_queue =
-               create_workqueue(host_buf);
+               alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
        if (!qedf->timer_work_queue) {
                QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer "
                          "workqueue.\n");
@@ -3641,7 +3641,8 @@ retry_probe:
        if (mode != QEDF_MODE_RECOVERY) {
                sprintf(host_buf, "qedf_%u_dpc",
                    qedf->lport->host->host_no);
-               qedf->dpc_wq = create_workqueue(host_buf);
+               qedf->dpc_wq =
+                       alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
        }
        INIT_DELAYED_WORK(&qedf->recovery_work, qedf_recovery_handler);
 
@@ -4182,7 +4183,7 @@ static int __init qedf_init(void)
                goto err3;
        }
 
-       qedf_io_wq = create_workqueue("qedf_io_wq");
+       qedf_io_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, "qedf_io_wq");
        if (!qedf_io_wq) {
                QEDF_ERR(NULL, "Could not create qedf_io_wq.\n");
                goto err4;
index cd0180b1f5b9dad5d8be7019ba0e2675430f543e..319c1da549f701413eae85972a03fdeedef9b57d 100644 (file)
@@ -2767,7 +2767,8 @@ retry_probe:
                }
 
                sprintf(host_buf, "host_%d", qedi->shost->host_no);
-               qedi->tmf_thread = create_singlethread_workqueue(host_buf);
+               qedi->tmf_thread =
+                       alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, host_buf);
                if (!qedi->tmf_thread) {
                        QEDI_ERR(&qedi->dbg_ctx,
                                 "Unable to start tmf thread!\n");
@@ -2776,7 +2777,8 @@ retry_probe:
                }
 
                sprintf(host_buf, "qedi_ofld%d", qedi->shost->host_no);
-               qedi->offload_thread = create_workqueue(host_buf);
+               qedi->offload_thread =
+                       alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
                if (!qedi->offload_thread) {
                        QEDI_ERR(&qedi->dbg_ctx,
                                 "Unable to start offload thread!\n");
index bc3b2aea3f8bfbbabf0f82bdfaba30c8f5a28b9f..7f980e6141c28282d4c4a0123dda96e36e1f180e 100644 (file)
@@ -3501,11 +3501,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) {
                sprintf(wq_name, "qla2xxx_%lu_dpc_lp_wq", base_vha->host_no);
-               ha->dpc_lp_wq = create_singlethread_workqueue(wq_name);
+               ha->dpc_lp_wq =
+                       alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
                INIT_WORK(&ha->idc_aen, qla83xx_service_idc_aen);
 
                sprintf(wq_name, "qla2xxx_%lu_dpc_hp_wq", base_vha->host_no);
-               ha->dpc_hp_wq = create_singlethread_workqueue(wq_name);
+               ha->dpc_hp_wq =
+                       alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
                INIT_WORK(&ha->nic_core_reset, qla83xx_nic_core_reset_work);
                INIT_WORK(&ha->idc_state_handler,
                    qla83xx_idc_state_handler_work);
index 17cccd14765f8d78e806e5b420bf37b47cea8c73..d91f54a6e752f2feb68da69f474375f1415f33a2 100644 (file)
@@ -8806,7 +8806,7 @@ skip_retry_init:
        DEBUG2(printk("scsi: %s: Starting kernel thread for "
                      "qla4xxx_dpc\n", __func__));
        sprintf(buf, "qla4xxx_%lu_dpc", ha->host_no);
-       ha->dpc_thread = create_singlethread_workqueue(buf);
+       ha->dpc_thread = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, buf);
        if (!ha->dpc_thread) {
                ql4_printk(KERN_WARNING, ha, "Unable to start DPC thread!\n");
                ret = -ENODEV;
index cc824dcfe7da42d0bd46c35302edeb7883fdf0cb..2bd01eb57869e30bc6364303f9d5ec2dedc1de8d 100644 (file)
@@ -302,7 +302,8 @@ snic_add_host(struct Scsi_Host *shost, struct pci_dev *pdev)
        SNIC_BUG_ON(shost->work_q != NULL);
        snprintf(shost->work_q_name, sizeof(shost->work_q_name), "scsi_wq_%d",
                 shost->host_no);
-       shost->work_q = create_singlethread_workqueue(shost->work_q_name);
+       shost->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
+                                               shost->work_q_name);
        if (!shost->work_q) {
                SNIC_HOST_ERR(shost, "Failed to Create ScsiHost wq.\n");
 
@@ -884,7 +885,8 @@ snic_global_data_init(void)
        snic_glob->req_cache[SNIC_REQ_TM_CACHE] = cachep;
 
        /* snic_event queue */
-       snic_glob->event_q = create_singlethread_workqueue("snic_event_wq");
+       snic_glob->event_q =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "snic_event_wq");
        if (!snic_glob->event_q) {
                SNIC_ERR("snic event queue create failed\n");
                ret = -ENOMEM;
index 8ffb75be99bc8fab964fc6df5663f9392c844258..fbee7db4a835d4fc7841eaf514c12dbfee8221f2 100644 (file)
@@ -1797,7 +1797,8 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        snprintf(hba->work_q_name, sizeof(hba->work_q_name),
                 "stex_wq_%d", host->host_no);
-       hba->work_q = create_singlethread_workqueue(hba->work_q_name);
+       hba->work_q =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, hba->work_q_name);
        if (!hba->work_q) {
                printk(KERN_ERR DRV_NAME "(%s): create workqueue failed\n",
                        pci_name(pdev));
index c4fea077265ed4b2b901930cb771b6e3d9eaf527..32242d86cf5b633b6b47d01035780cb99894b6d4 100644 (file)
@@ -1137,7 +1137,8 @@ static int pvscsi_setup_msg_workqueue(struct pvscsi_adapter *adapter)
        snprintf(name, sizeof(name),
                 "vmw_pvscsi_wq_%u", adapter->host->host_no);
 
-       adapter->workqueue = create_singlethread_workqueue(name);
+       adapter->workqueue =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name);
        if (!adapter->workqueue) {
                printk(KERN_ERR "vmw_pvscsi: failed to create work queue\n");
                return 0;
index dc757ba47522b0997815e4159366282c7798076a..930b15d9356bb01deda3dd79f560b717450743de 100644 (file)
@@ -1800,7 +1800,8 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba)
 
        snprintf(wq_name, sizeof(wq_name), "ufs_clkscaling_%d",
                 hba->host->host_no);
-       hba->clk_scaling.workq = create_singlethread_workqueue(wq_name);
+       hba->clk_scaling.workq =
+               alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name);
 
        hba->clk_scaling.is_initialized = true;
 }
@@ -10444,7 +10445,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
        /* Initialize work queues */
        snprintf(eh_wq_name, sizeof(eh_wq_name), "ufs_eh_wq_%d",
                 hba->host->host_no);
-       hba->eh_wq = create_singlethread_workqueue(eh_wq_name);
+       hba->eh_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, eh_wq_name);
        if (!hba->eh_wq) {
                dev_err(hba->dev, "%s: failed to create eh workqueue\n",
                        __func__);