Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa581c5f authored by Can Guo's avatar Can Guo Committed by Todd Kjos
Browse files

UPSTREAM: 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: 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>

Bug: 143632303
Change-Id: I0caae42ac6df8080876046eea674d08933f769ee
(cherry picked from commit cddaebaf3d81584180d647e9cbda4ecbf8e8e71c)
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 5b3f757a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,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;