Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5328984ybv; Tue, 11 Feb 2020 13:37:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxticzPOCeCpqpSz7HXZfrGBIV5VO5BOIMhxznoDIvaZrB2YQPgQXHEPwgJ77/1sCs7pqBU X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr6700519otr.82.1581457040178; Tue, 11 Feb 2020 13:37:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581457040; cv=pass; d=google.com; s=arc-20160816; b=t5MNo4yJXeGm9IAC7s8GPqgKxyChQ+W7J8ao3HvayU7enPFjGIptI/xfOvt9ZvWNy5 QOY+LemkhzX9aCnQSK3yIpiAJebGm8kK9VJDlGRAlVRBmPa0EWPhS0clLcr6DLrJlON9 0ejEga9gaMCRLQnozVZ7gN/FVBewexoQ/ol5n681VqIn9FtqBeXRWr8Be23brl31tgFX OYaUM8wF0ZtRTPPMMkgdWnIQ9BPjjQVziDSwrS1iLqp7RUi+LQg5nYF8qMO5yBJo7P1R 7kzr/bRZ127pHpFJJexgBj/hk9VgWQExu9OLwW2EHxv1kyXYdiIeJTZB4vhulBuRWBqa OltQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=EorlvC4y/V5Oor8pHisTaW0aW0TqdSVDWI+Bioph3Yo=; b=Sf8MlLcwEz2qQyLBvLrNAE1uIkxYj2W9nXhS0d6JMHEiTtiA/e4hd4kW5jaaQsT9bW GtBSvW/58j1DVlcosTtudFqSk2y676KcKcaFOqbGq3TQib4dfezg+EhB9FkRsogZmduf OhNTnPionl89bQ4HCFkZnQ/ikAUIePbUNJycZU1Vkmuz8nL3KJ1ItaeAqRmSIXJ+A8JX EjcG359thNGEz588/NpbtXkPkAejmtwVTrxbKQtlcNLw1sIYpJJopObERqv0OoOi/usQ k8wnwVf7xE8aaQUSUKoIeyZVLQoiC4I4W3xMkUVh9VU5CT6XihMLWhqDYLb5DyLPX+Tr nXEA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="DYGVY/nK"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si2595712otd.141.2020.02.11.13.37.08; Tue, 11 Feb 2020 13:37:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@nxp.com header.s=selector2 header.b="DYGVY/nK"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730062AbgBKSxq (ORCPT + 99 others); Tue, 11 Feb 2020 13:53:46 -0500 Received: from mail-eopbgr60053.outbound.protection.outlook.com ([40.107.6.53]:56363 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727722AbgBKSxp (ORCPT ); Tue, 11 Feb 2020 13:53:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gbRD19NFMsSzP9pLY6QUA4MvPx3jSf40kuffhXGckrZrrpAhOc6FvPrMg2EFI4diZXLtapgLw58pm2HJqJ9z65bMitRaoiZO/T03kT29E/9aqENYmoFU3pzT/nOTFW0R765VuECq0A1poJOLzmt68RKB9CLXkaAwVwJtl1KBMEfuebHO/Pkqn3sF6G+P42OmkPE+bfZKDF0nh4vubVuoHooxuUafN/qF4QxVVFlloQEevz4JheQzVMUw0CQkcR/HX18D7dnPDJWBAPdv3v03lx+3lx91kj0DLVCd7w09K+OirUmYiAL5UqztcchUJpffZg/NmDtE31R2E920SpRBQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EorlvC4y/V5Oor8pHisTaW0aW0TqdSVDWI+Bioph3Yo=; b=mH0yOTh9U9UjEM17dKUcMA2hrmtto81Gq4p+tpScW2ayQEVj/Xu18N9IBWmu/Tgw6mUiMQE6ej16wk131d7Du9ZmVLa4g0p4dxAwQf/5rl8mE6zfOPAYmXKS0/jIWGZUhIOWBNOTg12NTqQZs5k5DztViDO54XMcpm8ZX3WE6kYp4d2L1eJrfKK7CdUjI1OgUotwYqshKdr9rMH3IfQKuTykD0iTZ9idcf4jT9iy38eQAl6ha2bEYDWe8LgV1N6cZsctJhY2CE9cAwHxourUppl0shPvjkMo4IjofguSALqKkWWWIZ246scPbDH/i/duLgvuYpjCZRm5gxVphjBDMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EorlvC4y/V5Oor8pHisTaW0aW0TqdSVDWI+Bioph3Yo=; b=DYGVY/nKh2YA/tBM2OZsRAVNHMiGUKyH4tVOxLD54Yp0I+EXa+eCg1wOtMtuE3qxwrMqTGJh2Gckej+j+TRfAem2S5nVxPzLVaC//k6f8WTSsoSaAfkxsrjaa7AbFiKHFFQr9AXrZ+93c1T8/WUFsvpH4HkBNtt2gSiZgUdP+oo= Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (52.134.3.153) by VI1PR0402MB3934.eurprd04.prod.outlook.com (52.134.13.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.23; Tue, 11 Feb 2020 18:53:41 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::85e9:f844:f8b0:27d]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::85e9:f844:f8b0:27d%7]) with mapi id 15.20.2707.030; Tue, 11 Feb 2020 18:53:41 +0000 From: Horia Geanta To: Andrey Smirnov , "linux-crypto@vger.kernel.org" CC: Chris Healy , Lucas Stach , Herbert Xu , Iuliana Prodan , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH v7 4/9] crypto: caam - drop global context pointer and init_done Thread-Topic: [PATCH v7 4/9] crypto: caam - drop global context pointer and init_done Thread-Index: AQHV1TLT2rTrmTBv2U6pvLOb9zqi1Q== Date: Tue, 11 Feb 2020 18:53:41 +0000 Message-ID: References: <20200127165646.19806-1-andrew.smirnov@gmail.com> <20200127165646.19806-5-andrew.smirnov@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [84.117.251.185] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 56f65fb0-d8fb-4b37-2ac5-08d7af23b663 x-ms-traffictypediagnostic: VI1PR0402MB3934:|VI1PR0402MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0310C78181 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(136003)(376002)(39860400002)(346002)(396003)(189003)(199004)(55016002)(81156014)(66556008)(8676002)(66446008)(64756008)(81166006)(9686003)(66946007)(6506007)(66476007)(7696005)(53546011)(316002)(44832011)(8936002)(966005)(33656002)(91956017)(5660300002)(71200400001)(110136005)(4326008)(45080400002)(2906002)(54906003)(52536014)(26005)(186003)(76116006)(478600001)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3934;H:VI1PR0402MB3485.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JNQXAY5JE+G+wzGeWEdeGGxfGA/KVYD0xsLpJOGdMzXyJ1ACZp4xD9VPup/fBPKyGuRyyaNtPG++xRCV4QyvKp2yoQlpeui5c37F4tybJh55OUJBUSDJiq0DRFKTInXRB5NIFzZ/zR9lcasjfy//YDff10ig2pHU0VBXTOTIDdyM3A1oG1JX3a5n5BEOkzMb0dAEjRT6P/PTYiW7dMvPCEqxRPEdHgK2JdFchulu7o5oruyNR4q1k12324e9NZRj356QOY5+Cvh47gKkfvnIF/BC1BRinbuOK+TG8M1BszRZl3oSJ6UYaS2M/DrzremaxwJcHeVQAC5hsdydBO5S+beRXM2P88VRlkZQHtDqQJjRdMGaHcoQd2Gq9eeOcYzEEdYV6qwDtx5aJXeBGKRATUeN2IFWcvE9emen63/hwN1UooEqy2KpS2f8CeBaC7HYiRcVPuhjPavQycDNUekGty+3jPjzbKVPW8tIw3Mut51kgh+KqhWLaUbUqF+SqoOW8zxHzzuZ4ktSrfrJuf4ZHA== x-ms-exchange-antispam-messagedata: 5dYm/b+hbjUEpVkLejx6te/NtNqV6JaRP4HhtXviuokB66OVrYQ6hHwqOrqawNnRpiAPSiOCqr/C39u4X3QJ9OtvNhq9a9wSxwIx8PVW27HTDGPTcQEFKJaD0GfXsv0uLrPVc2f5GIhMRlsg2kydzg== Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56f65fb0-d8fb-4b37-2ac5-08d7af23b663 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2020 18:53:41.3134 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9QziBJaFkegC6XDevCZrLFp/2ZuIDdB2QCMCugz6pgenW4QyQmj+QtdGzZ/ewxyNBWiajBdIuGfAu4CQBdmG7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3934 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/27/2020 6:57 PM, Andrey Smirnov wrote:=0A= > Leverage devres to get rid of code storing global context as well as=0A= > init_done flag.=0A= > =0A= > Original code also has a circular deallocation dependency where=0A= > unregister_algs() -> caam_rng_exit() -> caam_jr_free() chain would=0A= > only happen if all of JRs were freed. Fix this by moving=0A= I wouldn't call this a circular dependency.=0A= =0A= I think the discussion & patch here:=0A= https://patchwork.kernel.org/patch/11140741/=0A= https://lore.kernel.org/linux-crypto/VI1PR0402MB34859D108C03F3AB0F64EE6598B= 10@VI1PR0402MB3485.eurprd04.prod.outlook.com/=0A= =0A= describes more accurately the problem:=0A= "The issue in caamrng is actually that caam/jr driver (jr.c) tries to call= =0A= caam_rng_exit() on the last available jr device.=0A= Instead, caam_rng_exit() must be called on the same jr device that=0A= was used during caam_rng_init()."=0A= =0A= > caam_rng_exit() outside of unregister_algs() and doing it specifically=0A= > for JR that instantiated HWRNG.=0A= > =0A= > Signed-off-by: Andrey Smirnov =0A= > Cc: Chris Healy =0A= > Cc: Lucas Stach =0A= > Cc: Horia Geant=E3 =0A= > Cc: Herbert Xu =0A= > Cc: Iuliana Prodan =0A= > Cc: linux-crypto@vger.kernel.org=0A= > Cc: linux-kernel@vger.kernel.org=0A= > Cc: linux-imx@nxp.com=0A= Current patch is similar with the one mentioned above and solves the proble= m.=0A= Thus, with rewording the commit message (and squashing patch 3/9)=0A= you can add my=0A= Reviewed-by: Horia Geant=E3 =0A= =0A= Thanks,=0A= Horia=0A= =0A=