Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6890939rwl; Thu, 29 Dec 2022 23:32:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKx6GwXEpx8fm251iPenxQxzB4tNTxek9FeXorP/EPMycZStz0aBMgzO64l8r8cTUcRZ5w X-Received: by 2002:a17:907:170c:b0:7c1:2478:a4d8 with SMTP id le12-20020a170907170c00b007c12478a4d8mr27340661ejc.54.1672385579281; Thu, 29 Dec 2022 23:32:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672385579; cv=none; d=google.com; s=arc-20160816; b=bgk1MSOZ+Ovak9gvEr9jGbb768CKj74EaVJGe67PbBQmgpFlXbvOBz22pKl9q86zFj dS+O49ujx8eYQMjtGhO6Aq0Ndh3jaz7wxgl7IgI4gUn8Do0R7v9OTk/MGUF/ZlSVye0R PagIRv/ApiwrBGiXuXAzfpLrczGNS5jylOpNkcwhQNFusa02eC+GV3NpafriS2YDPbzQ Q9bR3g/1VbllOpxNDxP/m/ormAa0Db/O4WIWaKo0uaNn5BjfHRYEcJuyICa3qruWT3nX ZdI6HWWUyiz/XeX1XDSitefb42i+JRXrYk32ziNlNE41R8GwEfMaMWNBK3cas+mY4+pR WaOw== 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=o9xIo+TxJ70NC+yyZzbFOvMzr2zB8BFkjON4Wn1Ocgk=; b=g4QvY9FXEuk+hM/VZTLjZSXOnjHnQ4no/EWSX7VC2BFStFXYJxGZYR4l4HBwrxq0iH EGCfUS3p2ub4xPC9iMYxp8kvK84G87ASHzOAnuJPiFaysV6keaF909yqFLY3YyV1fGkA 9L7/LP0etaJE7GCcWYs+u5j3GsGzbTvQezC+V2RGq6Xlxt81MK0cqSpa7quNC5/6JmWD UXk/VmsG4Iz110OjW6m1+6xwWy1puTLiAmdbnapPnOZXt40PqcPmwAWpQAcIJBoyiN57 hiZ6+JpoorcEM1ubUxXCOUIZ5ZC+bWTfBIgnJaDsjxAPVwnwaxq2HOdBqYvQsA2or/aD hlwA== 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 di15-20020a170906730f00b0082e778818desi18561943ejc.120.2022.12.29.23.32.29; Thu, 29 Dec 2022 23:32:59 -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 S234470AbiL3HcD (ORCPT + 99 others); Fri, 30 Dec 2022 02:32:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbiL3HcD (ORCPT ); Fri, 30 Dec 2022 02:32:03 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A062C2BD9; Thu, 29 Dec 2022 23:32:00 -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 1pB9rZ-00CGJz-Vs; Fri, 30 Dec 2022 15:31:35 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 30 Dec 2022 15:31:33 +0800 Date: Fri, 30 Dec 2022 15:31:33 +0800 From: Herbert Xu To: Christoph Hellwig Cc: Catalin Marinas , Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" , Linux Crypto Mailing List , Christophe Leroy Subject: [PATCH] crypto: talitos - Remove GFP_DMA and add DMA alignment padding Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 GFP_DMA does not guarantee that the returned memory is aligned for DMA. It should be removed where it is superfluous. However, kmalloc may start returning DMA-unaligned memory in future so fix this by adding the alignment by hand. Signed-off-by: Herbert Xu diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 71db6450b6aa..d62ec68e3183 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1393,7 +1393,7 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, alloc_len += sizeof(struct talitos_desc); alloc_len += ivsize; - edesc = kmalloc(alloc_len, GFP_DMA | flags); + edesc = kmalloc(ALIGN(alloc_len, dma_get_cache_alignment()), flags); if (!edesc) return ERR_PTR(-ENOMEM); if (ivsize) { -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt