提交 1550217a 编写于 作者: A Adrian Hunter 提交者: Ulf Hansson

mmc: mmc_test: Remove local_irq_{save,restore}() around sg_copy_{from,to}_buffer()

sg_copy_{from,to}_buffer() call sg_copy_buffer() which uses an
sg_mapping_iter with flag SG_MITER_ATOMIC, so then sg_miter_next() uses
kmap_atomic() to map pages.

A long time ago the kmap_atomic API required a slot to be provided which
risked the possibility that other code might use the same slot at the
same time. Disabling interrupts prevented the possibility of an interrupt
handler doing that. However, that went away with
commit 3e4d3af5 ("mm: stack based kmap_atomic()").

Remove local_irq_{save,restore}() around sg_copy_{from,to}_buffer().
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20221005101951.3165-8-adrian.hunter@intel.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 07e23c14
...@@ -932,7 +932,6 @@ static int mmc_test_transfer(struct mmc_test_card *test, ...@@ -932,7 +932,6 @@ static int mmc_test_transfer(struct mmc_test_card *test,
unsigned blocks, unsigned blksz, int write) unsigned blocks, unsigned blksz, int write)
{ {
int ret, i; int ret, i;
unsigned long flags;
if (write) { if (write) {
for (i = 0; i < blocks * blksz; i++) for (i = 0; i < blocks * blksz; i++)
...@@ -940,9 +939,7 @@ static int mmc_test_transfer(struct mmc_test_card *test, ...@@ -940,9 +939,7 @@ static int mmc_test_transfer(struct mmc_test_card *test,
} else { } else {
memset(test->scratch, 0, BUFFER_SIZE); memset(test->scratch, 0, BUFFER_SIZE);
} }
local_irq_save(flags);
sg_copy_from_buffer(sg, sg_len, test->scratch, BUFFER_SIZE); sg_copy_from_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
local_irq_restore(flags);
ret = mmc_test_set_blksize(test, blksz); ret = mmc_test_set_blksize(test, blksz);
if (ret) if (ret)
...@@ -987,9 +984,7 @@ static int mmc_test_transfer(struct mmc_test_card *test, ...@@ -987,9 +984,7 @@ static int mmc_test_transfer(struct mmc_test_card *test,
return RESULT_FAIL; return RESULT_FAIL;
} }
} else { } else {
local_irq_save(flags);
sg_copy_to_buffer(sg, sg_len, test->scratch, BUFFER_SIZE); sg_copy_to_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
local_irq_restore(flags);
for (i = 0; i < blocks * blksz; i++) { for (i = 0; i < blocks * blksz; i++) {
if (test->scratch[i] != (u8)i) if (test->scratch[i] != (u8)i)
return RESULT_FAIL; return RESULT_FAIL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册