Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7408058rwl; Mon, 9 Jan 2023 23:54:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsy6sVnoiQXoayqS/AzqELRFcldNs5B67dEC+94DOqVFCxg9yQJBPPjzp2uBGECZJquj1jS X-Received: by 2002:a17:90b:2688:b0:225:f8ce:5cd8 with SMTP id pl8-20020a17090b268800b00225f8ce5cd8mr52002337pjb.4.1673337242023; Mon, 09 Jan 2023 23:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673337242; cv=none; d=google.com; s=arc-20160816; b=fzLpwAqjb864koyW4dPnDGZ8vJQKZu4qOa7UCz0JPm89OuZmofXtW5NZGC03h2Otdm 6K0H336ozo7N2PCRLDWmTpvbVjN1MBG5MANT6uKcP1fK9BIriwpMscd6xJ0+Y1eUWudf Ytvd7dFJp7m5d9nILD19Ov33qfxHteznfIphc4d2kUMG3jO0JNC6jJGg60GXZKMadI32 vF4srmEPOYhagVLWg4zZ4d9wUuGvEoddmdyRyfDfDro8b0OjVodc9+SSBaYlhmgo/v+K aE+wX7+D4Wmsb27BeLQvCQvTChFQ4V5aLbn6cRUzsQORv8xhDxXGQ4ZOl+LVy+EZbqtL cr5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8sTbnQtX6+tr2hL9TfegyNyFCdg8ZMS3DiPQMvBxA2A=; b=boDzVHSfkM2Bw+a2HFWysuFzSrCzn/RVIsnU2UQvoKRI2A0ixAxMdy4xquQ0dRPZE2 OuPa1fguRvzrsOIt/yzm1L5kXznl5uuSA6MeJVSRiGNWGCs5RMr5mbKKzIB5hvNP43Jg xcLEzrs7sEVXpxzseMpZfdGCVPtylLh3yMQo6Zzs4XQmnkXi1YOViSUuZpOipVBx9KJg J8z9qnN/Z5hqUvrxUBqBQ3wo11JAbE8W2ZafM7ekPtYBE+rJWxl+hXJqmmE0OxPrJGD4 h6ikLH21fjq2QKobtfj+EbifSsHf6EePDLVf642++oJk5A2v5cDnygmIhaLhyyLyeRn9 J2Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot2-20020a17090b3b4200b00225f3e34336si16134076pjb.89.2023.01.09.23.53.49; Mon, 09 Jan 2023 23:54:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231248AbjAJHrL (ORCPT + 99 others); Tue, 10 Jan 2023 02:47:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbjAJHrK (ORCPT ); Tue, 10 Jan 2023 02:47:10 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCE4C178B2 for ; Mon, 9 Jan 2023 23:47:09 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pF9Lf-00FwsK-2p; Tue, 10 Jan 2023 15:47:08 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 10 Jan 2023 15:47:07 +0800 Date: Tue, 10 Jan 2023 15:47:07 +0800 From: Herbert Xu To: Markus Stockhausen Cc: linux-crypto@vger.kernel.org Subject: Re: [PATCH v3 2/6] crypto/realtek: core functions Message-ID: References: <000f04f6ed4aef9bb4a67ae00fc259922f88090c.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000f04f6ed4aef9bb4a67ae00fc259922f88090c.camel@gmx.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Jan 06, 2023 at 05:17:16PM +0100, Markus Stockhausen wrote: > > Thanks, I need to check this again. CPU sets ownership bit in that > descriptor to OWNED_BY_ASIC and after processing we expect that engine > has set it back to OWNED_BY_CPU. So bidirectional operation is somehow > needed. For each bi-directional mapping, you must call dma_sync_single_for_cpu before you read what the hardware has just written. Then you make your changes, and once you are done you do dma_sync_single_for_device Note that you must ensure that the hardware does not modify the memory area after you have called dma_sync_single_for_cpu and before the next dma_sync_single_for_device call. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt