aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>2016-07-26 13:01:06 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-07-29 05:29:05 -0400
commit6ea6257945188ff7f5d1670d5adc964ac78c590c (patch)
treece77c1dddd429ec5571e8b65690caa41c9d5968a
parent9bce7fd6f8348e889465971b61efc0245eb6449e (diff)
mmc: rtsx_pci: Remove deprecated create_singlethread_workqueue
The workqueue "workq" provides support for sd/mmc async request, which makes next request do dma_map_sg() while previous request transferring data. The workqueue has a single workitem(&host->work) and hence doesn't require ordering. Also, it is not being used on a memory reclaim path. Hence, the singlethreaded workqueue has been replaced with the use of system_wq. System workqueues have been able to handle high level of concurrency for a long time now and hence it's not required to have a singlethreaded workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue created with create_singlethread_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantee unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. Work item has been flushed in rtsx_pci_sdmmc_drv_remove() to ensure that there are no pending tasks while disconnecting the driver. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/rtsx_pci_sdmmc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 40f957e0960f..396c9b7e4121 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -38,7 +38,6 @@ struct realtek_pci_sdmmc {
38 struct rtsx_pcr *pcr; 38 struct rtsx_pcr *pcr;
39 struct mmc_host *mmc; 39 struct mmc_host *mmc;
40 struct mmc_request *mrq; 40 struct mmc_request *mrq;
41 struct workqueue_struct *workq;
42#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq" 41#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq"
43 42
44 struct work_struct work; 43 struct work_struct work;
@@ -885,7 +884,7 @@ static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
885 if (sd_rw_cmd(mrq->cmd) || sdio_extblock_cmd(mrq->cmd, data)) 884 if (sd_rw_cmd(mrq->cmd) || sdio_extblock_cmd(mrq->cmd, data))
886 host->using_cookie = sd_pre_dma_transfer(host, data, false); 885 host->using_cookie = sd_pre_dma_transfer(host, data, false);
887 886
888 queue_work(host->workq, &host->work); 887 schedule_work(&host->work);
889} 888}
890 889
891static int sd_set_bus_width(struct realtek_pci_sdmmc *host, 890static int sd_set_bus_width(struct realtek_pci_sdmmc *host,
@@ -1404,11 +1403,6 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
1404 return -ENOMEM; 1403 return -ENOMEM;
1405 1404
1406 host = mmc_priv(mmc); 1405 host = mmc_priv(mmc);
1407 host->workq = create_singlethread_workqueue(SDMMC_WORKQ_NAME);
1408 if (!host->workq) {
1409 mmc_free_host(mmc);
1410 return -ENOMEM;
1411 }
1412 host->pcr = pcr; 1406 host->pcr = pcr;
1413 host->mmc = mmc; 1407 host->mmc = mmc;
1414 host->pdev = pdev; 1408 host->pdev = pdev;
@@ -1462,9 +1456,7 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
1462 mmc_remove_host(mmc); 1456 mmc_remove_host(mmc);
1463 host->eject = true; 1457 host->eject = true;
1464 1458
1465 flush_workqueue(host->workq); 1459 flush_work(&host->work);
1466 destroy_workqueue(host->workq);
1467 host->workq = NULL;
1468 1460
1469 mmc_free_host(mmc); 1461 mmc_free_host(mmc);
1470 1462