···7373 pr_debug("%s: (sync) len: %zu\n", __func__, len);74747575 /* wait for any prerequisite operations */7676- if (depend_tx) {7777- /* if ack is already set then we cannot be sure7878- * we are referring to the correct operation7979- */8080- BUG_ON(async_tx_test_ack(depend_tx));8181- if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR)8282- panic("%s: DMA_ERROR waiting for depend_tx\n",8383- __func__);8484- }7676+ async_tx_quiesce(&depend_tx);85778678 dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset;8779 src_buf = kmap_atomic(src, KM_USER1) + src_offset;
+1-9
crypto/async_tx/async_memset.c
···7272 dest_buf = (void *) (((char *) page_address(dest)) + offset);73737474 /* wait for any prerequisite operations */7575- if (depend_tx) {7676- /* if ack is already set then we cannot be sure7777- * we are referring to the correct operation7878- */7979- BUG_ON(async_tx_test_ack(depend_tx));8080- if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR)8181- panic("%s: DMA_ERROR waiting for depend_tx\n",8282- __func__);8383- }7575+ async_tx_quiesce(&depend_tx);84768577 memset(dest_buf, val, len);8678
+20-9
crypto/async_tx/async_tx.c
···607607 pr_debug("%s: (sync)\n", __func__);608608609609 /* wait for any prerequisite operations */610610- if (depend_tx) {611611- /* if ack is already set then we cannot be sure612612- * we are referring to the correct operation613613- */614614- BUG_ON(async_tx_test_ack(depend_tx));615615- if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR)616616- panic("%s: DMA_ERROR waiting for depend_tx\n",617617- __func__);618618- }610610+ async_tx_quiesce(&depend_tx);619611620612 async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);621613 }···615623 return tx;616624}617625EXPORT_SYMBOL_GPL(async_trigger_callback);626626+627627+/**628628+ * async_tx_quiesce - ensure tx is complete and freeable upon return629629+ * @tx - transaction to quiesce630630+ */631631+void async_tx_quiesce(struct dma_async_tx_descriptor **tx)632632+{633633+ if (*tx) {634634+ /* if ack is already set then we cannot be sure635635+ * we are referring to the correct operation636636+ */637637+ BUG_ON(async_tx_test_ack(*tx));638638+ if (dma_wait_for_async_tx(*tx) == DMA_ERROR)639639+ panic("DMA_ERROR waiting for transaction\n");640640+ async_tx_ack(*tx);641641+ *tx = NULL;642642+ }643643+}644644+EXPORT_SYMBOL_GPL(async_tx_quiesce);618645619646module_init(async_tx_init);620647module_exit(async_tx_exit);
+2-35
crypto/async_tx/async_xor.c
···3030#include <linux/raid/xor.h>3131#include <linux/async_tx.h>32323333-/**3434- * async_tx_quiesce - ensure tx is complete and freeable upon return3535- * @tx - transaction to quiesce3636- */3737-static void async_tx_quiesce(struct dma_async_tx_descriptor **tx)3838-{3939- if (*tx) {4040- /* if ack is already set then we cannot be sure4141- * we are referring to the correct operation4242- */4343- BUG_ON(async_tx_test_ack(*tx));4444- if (dma_wait_for_async_tx(*tx) == DMA_ERROR)4545- panic("DMA_ERROR waiting for transaction\n");4646- async_tx_ack(*tx);4747- *tx = NULL;4848- }4949-}5050-5133/* do_async_xor - dma map the pages and perform the xor with an engine.5234 * This routine is marked __always_inline so it can be compiled away5335 * when CONFIG_DMA_ENGINE=n···201219 }202220203221 /* wait for any prerequisite operations */204204- if (depend_tx) {205205- /* if ack is already set then we cannot be sure206206- * we are referring to the correct operation207207- */208208- BUG_ON(async_tx_test_ack(depend_tx));209209- if (dma_wait_for_async_tx(depend_tx) == DMA_ERROR)210210- panic("%s: DMA_ERROR waiting for depend_tx\n",211211- __func__);212212- }222222+ async_tx_quiesce(&depend_tx);213223214224 do_sync_xor(dest, src_list, offset, src_cnt, len,215225 flags, depend_tx, cb_fn, cb_param);···283309 tx = async_xor(dest, src_list, offset, src_cnt, len, xor_flags,284310 depend_tx, NULL, NULL);285311286286- if (tx) {287287- if (dma_wait_for_async_tx(tx) == DMA_ERROR)288288- panic("%s: DMA_ERROR waiting for tx\n",289289- __func__);290290- async_tx_ack(tx);291291- }312312+ async_tx_quiesce(&tx);292313293314 *result = page_is_zero(dest, offset, len) ? 0 : 1;294294-295295- tx = NULL;296315297316 async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);298317 }