Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp926303ybl; Wed, 8 Jan 2020 08:08:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyFpDoRpKxRRIFHE0X8cb6OOw/hUgsOO5R5pQiMHXP72BLnE6ukoUqyPzrxh8VbxVs0Kqew X-Received: by 2002:aca:5490:: with SMTP id i138mr3781469oib.34.1578499738681; Wed, 08 Jan 2020 08:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578499738; cv=none; d=google.com; s=arc-20160816; b=uKjpcxi2e93uTzwK9EDVnFr7snUz21YJgSgc5sqFM8JM0QIZ+sBQS5l8oRmCPderSB a9EF3S7QU3fRtxJ9pSidrLu4YshyCEGK0GcucytoV9iwn0YDGjv+y4k3wlziwMvnV3Ph iWojZeiXI48ylbZ40g09DNgViceJqnsyFF+fk0p45ly/d+0dxTOaWoIc5mmFeJcEfZ3Q OhA9MlkiaN87FhYlCbVf76O2D0/t9sWYBDt6J4wix0z41/T1vOpoHqaO0vHdYaCnCdVM uXV/jqluLD6rIUaaI6b4oE0X/K9eNpGQF8ZT/YoORbC5kz2LW9Xd7Bp4M+xaS3p8dvbX lGJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0N3N55mKu7D6d7h9hmn6IsvaDLGUWysqQq54G06xnmc=; b=YmzLHSzcbmsARQLOK5mXKnDFgsYm09KOtF8f7JAd9se0PTMU4Uh6uH+Riay8wpDuJt XrqLWDCDbmfCR0pGZgiKqRgpULNydVuDKayuHs6dglunV0YIkOZSocbbq5ItTQ9kDfh3 BjuSRzR4PdU+JfDC60tD4n/rg4QrW2rzvs3dxUNsl0m+xmyz1wn2lZCVC2OLTKEzl/Ef q8UEcguw946SkwKBQmEVecHgJImi6MyXtaxfFO+tTYNUe2i/CZanIEPZz55YMjqr0CMw k6pBZDkFTrlF0cvbpsFRpN8qluTvG0x01YNCh21H1vuvBFVf/XfcBTtiaLb4e3M6AMeF 6dkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uEShmPzw; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f203si2083878oib.56.2020.01.08.08.08.37; Wed, 08 Jan 2020 08:08:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uEShmPzw; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbgAHPu0 (ORCPT + 99 others); Wed, 8 Jan 2020 10:50:26 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45844 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726186AbgAHPu0 (ORCPT ); Wed, 8 Jan 2020 10:50:26 -0500 Received: by mail-wr1-f67.google.com with SMTP id j42so3841922wrj.12; Wed, 08 Jan 2020 07:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0N3N55mKu7D6d7h9hmn6IsvaDLGUWysqQq54G06xnmc=; b=uEShmPzw5xgcVfK3GcKJ1pcAbUUKIEsRASYH9i+gdlGVyVcjN/bjZt8ucd4xpTahK6 glwEk3CBwPVEP34eMIfafPiylQFDJd7Ee75Er8GaCG0KEfZpuynSACF69GFFom7n499C uQslmQ7fcLEVWISoJY2nFAJNc/282zr360qcqlhazBJBXjVoawMpqJW6jC0zOLV9MDXa EPuF3iAtAPF2sCwRpZEdnFbml75XX3/6YdRh2iSR+mdI/WXQKIkTUj4BrMocvw6GmbsX 8plbDRm4oHg/3sCv9OkAsPM/6HY18h0R28eeMwKk5ty2UYPaXCcJj7MvTj03fR6BP4HK Zh/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0N3N55mKu7D6d7h9hmn6IsvaDLGUWysqQq54G06xnmc=; b=gYpO2GtInG8wYMJwWMQZam20NhqumYmtwjxrQ40UUkbLqfbLUHd56pkLWbKh1F4o6z kc6McJiSrxYyEAWOvKxjW86Y8mEnIAUdWPNXLZ/LWqB9yJ/SVPIpijgQF+cz4SChDwXm 4XtgVgW+1zzci3YU+sOpDPuhJ0n0D1Ccq0PHUJqOfVDuYVGI+dL2RZAdCF2MPaYpD1j/ wVuEJhC70ljvbEMGsT4/54t3kd7aHVwTVTXfTmGAGC9XwCKOdOxAmMZ0dqwLq9kD8Wiv g13iLej5R5rJJjjD5ibTWb9kUM/IEgut+0vkSqls3e+b8r7iTDQcdFH8f/Q2fRdNMtR3 UNeg== X-Gm-Message-State: APjAAAWmxCphBSRdbuADFplYmylcLDvkMcFEBbWFLio37+r0Hc3BWIwZ yyKffDSRYvtEn+j87U8ZUUIqvS7nxcSVKUurFXQ= X-Received: by 2002:adf:e78b:: with SMTP id n11mr5355464wrm.10.1578498624011; Wed, 08 Jan 2020 07:50:24 -0800 (PST) MIME-Version: 1.0 References: <20191105151353.6522-1-andrew.smirnov@gmail.com> In-Reply-To: From: Andrey Smirnov Date: Wed, 8 Jan 2020 07:50:12 -0800 Message-ID: Subject: Re: [PATCH 0/5] CAAM JR lifecycle To: Horia Geanta Cc: Vakul Garg , "linux-crypto@vger.kernel.org" , Chris Healy , Lucas Stach , Herbert Xu , Iuliana Prodan , dl-linux-imx , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, Nov 16, 2019 at 10:15 PM Andrey Smirnov wrote: > > On Wed, Nov 13, 2019 at 11:25 AM Andrey Smirnov > wrote: > > > > On Wed, Nov 13, 2019 at 10:57 AM Horia Geanta wrote: > > > > > > On 11/6/2019 5:19 PM, Andrey Smirnov wrote: > > > > On Tue, Nov 5, 2019 at 11:27 PM Vakul Garg wrote: > > > >> > > > >> > > > >> > > > >>> -----Original Message----- > > > >>> From: linux-crypto-owner@vger.kernel.org > > >>> owner@vger.kernel.org> On Behalf Of Andrey Smirnov > > > >>> Sent: Tuesday, November 5, 2019 8:44 PM > > > >>> To: linux-crypto@vger.kernel.org > > > >>> Cc: Andrey Smirnov ; Chris Healy > > > >>> ; Lucas Stach ; Horia Geanta > > > >>> ; Herbert Xu ; > > > >>> Iuliana Prodan ; dl-linux-imx > > >>> imx@nxp.com>; linux-kernel@vger.kernel.org > > > >>> Subject: [PATCH 0/5] CAAM JR lifecycle > > > >>> > > > >>> Everyone: > > > >>> > > > >>> This series is a different approach to addressing the issues brought up in > > > >>> [discussion]. This time the proposition is to get away from creating per-JR > > > >>> platfrom device, move all of the underlying code into caam.ko and disable > > > >>> manual binding/unbinding of the CAAM device via sysfs. Note that this series > > > >>> is a rough cut intented to gauge if this approach could be acceptable for > > > >>> upstreaming. > > > >>> > > > >>> Thanks, > > > >>> Andrey Smirnov > > > >>> > > > >>> [discussion] lore.kernel.org/lkml/20190904023515.7107-13- > > > >>> andrew.smirnov@gmail.com > > > >>> > > > >>> Andrey Smirnov (5): > > > >>> crypto: caam - use static initialization > > > >>> crypto: caam - introduce caam_jr_cbk > > > >>> crypto: caam - convert JR API to use struct caam_drv_private_jr > > > >>> crypto: caam - do not create a platform devices for JRs > > > >>> crypto: caam - disable CAAM's bind/unbind attributes > > > >>> > > > >> > > > >> To access caam jobrings from DPDK (user space drivers), we unbind job-ring's platform device from the kernel. > > > >> What would be the alternate way to enable job ring drivers in user space? > > > >> > > > > > > > > Wouldn't either building your kernel with > > > > CONFIG_CRYPTO_DEV_FSL_CAAM_JR=n (this series doesn't handle that right > > > > currently due to being a rough cut) or disabling specific/all JRs via > > > > DT accomplish the same goal? > > > > > > > It's not a 1:1 match, the ability to move a ring to user space / VM etc. > > > *dynamically* goes away. > > > > > > > Wouldn't it be possible to do that dynamically using DT overlays? That > > is "modprobe -r caam; ; modprobe caam"? > > > > Or, alternatively, could adding a module parameter, say "jr_mask", to > limit JRs controlled by the driver cover dynamic use case? > Horia, could you please comment on the above? I think getting rid of struct device for JRs is the best approach to dealing with described corner case problems + it will allows us to get rid of this custom JR users lifecycle management https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/crypto/caam/jr.c?h=v5.4.8#n26 since it can be just done as a part for caam_probe(), so I'd like to either move forward on this series or close this discussion. Thanks, Andrey Smirnov