Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1552769pxb; Sat, 16 Apr 2022 12:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAM8psEs8YWP3ghraGJBdoQfgKn2iHpql3xbAVMvIdhsNaoFHeIvjL+ZqY4+k+7kpyPMlr X-Received: by 2002:a05:6402:909:b0:415:cdbf:4748 with SMTP id g9-20020a056402090900b00415cdbf4748mr4834238edz.395.1650136809880; Sat, 16 Apr 2022 12:20:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650136809; cv=pass; d=google.com; s=arc-20160816; b=MeYO5r/XHz14ivNfKTQPcl/7gm3Yho3wSJ+TeMHj4CyjJJA6wEibNoGceXDs3EH1oX UV3CcbJfd7JpvwOlhGGhBaj2Ue55X1z7vk/sueos4ea0aR6G88pSjb23tV08bbreBguY FdWgOtkiG+2ctQV5d8wgIuS6v7G1jlxP0G9NCRgjyEFZIFytPvYmBdHkaiJlx7MEZaay pPcNdYVi9VaRXvp7IxTzYDMSXDBgaLr+xI7mRTpJLc08i5x0S7IYSxtz2hDAYXG9+9nA WAnI58UAdLV9Tu7ueUQ10xo6wA/zOWNzaJqmh3wf//2ZUhotlbpjLnRqfPWXPq32rI+6 Zldw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=8H7OBOT62TTy3jmQ0qj+dQO049uJWturoCGaVIze8Jc=; b=sJlJodjCpprB1S1LEJP9HVUv/dul3UxjUtvzDF8eZp35drhHudS76BEecOTH4niO7u wQ3LHc8h0hxy9NnOR2QpLCTfh/wnEYQzqgjRbtf2UOChjj/1ytjK4j27xw1JpXF34qyj TmTHOKvCv/mShlGrvuEcPD07p0FDjAQft3ztjvZRWN012NFO4Uauoapns7BAQztVL4N5 Lrx1aaUSApHrmDQyBc6JDeglf/gprK092vP5g7RDvfBoaavn0CdRXgXB7V7VQBoznuir /TdrHKtH+kina+iK71ue1Q6eyAgsrS1Q/aQDUYHXfamSSZlETH4TBrjisgiL+cn5XUCq vbWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=SLuA6EHP; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m23-20020a509317000000b00420fff231a3si3737294eda.160.2022.04.16.12.19.16; Sat, 16 Apr 2022 12:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=SLuA6EHP; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S232744AbiDPSHt (ORCPT + 99 others); Sat, 16 Apr 2022 14:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232742AbiDPSHt (ORCPT ); Sat, 16 Apr 2022 14:07:49 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10067.outbound.protection.outlook.com [40.107.1.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD5D31E3DA for ; Sat, 16 Apr 2022 11:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AKe5VCUakikyFtZCCyyp9/VMdc6pYK2XhGV9TkM+8iIvojPXevNIxf47mzx56r1Tum6N4VC9SL4SnyS4FutPSgLcfe9uaRWqn86yczEhBq4gGfrRHSYn4ZWvVnc5UhFCGKmm/nl9cfMuR1+oUKLnCJDzdxrGERAYKiUTkF74pUaL3zw2Oif3uWQSlquJ6+YRtXAv+cDf0JgRgZaaqnhO7tNj5bIWn7Qo2o6rZ1pZaKu4fph2NKaOD3Y+xmVmBiTVguTAL6czWs1/h1aW/IbSgq2QiQ25Fq8Xpc8i0I24mIeaFEXAO85RzgAbCFyjIWtBYg9Uzl8skJ6D7YnfEPUH/g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8H7OBOT62TTy3jmQ0qj+dQO049uJWturoCGaVIze8Jc=; b=d/w9L2RXcc1OtwWuX6tEeT0okxOqwpxcDvJoP91hfdKtLbcW72pdJ3jGgk3LWhhOiOjd6OvD03vBnJdfH4XuQ2RtjOH1qxReiQ38OVEbCqZZyPH5aexaRHZlTLsHrBCbCbOXFmed2l6I65aK2uZ4NS2u40PUxjQTUj10OihVuG5JMzHlRQ7e14hYRAA5yjFeJMisu7ju6U2Ufk56N66VaMD+27aGzG5fIGqTmWLWfGkIIJMdnz73gyqzg60YkT59+He0YaXYngVO0d8DGNFYHDwlZf5ajZJh7NiuwfFHK82+/FdJFj8l8SSkc9zM5ebjmIi80eSj7vrpX6XnaUVtFw== 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=8H7OBOT62TTy3jmQ0qj+dQO049uJWturoCGaVIze8Jc=; b=SLuA6EHPODuLQWE6n7+qs3rVJsPTXKm0NNKyj73Sdb7As0VQZ0VY2WjBZ7taV2qI3k+W3N6LdcZVdwxovCjLCed4rqxgxIW0nZ2r9b4UPBVD4xyaYc2wdu8ashm7OSQn+RN/XWGwmy/vpUtyfyAi52F4VbnVh4HVVdKEHOQGiJc= Received: from AM9PR04MB8211.eurprd04.prod.outlook.com (2603:10a6:20b:3ea::17) by AM9PR04MB8571.eurprd04.prod.outlook.com (2603:10a6:20b:436::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Sat, 16 Apr 2022 18:05:13 +0000 Received: from AM9PR04MB8211.eurprd04.prod.outlook.com ([fe80::653a:305c:1f26:a34e]) by AM9PR04MB8211.eurprd04.prod.outlook.com ([fe80::653a:305c:1f26:a34e%4]) with mapi id 15.20.5144.032; Sat, 16 Apr 2022 18:05:13 +0000 From: Varun Sethi To: Fabio Estevam , Herbert Xu CC: Horia Geanta , Gaurav Jain , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Fabio Estevam Subject: RE: [EXT] Re: [PATCH v2] crypto: caam - fix i.MX6SX entropy delay value Thread-Topic: [EXT] Re: [PATCH v2] crypto: caam - fix i.MX6SX entropy delay value Thread-Index: AQHYUZ8HpNXIDc264ki1mBi+NAHyrazy1IzA Date: Sat, 16 Apr 2022 18:05:13 +0000 Message-ID: References: <20220416135412.4109213-1-festevam@gmail.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 24ef953d-4c4b-4e93-efd7-08da1fd3a75a x-ms-traffictypediagnostic: AM9PR04MB8571:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ymBJD1xyCE2UjsEONAkOCor4YePqcJmdTN0sD9d17q+QLghOppU5jZR4wnh1losAWNEOghxDri5U6y+laKWv1V2Arzf1cLTJDSl0MOeFfG6Ns/fojGzO/8ccBK6hndCNaWm1ROpz9CgR5PENJ0bH1vuiwJ/jpJCJkvo9XmMQ/oZAyvmjqbClltcKH745sFpnbWKp1zzA/pItUqhHqBrNk/l4EOu61e64DlWF0UT6OPptnEdwvTdrmlWBLxE8z6wuH4i7Wbor91oB72z8WENE5vusvnxZaFLuR57K8opmuuNQd6XdMCgxKAargvEEL9q0AduOtFINdnztgj+AKmMKfoLJXkWr/vJD9VHqEBEEleWmyiKv/aRcd80krSLwfKD2YDqSbFBEoY7ldsEssntWMMxpAAlzWSVU6dK7v5A3lNE/PAWczYCrwO+oTIRTI59E+nItdd1jsb3EHR6dV+lADNxLmXEoUvZAnAA4Ca+ElZTLlc+krdRXTSjaLUa00+JaeFfhWFUQ9UHMogHPUiEseJDHRk12u3DICsrcSQltQ58bKhia9eYWkUMtbeUI3ZyOdSgegjdwV7f8szSjO6c2jNZdKd6mGklLQCQKse0dPyWvIBRgq+RM9g+lSVOPHT1T2KTYTD8tYVwGsRPNsmBc/mqIVommJfC3yKIZXWszc3v8ptkL+ObyuazFMfA6YPjKdWfSqFcgX1XVPBpK1dx41FjShstGokTaRV6vUaHy6AyxYNhxJYspo0rclKVBzMLUUI3kN6777H6DvhYxjk2QeJqoDcUAmgBF4wF3+tjFfpYry3So5sY6kVssimW2xHXj/aOceMfYAxECgkLXaG6bHQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8211.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(45080400002)(54906003)(8936002)(4326008)(508600001)(52536014)(8676002)(7696005)(966005)(83380400001)(5660300002)(38070700005)(86362001)(316002)(110136005)(71200400001)(76116006)(66476007)(66556008)(66446008)(66946007)(64756008)(33656002)(9686003)(122000001)(6506007)(2906002)(26005)(186003)(38100700002)(55236004)(53546011)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Yx2c7vimkpU0Lm7oDP3vK1su2giUjMyBoBzF/97Eem89gD8TQ5J7d1R3Rn9B?= =?us-ascii?Q?py4OkNhviU4p4GbMKdysPqtEykQ5e1FV1US82r5k9TQiwVDIGx1yhO7DyJu6?= =?us-ascii?Q?QghvuPtLXifs4Hthb7GLZ6FKV8k9BwJjTLkIfRL91hiAOPhNcjmOYg2SPd+F?= =?us-ascii?Q?r56RwqIhDgLYX95210eqGqpaKjir1wHKUsCchU5F5oWXp1m+s3FdUvlTmlOH?= =?us-ascii?Q?Feke7hHph3thjRHfVUlzbNEVjxssyyW8Ky/Y/l4luyUORfqwyNUOF2NvI00W?= =?us-ascii?Q?W2INo55t2wTQbxkFPKh2QeJD1Ewb9l/3tixoFdijmN4fnFuviHyyukPOCpPT?= =?us-ascii?Q?o+WfT/9CHFYBpSTnnHPD/xOflFYfPdY1QIaUFBMOkT4YcoLg7Bj8taVhlvJU?= =?us-ascii?Q?pf+HBAXg3uqI9VA4gmY0eIN4ZoZyJ548tvK1CIAGxVrjVow8hSsNov7/puwj?= =?us-ascii?Q?jgSMg+jXgfZG5uGyWtigY/AEcuPjzdcyObxQ87dpPZx9x+tCY0SBqNVtmJAf?= =?us-ascii?Q?C4u7PMF8msxHFuc6ZzXKZJK+NPOj0NHRgon7f5RUlY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vE4VWhEe6GOf/Hru+ML6qLUD0XQ/BMdOThroL2R/gWW3qymtNT9wKV?= =?us-ascii?Q?g7Irvpba8QFSe0Pctc8YV+VK1f6nk6D8dAikLCppLrQ1rutTgBzapKW4wnSP?= =?us-ascii?Q?QgXBuBlHFgfyYVB3AeIYfqeIST8Y20yjoJv+WDQSN5RHs5Yx3aZTcp/h3rtm?= =?us-ascii?Q?qgz9yiDBmH9BSd8Zk6/nz3vYgJoYJOOKQeYoYyczpKWil+KuR/rvdiK2lYO+?= =?us-ascii?Q?2k/jaiLrQGEGwLk9C6yQHDAHFlFGZZi1P9Dqyg6ummn0HQFs?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8211.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24ef953d-4c4b-4e93-efd7-08da1fd3a75a X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2022 18:05:13.2037 (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: XOt96e7RgaTDrVbkNOPFzBPW4wtRbBvVGobiXkDsFH8xN41/9L7GDsZCE+tM2hId X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8571 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Fabio, Just responded to the patch posted by you. For i.MX6D I will check with the= hardware IP team. As mentioned in the earlier thread we will be passing th= e entropy delay value via device tree property. Regards Varun > -----Original Message----- > From: Fabio Estevam > Sent: Saturday, April 16, 2022 8:04 PM > To: Herbert Xu > Cc: Horia Geanta ; Gaurav Jain > ; Varun Sethi ; open list:HARDWARE > RANDOM NUMBER GENERATOR CORE ; Fabio > Estevam > Subject: [EXT] Re: [PATCH v2] crypto: caam - fix i.MX6SX entropy delay va= lue >=20 > Caution: EXT Email >=20 > Hi Horia and Varun, >=20 > On Sat, Apr 16, 2022 at 10:54 AM Fabio Estevam wrote= : > > > > From: Fabio Estevam > > > > Since commit 358ba762d9f1 ("crypto: caam - enable prediction > > resistance in HRWNG") the following CAAM errors can be seen on i.MX6SX: > > > > caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG: Hardware error > > hwrng: no data available > > caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG: Hardware error > > ... > > > > This error is due to an incorrect entropy delay for i.MX6SX. > > > > Fix it by increasing the minimum entropy delay for i.MX6SX as done in > > U-Boot: > > https://eur01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpat= c > > > hwork.ozlabs.org%2Fproject%2Fuboot%2Fpatch%2F20220415111049.2565744- > 1- > > > gaurav.jain%40nxp.com%2F&data=3D04%7C01%7CV.Sethi%40nxp.com%7C9 > 6c829 > > > a14c394eb5e20508da1fb62811%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0 > %7C1% > > > 7C637857164474600314%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM > DAiLCJQI > > > joiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=3DjKZQyH0q > Z50 > > rZhRV6%2FtOgkacpQZ9pZnwo6dLEkMUARs%3D&reserved=3D0 > > > > Signed-off-by: Fabio Estevam > > --- > > Change since v1: > > - Align the fix with U-Boot. >=20 > Actually, after thinking more about it, I realize that this issue is not = i.MX6SX > specific as I have seen reports of the same failures on i.MX6D as well. >=20 > Would it make sense to fix it like this instead? >=20 > --- a/drivers/crypto/caam/regs.h > +++ b/drivers/crypto/caam/regs.h > @@ -516,7 +516,7 @@ struct rng4tst { > }; > #define RTSDCTL_ENT_DLY_SHIFT 16 > #define RTSDCTL_ENT_DLY_MASK (0xffff << RTSDCTL_ENT_DLY_SHIFT) - > #define RTSDCTL_ENT_DLY_MIN 3200 > +#define RTSDCTL_ENT_DLY_MIN 12000 > #define RTSDCTL_ENT_DLY_MAX 12800 > u32 rtsdctl; /* seed control register */ > union { >=20 > Any drawbacks in using this generic approach? >=20 > Please advise.