From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 7EE04C433E2 for ; Fri, 4 Sep 2020 11:12:30 +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 43C8B20684 for ; Fri, 4 Sep 2020 11:12:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="G0UChd/S"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="eVT8cwrx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43C8B20684 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:References:In-Reply-To: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:List-Owner; bh=wFRSFFg4fDnfMMveopb5belYydF2+wF1jTc/vOTxYNg=; b=G0UChd/SaaeFfIGeS7f6Ewe8JB XEP8zT4v+w7bP/5x0R0541y8V+cvZP1TRqZWewZR5zbouRHi0mXUdiyzI4HGb0Jthc5ccucjeAXf6 a+c2t1/mxcdRHhOdO4ND5Jj25gs2s46hNVGvxBY2pJO8pNibhoHNhjBeeWvAXp8hApi5Bk+2d6mX3 q5JmihRMd2GKFFtCvARrMCZFErJxV9uFMqJqELQHuv7qrMhvxaeTqeUe+Sx8H5o6EJ4tyu+PO5vRl nZ9znlzwGm5rv61Y9eXlAmrGJQPU7Q+6dqprJK7KRDCXm3XMSyxiaV7vasgPe0Y3jesGm2Q5borI0 YVcf1EyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kE9cR-00023l-Ik; Fri, 04 Sep 2020 11:10:59 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kE9bn-0001q5-DU for linux-arm-kernel@lists.infradead.org; Fri, 04 Sep 2020 11:10:20 +0000 Received: by mail-wr1-x442.google.com with SMTP id g4so6333225wrs.5 for ; Fri, 04 Sep 2020 04:10:19 -0700 (PDT) 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:in-reply-to:references; bh=thgOsxp+Xq4BrFvbMKlBsMkOaotb5Mf5M65feuQsl1g=; b=eVT8cwrxekOHbn2awM3ZfKQXGCau9LbF7JlFKYje8HcsBi8kdw8bwT5Me97MX8GNxd 3zbqMLOZoeBMVagJJ2KhmM40wM0UtJ+/WMZuhV5OgB9h2oGLJVLy/rtJLCizeNyKOCCF 6+1QVTUCH73zBZK7rxm7PrD4SfW2dqoosEMpUpNv+24E0M4cLbmJzlvWUKC5NbAHrw2/ TMey3+EIjbq0P7r3dKu6T52ih+OTIH6cXUJNram+F7wOOOq5/VNyA2iIgN4rZthjMPug alzaXRn8t1id15l8JjfkYH8EzOEAuongHzcnann6Mgu4XL6Nal/17PKy7WH472sZJD4k Ug8A== 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:in-reply-to :references; bh=thgOsxp+Xq4BrFvbMKlBsMkOaotb5Mf5M65feuQsl1g=; b=unuazvkoM/eirbg0I//sft7ggqZS1ScBDoHWRfs2NDiNP0gSAydu7Z51xgob/cGzgs g42RVQcBagQDxCMjDWKhMfFU9HsECu0uwWJP+j/whr+TcR79vFXSlkH1nP32f17Qe1Er 7ZmHqLzg7TetHPSZnmbUBEzSzwkTzB0VxfzP2kBQHy0uGHS3FVUiyV5V/gjlFPherCHn b144bpXDBv9NzkFZlRnLzkCrEmmYlbq/KXi+5+IBWUn1KDqBW6hHhjerLBqMONh7RSNG P/nwkpW/xLnnyzOGAqRfuwGOK+XKCwtGKNmFJFpiyP4R+GUSW4XSSNn44ScROxqYzksp C6XA== X-Gm-Message-State: AOAM533waeI+syxWLOM0GFPfP99l0G3EmozWu21wAt4dvPRoz86PUJa+ NjSnoypQEuob8fgu8bSAGDC2Lw== X-Google-Smtp-Source: ABdhPJxBcWh1j08Zum5PgcjZJo2NSCN3nwVnd5GJThQceGa++YbDHwW/64eOMo633e0d2SOMlxBsoA== X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr6885796wrt.32.1599217818497; Fri, 04 Sep 2020 04:10:18 -0700 (PDT) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id m3sm10622743wmb.26.2020.09.04.04.10.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2020 04:10:17 -0700 (PDT) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org Subject: [PATCH v6 07/18] crypto: sun8i-ce: handle endianness of t_common_ctl Date: Fri, 4 Sep 2020 11:09:52 +0000 Message-Id: <1599217803-29755-8-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599217803-29755-1-git-send-email-clabbe@baylibre.com> References: <1599217803-29755-1-git-send-email-clabbe@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200904_071019_589505_992C6C48 X-CRM114-Status: GOOD ( 15.27 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org t_common_ctl is LE32 so we need to convert its value before using it. This value is only used on H6 (ignored on other SoCs) and not handling the endianness cause failure on xRNG/hashes operations on H6 when running BE. Fixes: 06f751b61329 ("crypto: allwinner - Add sun8i-ce Crypto Engine") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 138759dc8190..08ed1ca12baf 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -120,7 +120,10 @@ int sun8i_ce_run_task(struct sun8i_ce_dev *ce, int flow, const char *name) /* Be sure all data is written before enabling the task */ wmb(); - v = 1 | (ce->chanlist[flow].tl->t_common_ctl & 0x7F) << 8; + /* Only H6 needs to write a part of t_common_ctl along with "1", but since it is ignored + * on older SoCs, we have no reason to complicate things. + */ + v = 1 | ((le32_to_cpu(ce->chanlist[flow].tl->t_common_ctl) & 0x7F) << 8); writel(v, ce->base + CE_TLR); mutex_unlock(&ce->mlock); -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel