linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Fix to check the return value of alloc_ordered_workqueue
@ 2019-03-19 17:54 Aditya Pakki
  2019-03-26 14:17 ` Avri Altman
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-03-19 17:54 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Alim Akhtar, Avri Altman, Pedro Sousa,
	James E.J. Bottomley, Martin K. Petersen, Subhash Jadavani,
	Asutosh Das, Marc Gonzalez, Bjorn Andersson, Ohad Sharabi,
	Vivek Gautam, linux-scsi, linux-kernel

In ufshcd_init_clk_gating, alloc_ordered_workqueue may fail and return
NULL. The patch handles error consistent with other invocations in this
module.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/scsi/ufs/ufshcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e040f9dd9ff3..701b2da25f09 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1791,6 +1791,8 @@ static void ufshcd_init_clk_gating(struct ufs_hba *hba)
 		 hba->host->host_no);
 	hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue(wq_name,
 							   WQ_MEM_RECLAIM);
+	if (!hba->clk_gating.clk_gating_workq)
+		dev_err(hba->dev, "Failed to allocate work queue\n");
 
 	hba->clk_gating.is_enabled = true;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] scsi: ufs: Fix to check the return value of alloc_ordered_workqueue
  2019-03-19 17:54 [PATCH] scsi: ufs: Fix to check the return value of alloc_ordered_workqueue Aditya Pakki
@ 2019-03-26 14:17 ` Avri Altman
  0 siblings, 0 replies; 2+ messages in thread
From: Avri Altman @ 2019-03-26 14:17 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kjlu, Alim Akhtar, Pedro Sousa, James E.J. Bottomley,
	Martin K. Petersen, Subhash Jadavani, Asutosh Das, Marc Gonzalez,
	Bjorn Andersson, Ohad Sharabi, Vivek Gautam, linux-scsi,
	linux-kernel

Hi,
> 
> In ufshcd_init_clk_gating, alloc_ordered_workqueue may fail and return
> NULL. The patch handles error consistent with other invocations in this
> module.
Not sure that's good enough, as later on we will try to queue work to that workqueue.

Thanks,
Avri


> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  drivers/scsi/ufs/ufshcd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index e040f9dd9ff3..701b2da25f09 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1791,6 +1791,8 @@ static void ufshcd_init_clk_gating(struct ufs_hba
> *hba)
>  		 hba->host->host_no);
>  	hba->clk_gating.clk_gating_workq =
> alloc_ordered_workqueue(wq_name,
> 
> WQ_MEM_RECLAIM);
> +	if (!hba->clk_gating.clk_gating_workq)
> +		dev_err(hba->dev, "Failed to allocate work queue\n");
> 
>  	hba->clk_gating.is_enabled = true;
> 
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-26 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 17:54 [PATCH] scsi: ufs: Fix to check the return value of alloc_ordered_workqueue Aditya Pakki
2019-03-26 14:17 ` Avri Altman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).