Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1135336pxk; Fri, 4 Sep 2020 01:12:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrBnn/hjO3tHQaJYy4ezcUuD6xPV3cWGruRpVtgCO1zCRJ5QGIhZyw5slP5Hv8SKtfy9fP X-Received: by 2002:a17:906:715b:: with SMTP id z27mr6567691ejj.166.1599207158810; Fri, 04 Sep 2020 01:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599207158; cv=none; d=google.com; s=arc-20160816; b=TxK7UwGFUzHDu4JwtkjrE+gzlfk4Wq+SqTGZiWuWWIYUI23Y2DaYgIgTK2qgQtuC/p yKQyxq7C2mIDGo2boDTkyIufkK7/w5iZZrsPb+2YzKWrSHrYdOS7Lpmf4Yzn8aBWURtY ffAx0ZnTUKALp4ip0PJeS7RCp8TB7eaVZ86Z5JYgLdPRR5fzFLMupimqhC0L1i93A8Ox iPVAPhOuk8b0DjWpBNhIvhi/1WQOLCMIbUbycQ1lBii3xpgflcVxt6zKH/yq4TJbj7Wy kDuf1oNL82cjLvJ0kAhe9dv+9QFaECKP1o4KsPHK5OabV7KoYtBmTOmfpxdOr7lR03Ng Gq1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date; bh=kwRbvjVGJtWEA38q9I6RNxMWysPuyqH4H/CbsoGn0VA=; b=oqgmtEXLdYtjOTqhKELdAmSLOGPMZAM+wIDaX9F+YGGsJlk7OW8hGIu3QlYuadOosd y1oM4Pq+CgJ8evSJa6swP1MAy1+SLGIcYnkLJobXoiFPKBQSJveQwHLv2phW6dFynBe9 hn6nzU+9KQbUD8DxF605d01BQ30NndH3S6aA1musCFdl5+62G4SibsX9eRktqbLIdX51 pFc7epRyBEqmpfhaLUQcTv/DDKIVebY5d1PivC5zMSf4PmWJW/YeQfzQjqXf/JIsk34p xV2iRjzVhRGjeNhonKtJzPrJY+y8QLiqD52YORxAWtxJNpfin6XyNnZxQKMq7aURPAj9 EPLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si3402336edv.549.2020.09.04.01.12.14; Fri, 04 Sep 2020 01:12:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbgIDIL0 (ORCPT + 99 others); Fri, 4 Sep 2020 04:11:26 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:42644 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbgIDILY (ORCPT ); Fri, 4 Sep 2020 04:11:24 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kE6oc-00013g-6D; Fri, 04 Sep 2020 18:11:23 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 04 Sep 2020 18:11:22 +1000 Date: Fri, 4 Sep 2020 18:11:22 +1000 From: Herbert Xu To: Corentin Labbe , Linux Crypto Mailing List Subject: [PATCH] crypto: sun8i-ce - Fix big-endian read of t_common_ctl Message-ID: <20200904081122.GA23618@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The field t_common_ctl is supposed to be little-endian and indeed when it is filled in we've already done a cpu_to_le32 on it. However, in sun8i_ce_run_task it is taken as CPU-endian which is obviously wrong on BE. This patch fixes it. Fixes: 93c7f4d357de ("crypto: sun8i-ce - enable working on big...") Signed-off-by: Herbert Xu diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index 138759dc8190..703a60d4e2f6 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -120,7 +120,7 @@ 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; + v = 1 | (le32_to_cpu(ce->chanlist[flow].tl->t_common_ctl) & 0x7F) << 8; writel(v, ce->base + CE_TLR); mutex_unlock(&ce->mlock); -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt