From: Can Guo Date: Fri, 15 Nov 2019 06:09:27 +0000 (-0800) Subject: scsi: ufs: Fix register dump caused sleep in atomic context X-Git-Tag: v5.15~4920^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cddaebaf3d81584180d647e9cbda4ecbf8e8e71c;p=platform%2Fkernel%2Flinux-starfive.git 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.org Reviewed-by: Bean Huo Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 7bba6bb..31ecccf 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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 */ return -EINVAL; - regs = kzalloc(len, GFP_KERNEL); + regs = kzalloc(len, GFP_ATOMIC); if (!regs) return -ENOMEM;