提交 8fd4dd94 编写于 作者: G Greg Kroah-Hartman 提交者: Zheng Zengkai

Revert "usb: early: convert to readl_poll_timeout_atomic()"

stable inclusion
from stable-v5.10.88
commit 5fe305c6d485e55f964f5b60923234cedf24d57a
bugzilla: 186058 https://gitee.com/openeuler/kernel/issues/I4QW6A

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5fe305c6d485e55f964f5b60923234cedf24d57a

--------------------------------

[ Upstream commit c4d936ef ]

This reverts commit 796eed4b.

This change causes boot lockups when using "arlyprintk=xdbc" because
ktime can not be used at this point in time in the boot process.  Also,
it is not needed for very small delays like this.
Reported-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Reported-by: NPeter Zijlstra <peterz@infradead.org>
Cc: Jann Horn <jannh@google.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>
Fixes: 796eed4b ("usb: early: convert to readl_poll_timeout_atomic()")
Link: https://lore.kernel.org/r/c2b5c9bb-1b75-bf56-3754-b5b18812d65e@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e9cf5bc2
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/iopoll.h>
#include <asm/pci-direct.h> #include <asm/pci-direct.h>
#include <asm/fixmap.h> #include <asm/fixmap.h>
#include <linux/bcd.h> #include <linux/bcd.h>
...@@ -136,9 +135,17 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, int wait, int delay) ...@@ -136,9 +135,17 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, int wait, int delay)
{ {
u32 result; u32 result;
return readl_poll_timeout_atomic(ptr, result, /* Can not use readl_poll_timeout_atomic() for early boot things */
((result & mask) == done), do {
delay, wait); result = readl(ptr);
result &= mask;
if (result == done)
return 0;
udelay(delay);
wait -= delay;
} while (wait > 0);
return -ETIMEDOUT;
} }
static void __init xdbc_bios_handoff(void) static void __init xdbc_bios_handoff(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册