From patchwork Mon Dec 14 20:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 11972883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C670EC4361B for ; Mon, 14 Dec 2020 20:04:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D9AA2076B for ; Mon, 14 Dec 2020 20:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D9AA2076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=6FvdgzdcnOtFWz2EQrgOnraqbVnRTIPdiKrKx/ltKXg=; b=Fz+7COBwZZMi83+cK9fcOb/BfS xN+3uG9Qvld/Oz0rKYDBhYmRFU7ec7Vp8Sj79Gr+AJdwQ+sWsZ5NN60LzuqQnjafZ+Yb2ZrBAFrgE 6e7jmMH3z7xJ4lmQLlCw4vdIltObHy9BqSexmMPvHbnMOw9q/r+GOuR5xPO4j22tC8fN1oxuev19q 46vhl/nrnN8kVNO1lW9i+MaXoaISn3DanwJN+qwQyFXEliAo+8ZNvfd+HKZrGN/RB0e/DNsj6IcZO GCKt11TKAasPPxxr6dI3MxFX5q6H/cBg1zwfMSPq/MQcSVgtkq57jiC6cxXWc+SxaZpggWBrul5rU l2EhABlw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kou3c-0007Ml-Rk; Mon, 14 Dec 2020 20:02:56 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kou3Z-0007Ln-Pb for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 20:02:55 +0000 Received: by mail-pj1-x1041.google.com with SMTP id hk16so7346026pjb.4 for ; Mon, 14 Dec 2020 12:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=QT8NIpdXPvB5AxHdzPljCniOubRI5wdzJKZjH5NenqY=; b=DujLLjbNY2EqBfSfkapUKZhtAMbzp6keOCUoGrS6UzdoyiRrmkjKWP6Ufrc4ru/3K2 axkWExX+zhOPGOUPZIXVJk/zH6AwlYuYYbyF/y+U1WXH4rCPIgfcBOUyrOgH6DOHKVRD aB83q/S1BUogVWX5nRzlndQxQ4f2F/9dySQGMpsfe2t9nb9hpsx9C2hfiM+Dl29uc+IV Hh/WhUTDAILLkg7PFCmkWyMdi8UU2MQ+N4lPYDze0VMhgsww8DWG4PjN3d4hI9ckMJ4Y bdbxgjiIyqtTSuBkqj1PxtCjofRXWjzP5lmgyQ1ghOumixPFbxYc9MhWVqyP5mdLcUWZ +h2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QT8NIpdXPvB5AxHdzPljCniOubRI5wdzJKZjH5NenqY=; b=DYo8sFi8O8P8FekZxnueyAs+WDNnBYni72H72031E15BKH5S9v8JB0Ivf5LJNtQSZe VmHjtJLisqfa7qOr0o4buh5Ym7iTfbFXm2v26u0cv0EGgr9gPFuDWiwBkTbw6aZriRvb GXvUsNT4lfoAi+66tUAx9S6LFlFNCGFr2/XLP5H4DsYlSDbxzuiPwUKT55XTavObdN9a xIn8F/fEGoGv87DI4uRVj7lQB6URN8AbeL8cWoHD4HjwrjMSi4gLsPGeoeYN+O5m3scr y0lUb0XpFgw9v4v6C+Me6AnxiwTOUT6BhcPK9g1RZdegjtZBEfcXlNdvdBsGF++m6QaJ Fheg== X-Gm-Message-State: AOAM530k4FGar4387A261gvGdTU3R40O8Wboelh/Af/bSsGWqt78GAo1 LnBZaPhoqYuhOlGWexUrVJ/Mag== X-Google-Smtp-Source: ABdhPJwkjyrENefrYh5pxJoB8S3p7TTI+eXMZ6+uwRGFC7DK+3jkBzZ+qU5Jx7hVyfjt+T6PNIbfkA== X-Received: by 2002:a17:90a:7e95:: with SMTP id j21mr26783571pjl.217.1607976169812; Mon, 14 Dec 2020 12:02:49 -0800 (PST) Received: from localhost.localdomain ([163.172.76.58]) by smtp.googlemail.com with ESMTPSA id js9sm22434109pjb.2.2020.12.14.12.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 12:02:49 -0800 (PST) From: Corentin Labbe To: arnd@arndb.de, davem@davemloft.net, herbert@gondor.apana.org.au, jernej.skrabec@siol.net, mripard@kernel.org, wens@csie.org Subject: [PATCH v4 0/8] crypto: sun4i-ss: prevent always fallback for ciphers Date: Mon, 14 Dec 2020 20:02:24 +0000 Message-Id: <20201214200232.17357-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_150253_960200_2A42FD5E X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corentin Labbe , linux-sunxi@googlegroups.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello For help testing on "crypto: sun4i-ss - Fix sparse endianness markers", I have added "stats" support like other allwinner's crypto drivers. Seeing stats showed a clear problem, the ciphers function were not used at all. This is due to the not-inialized need_fallback which is "init" as true everytime. So basicly, since the patch introduced it, this probem hidden some bugs. This serie fixes all hidden problems, then fix the initialization of "need_fallback" and then add the stats like other allwinner drivers. Regards changes since v3: - patch #2: Rewrite test as suggested by David Laight - patch #7: removed all ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_DEBUG - added kmap patch Changes since v2: - patch #1: move buf/bufo out of function for reducing stack usage - patch #4: use writesl() - patch #6: use IS_ENABLED instead of #ifdef Changes since v1: - patch #4 is sufficient to fix BE problem (removed todo) Corentin Labbe (8): crypto: sun4i-ss: linearize buffers content must be kept crypto: sun4i-ss: checking sg length is not sufficient crypto: sun4i-ss: IV register does not work on A10 and A13 crypto: sun4i-ss: handle BigEndian for cipher crypto: sun4i-ss: initialize need_fallback crypto: sun4i-ss: fix kmap usage crypto: sun4i-ss: enabled stats via debugfs crypto: sun4i-ss: add SPDX header and remove blank lines drivers/crypto/allwinner/Kconfig | 9 + .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 196 +++++++++++------- .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 52 +++++ .../crypto/allwinner/sun4i-ss/sun4i-ss-hash.c | 6 + .../crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 6 + drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 8 + 6 files changed, 207 insertions(+), 70 deletions(-)