Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp725806imm; Fri, 8 Jun 2018 04:23:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKS0VtKkmNkj949i7HndpXP8pV80NoxJjHYfAjKHOwHUgnTEybYFEu1Db5IMnA2UuNx7RBN X-Received: by 2002:a62:5004:: with SMTP id e4-v6mr5549810pfb.71.1528456990471; Fri, 08 Jun 2018 04:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528456990; cv=none; d=google.com; s=arc-20160816; b=Ew27hrYuksGeeq+64j82VtIlJEdBXrWIT2j8b2xsEgrQAxpBtxppvWoqlkicR+4dML oqy2AKuXBpd+12sXpTRNEFZmJ7492peyMHT9XLLVDPW+ZBSPy+piRQYkdGbHtFyC5Jab OXgP41E2EanT2M3smRiDsDoV6TLOgLtI9mfV6nkChARIgHVfNqfApDCkD1wj6zbNeMVd lwCevI7naUtcRRG+b+OSQn6IQBnV7n49g5E3QqfDlwtL0VAZf6H8fJLjpK8L6gEOrJm/ WuO8/Obm+0wthB1akkqZ5FS+OnviPltuUI1haqmvAK/LLraUC2p3z1v8dQxff6VgXW/o rZAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DzQqspIUFc+4CJr5agxb8ZkW3nNZKUnZmH/RI9ijwOg=; b=tLdIXSZA5QlPckCtt2AkkisY3oZ6FZvQbo4rjAv2HA0wrm2oHWQL9b0uN7173egQ9D rQHhT4hBDT/aAC4CRTIBQLkwTqE3s+VgdURfk71rWNqKLAI7xPef7SrmDRt2JrcT1Cdf wPRaaJ9QvWJAEfVcYCJ+ZTwn3i2i8F43vpbuejXbK+YKFkev/DYmFxwu6yAUShlaROz3 5rWm39d655TuMAk1xl4qb8nEzBA04W99zlfhTi4jg7gFixz9WGhrQxqQ87tplTVmHQKM ID5fEZHUQAU3PJaQzHHovN4IiFCYSxqf7Z7Cr9QCt9aTsb53zU7hnJlBKtETuZQntRlb QCjw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12-v6si34324995pgc.134.2018.06.08.04.22.55; Fri, 08 Jun 2018 04:23:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbeFHLWe (ORCPT + 99 others); Fri, 8 Jun 2018 07:22:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:37380 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbeFHLWd (ORCPT ); Fri, 8 Jun 2018 07:22:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0B12DAC7D; Fri, 8 Jun 2018 11:22:32 +0000 (UTC) Date: Fri, 8 Jun 2018 13:22:30 +0200 From: Petr Mladek To: Thierry Escande Cc: Andy Shevchenko , Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , Linux Kernel Mailing List Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Message-ID: <20180608112230.77zsd5y7we7hiqei@pathway.suse.cz> References: <20180604113708.11554-1-thierry.escande@linaro.org> <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> <20180608080437.n2b5nv73d3kp6yhb@pathway.suse.cz> <0fa30e13-c16f-95d8-d1ef-fd45e7a99888@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2018-06-08 12:32:33, Thierry Escande wrote: > On 08/06/2018 11:46, Andy Shevchenko wrote: > > On Fri, Jun 8, 2018 at 12:07 PM, Thierry Escande > > wrote: > > > > > But as I type I realize it's not necessary. I will simply enclose the call > > > to wait_for_random_bytes() by #if IS_MODULE() #endif so it gets called only > > > if built as a module, which is how run_kselftest.sh wants it... If > > > test_printf is compiled built-in and the crng is not yet initialized the > > > test will fail anyway so there is no need to add an extra check. > > > > Unfortunately I can't support this as is. > > We have environments where crng will be ready minutes after the boot. > > It's unacceptable. > > > > So, we need to have means to not delay test for so long. > > I agree we can't delay test execution for too long. In my case the crng is > ready only a few seconds after the boot. So we may just skip this plain 'p' > printf test if crng is not ready then. Alternative solution would be to accept const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)"; as a valid result. It would make sense to print some warning in that case. In each case, it would look ugly to use add_random_ready_callback() wihtout passing a callback. If you really needed to check crng_ready(), it would be better to make it public. Best Regards, Petr