提交 df54b52c 编写于 作者: J Josh Boyer 提交者: David Woodhouse

CHIPS: Fix potential starvation in cfi_cmdset_0001

The patch below fixes a potential starvation issue that can arise when
there is contention on a chip during a period when a process is
currently writing to it.  The starvation is avoided by conditionally
rescheduling when the chip is left in a state usable by other processes.
Signed-off-by: NJosh Boyer <jdub@us.ibm.com>
Signed-off-by: NTom Gall <tom_gall@vnet.ibm.com>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 ba9627b8
......@@ -1691,6 +1691,11 @@ static int cfi_intelext_writev (struct mtd_info *mtd, const struct kvec *vecs,
if (chipnum == cfi->numchips)
return 0;
}
/* Be nice and reschedule with the chip in a usable state for other
processes. */
cond_resched();
} while (len);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册