From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xhhTg1zWHzDq5m for ; Wed, 30 Aug 2017 07:24:07 +1000 (AEST) Message-ID: <1504041817.2358.32.camel@kernel.crashing.org> Subject: Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine From: Benjamin Herrenschmidt To: Dan Streetman , Haren Myneni Cc: Michael Ellerman , Herbert Xu , Linux Crypto Mailing List , "linuxppc-dev@lists.ozlabs.org" , mikey@neuling.org, suka@us.ibm.com, Ram Pai , npiggin@gmail.com, Haren Myneni Date: Wed, 30 Aug 2017 07:23:37 +1000 In-Reply-To: References: <1500699702.23205.8.camel@hbabu-laptop> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2017-08-29 at 09:58 -0400, Dan Streetman wrote: > > + > > + ret = -EINVAL; > > + if (coproc && coproc->vas.rxwin) { > > + wmem->txwin = nx842_alloc_txwin(coproc); > > this is wrong. the workmem is scratch memory that's valid only for > the duration of a single operation. > > do you actually need a txwin per crypto transform? or do you need a > txwin per coprocessor? or txwin per processor? either per-coproc or > per-cpu should be created at driver init and held separately > (globally) instead of a per-transform txwin. I really don't see why > you would need a txwin per transform, because the coproc should not > care how many different transforms there are. We should only need a single window for the whole kernel really, plus one per user process who wants direct access but that's not relevant here. Cheers, Ben.