From mboxrd@z Thu Jan 1 00:00:00 1970 From: Corentin LABBE Subject: Re: Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator Date: Sat, 23 May 2015 14:18:06 +0200 Message-ID: <55606FFE.4000902@gmail.com> References: <1431608341-10936-1-git-send-email-clabbe.montjoie@gmail.com> <1431608341-10936-5-git-send-email-clabbe.montjoie@gmail.com> <20150515064932.GB16704@gondor.apana.org.au> Reply-To: clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org, joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To: herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org Return-path: In-Reply-To: <20150515064932.GB16704-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , List-Id: linux-crypto.vger.kernel.org Le 15/05/2015 08:49, Herbert Xu a =C3=A9crit : > On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote: >> >> + err =3D crypto_ablkcipher_setkey(op->fallback, kkey, op->keylen); >> + if (err !=3D 0) { >> + dev_err(ss->dev, "Cannot set key on fallback\n"); >> + return -EINVAL; >> + } >=20 > You cannot call setkey from an atomic context. The easiest solution > is to call setkey in your setkey function instead. >=20 > Cheers, >=20 Fixed What do you think about adding a BUG_ON(in_atomic()) in crypto_ablkcipher_s= etkey() ? Thanks --=20 You received this message because you are subscribed to the Google Groups "= linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout. From mboxrd@z Thu Jan 1 00:00:00 1970 From: clabbe.montjoie@gmail.com (Corentin LABBE) Date: Sat, 23 May 2015 14:18:06 +0200 Subject: [linux-sunxi] Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator In-Reply-To: <20150515064932.GB16704@gondor.apana.org.au> References: <1431608341-10936-1-git-send-email-clabbe.montjoie@gmail.com> <1431608341-10936-5-git-send-email-clabbe.montjoie@gmail.com> <20150515064932.GB16704@gondor.apana.org.au> Message-ID: <55606FFE.4000902@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Le 15/05/2015 08:49, Herbert Xu a ?crit : > On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote: >> >> + err = crypto_ablkcipher_setkey(op->fallback, kkey, op->keylen); >> + if (err != 0) { >> + dev_err(ss->dev, "Cannot set key on fallback\n"); >> + return -EINVAL; >> + } > > You cannot call setkey from an atomic context. The easiest solution > is to call setkey in your setkey function instead. > > Cheers, > Fixed What do you think about adding a BUG_ON(in_atomic()) in crypto_ablkcipher_setkey() ? Thanks From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757912AbbEWMSN (ORCPT ); Sat, 23 May 2015 08:18:13 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:34712 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbbEWMSK (ORCPT ); Sat, 23 May 2015 08:18:10 -0400 Message-ID: <55606FFE.4000902@gmail.com> Date: Sat, 23 May 2015 14:18:06 +0200 From: Corentin LABBE User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: herbert@gondor.apana.org.au CC: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, maxime.ripard@free-electrons.com, linux@arm.linux.org.uk, davem@davemloft.net, akpm@linux-foundation.org, gregkh@linuxfoundation.org, mchehab@osg.samsung.com, joe@perches.com, tj@kernel.org, arnd@arndb.de, boris.brezillon@free-electrons.com, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [linux-sunxi] Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator References: <1431608341-10936-1-git-send-email-clabbe.montjoie@gmail.com> <1431608341-10936-5-git-send-email-clabbe.montjoie@gmail.com> <20150515064932.GB16704@gondor.apana.org.au> In-Reply-To: <20150515064932.GB16704@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/05/2015 08:49, Herbert Xu a écrit : > On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote: >> >> + err = crypto_ablkcipher_setkey(op->fallback, kkey, op->keylen); >> + if (err != 0) { >> + dev_err(ss->dev, "Cannot set key on fallback\n"); >> + return -EINVAL; >> + } > > You cannot call setkey from an atomic context. The easiest solution > is to call setkey in your setkey function instead. > > Cheers, > Fixed What do you think about adding a BUG_ON(in_atomic()) in crypto_ablkcipher_setkey() ? Thanks