Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: hisilicon/qm - optimize the barrier operation

A 'dma_wmb' barrier is enough to guarantee previous writes
before accessing by acc device in the outer shareable domain.

A 'smp_wmb' barrier is enough to guarantee previous writes
before accessing by other cpus in the inner shareble domain.

Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Hui Tang and committed by
Herbert Xu
4cda2f4a d5db91d2

+3 -3
+3 -3
drivers/crypto/hisilicon/qm.c
··· 687 687 688 688 if (!IS_ENABLED(CONFIG_ARM64)) { 689 689 memcpy_toio(fun_base, src, 16); 690 - wmb(); 690 + dma_wmb(); 691 691 return; 692 692 } 693 693 694 694 asm volatile("ldp %0, %1, %3\n" 695 695 "stp %0, %1, %2\n" 696 - "dsb sy\n" 696 + "dmb oshst\n" 697 697 : "=&r" (tmp0), 698 698 "=&r" (tmp1), 699 699 "+Q" (*((char __iomem *)fun_base)) ··· 982 982 *addr = 1; 983 983 984 984 /* make sure setup is completed */ 985 - mb(); 985 + smp_wmb(); 986 986 } 987 987 988 988 static void qm_disable_qp(struct hisi_qm *qm, u32 qp_id)