Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1597683pxb; Sat, 16 Apr 2022 14:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzao62++DxrtqJwQfauhpMnpv2BefYo8nOUDKUwfAHB7YcyD4C03kGX99W+h+rsV8TLo2zT X-Received: by 2002:a17:90a:ba13:b0:1cb:6296:ce41 with SMTP id s19-20020a17090aba1300b001cb6296ce41mr5493624pjr.104.1650143648985; Sat, 16 Apr 2022 14:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650143648; cv=none; d=google.com; s=arc-20160816; b=ynPGu9OTkzMyZAreCm54c4jqNB++tiHh0EmrjjC655SBoQvV4rHlwDqwnCcqIF0SNd H2TLrFdpSweIkbuiK1ba3YZgrS29ELjz6jdhXGXzcSROsp4udCgi2aApfaWwCIr7ksy/ GSAtO5m30BCXDXZ9RkQH5bxvlt6TCyKFf7yazRJWWqFcg06w5rW1Zc9ept35mIvGWwNH EwGYj8EQQ+tmzxbb66zY4XSPHhUBTmlgyYAn3EWAUVG6Jtjz7aw90Qo49Svae3wOvdbE AfI4lZwqubP6/evZsxDGldfIgmc4vb4uvTcJ+AvfzG4KYB6nGfr8fI8fqVcR7mhbGxem Axvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tqjBkilQU4/PdTDZWQ+UTomQZExWyaCh/YDiUIu/GK4=; b=knkbm32OLHDelDu6Y3p5mrCHX5A/0/HDfQMwiwTwrenOslcRUEY0LjFbpLGfeDoNDo 0NGktfk8toFPc9CdJnoufQGr+w2QihL6vlmy7rrbInAOYK5QQq8nVEFE7BAUHugAORZs zHWbRADSj+Kpap53y9nsyIJsbMs3xl5cYkFENQSEPrKsPNRqm1zTAWBhrn4ty84zc7CB 9FyGz6TTf6sCglT3rG3sd0Fhh10vr55dQu03yK76c3I177u9y+iVyD9czibDPw0+gnmf cvzmYOqWnCF/9R2rQGgCv/GDYwyFDRGZ+7PIq6xaxOGa3M2bGo7H5OFgCLnmzl32KNym 8m7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TtJHMZjJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a056a0014d100b004fa8a817638si4919053pfu.283.2022.04.16.14.13.31; Sat, 16 Apr 2022 14:14:08 -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=@gmail.com header.s=20210112 header.b=TtJHMZjJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232316AbiDPOgj (ORCPT + 99 others); Sat, 16 Apr 2022 10:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231469AbiDPOgh (ORCPT ); Sat, 16 Apr 2022 10:36:37 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E5FA496AB for ; Sat, 16 Apr 2022 07:34:05 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id u18so12920645eda.3 for ; Sat, 16 Apr 2022 07:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tqjBkilQU4/PdTDZWQ+UTomQZExWyaCh/YDiUIu/GK4=; b=TtJHMZjJUqWZ8runjgNUOpr4dITWJRHLP6WMMarHjVPZWQxReNhtcclP2YlABPMIyk oXtf4FrXGTCbYfQgCJWiMvM0x4ahlBy5/6y1FMQPYg854mH6EB64mqhFjnul7TD79fPp x7wGMwb8hPRoNmKGgmw9YIH6BXBR/IbnqhhUkPoW0ZBdb30IKunR0hArxGHVAVXwSqKH TpHIbpoO7Fyn7QDCO0ViClRDKswUhKNVNwIOEbnkIaK/c7SAqpJtDReTJurlg6V/gijP jNLaMlD6o2L4Eem5jOcqQ1K0n0ugzGVoeQ5A1RNvhr3IL3almJBa0y2lutf+34b5WPxq Ko4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tqjBkilQU4/PdTDZWQ+UTomQZExWyaCh/YDiUIu/GK4=; b=1jgZrh2s9r8ngEbvvyHvQqXx97f8pyqzoqsKRbPWO32znc6AO4puDVFoEKrVUqa9gX gkku2974G1oPn0Azv0jZwl1Pt899cYsACxAkaNZ2zfH7SpNE9t1RS07VKIKfK/PV5zGQ njCAeZixcfjnTfk9UepUL9SE7P5hSPJ6rQKkAWaHEtvK7T5I2XNGc+NPqS4+B9080N9p uRs4NB6ApHPx8Pduq5jD4y+/mgo2PStFVwvZ7FG6fZzdRzw0WBpdY9VuiMBrPa8EVUPO b6x+GFoDgSh7/awchSpoivP5L7bsT/wNLo3RgeTcPXjljcQLyCp5OIg8LqiAocAv/K50 SQWg== X-Gm-Message-State: AOAM533k5C/fzZ/U7/0F3a2XrDRHh3Lg5RraFW3HrQ/xuv9jGpQEOljx WSzJa+hjcBx5kde5ZLuoohb18XEg1r+rSp2lN5u1tOXtMrY= X-Received: by 2002:a05:6402:11cf:b0:41c:dbc7:79d2 with SMTP id j15-20020a05640211cf00b0041cdbc779d2mr4091457edw.50.1650119643786; Sat, 16 Apr 2022 07:34:03 -0700 (PDT) MIME-Version: 1.0 References: <20220416135412.4109213-1-festevam@gmail.com> In-Reply-To: <20220416135412.4109213-1-festevam@gmail.com> From: Fabio Estevam Date: Sat, 16 Apr 2022 11:33:53 -0300 Message-ID: Subject: Re: [PATCH v2] crypto: caam - fix i.MX6SX entropy delay value To: Herbert Xu Cc: Horia Geanta Neag , Gaurav Jain , Varun Sethi , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Fabio Estevam Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Horia and Varun, 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://patchwork.ozlabs.org/project/uboot/patch/20220415111049.2565744-1-gaurav.jain@nxp.com/ > > Signed-off-by: Fabio Estevam > --- > Change since v1: > - Align the fix with U-Boot. 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. Would it make sense to fix it like this instead? --- 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 { Any drawbacks in using this generic approach? Please advise.