Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753371AbbGBJno (ORCPT ); Thu, 2 Jul 2015 05:43:44 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45120 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753263AbbGBJnd (ORCPT ); Thu, 2 Jul 2015 05:43:33 -0400 Message-ID: <559507BA.8090700@ti.com> Date: Thu, 2 Jul 2015 15:13:22 +0530 From: Lokesh Vutla User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: CC: , , , , , , Subject: Re: [PATCH 02/10] crypto: omap-aes: Fix configuring of AES mode References: <1435814320-30347-1-git-send-email-lokeshvutla@ti.com> <1435814320-30347-3-git-send-email-lokeshvutla@ti.com> <20150702075732.GB4033@saruman.tx.rr.com> In-Reply-To: <20150702075732.GB4033@saruman.tx.rr.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 43 On Thursday 02 July 2015 01:27 PM, Felipe Balbi wrote: > On Thu, Jul 02, 2015 at 10:48:32AM +0530, Lokesh Vutla wrote: >> AES_CTRL_REG is used to configure AES mode. Before configuring >> any mode we need to make sure all other modes are reset or else >> driver will misbehave. So mask all modes before configuring >> any AES mode. >> >> Signed-off-by: Lokesh Vutla >> --- >> drivers/crypto/omap-aes.c | 13 +++++-------- >> 1 file changed, 5 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c >> index a923101..96fc7f7 100644 >> --- a/drivers/crypto/omap-aes.c >> +++ b/drivers/crypto/omap-aes.c >> @@ -63,6 +63,7 @@ >> #define AES_REG_CTRL_DIRECTION (1 << 2) >> #define AES_REG_CTRL_INPUT_READY (1 << 1) >> #define AES_REG_CTRL_OUTPUT_READY (1 << 0) >> +#define AES_REG_CTRL_MASK FLD_MASK(24, 2) > > you end up masking bits which aren't even defined in this driver. What > are those bits ? Perhaps add macros for them and define > AES_REG_CTRL_MASK by explicitly ORing those macros ? That would, at > least, be clearer Hardware supports ECB, CBC, CTR, CFB, F8, CBC_MAC, F9, GCM, CCM, XTS modes. But current driver has only ECB, CBC, CTR modes support. That is why the other fields are not yet defined. So, defining these is fine, but ORing all these will be very big and looks a bit ugly. So I kept it as mask of all these bits. Ill move it to GEN_MASK here only. Thanks and regards, Lokesh > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/