Commit cddaebaf authored by Can Guo's avatar Can Guo Committed by Martin K. Petersen

scsi: ufs: Fix register dump caused sleep in atomic context

ufshcd_print_host_regs() can be called by interrupt handler, but it may
sleep due to ufshcd_dump_regs() allocates the dump buffer memory with flag
GFP_KERNEL. Fix it by changing GFP_KERNEL to GFP_ATMOIC.

Link: https://lore.kernel.org/r/1573798172-20534-5-git-send-email-cang@codeaurora.orgReviewed-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 71d848b8
...@@ -117,7 +117,7 @@ int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len, ...@@ -117,7 +117,7 @@ int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,
if (offset % 4 != 0 || len % 4 != 0) /* keep readl happy */ if (offset % 4 != 0 || len % 4 != 0) /* keep readl happy */
return -EINVAL; return -EINVAL;
regs = kzalloc(len, GFP_KERNEL); regs = kzalloc(len, GFP_ATOMIC);
if (!regs) if (!regs)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment