Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp733055imm; Fri, 8 Jun 2018 04:30:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIWv8hs9g5EB9t+9xMKrlcFejxblVbFAzsPI2mwzPuPZ0xwH0sbgg1jR1vyv5xzva++1u4i X-Received: by 2002:a17:902:b48f:: with SMTP id y15-v6mr6244063plr.261.1528457419331; Fri, 08 Jun 2018 04:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528457419; cv=none; d=google.com; s=arc-20160816; b=kpJty6d8mYImEvpRxyhsEUaxVDKcRgysGeFMo7ngcLThOg2qdQQv+0YLhVB806Vtyu HwtX3PV7J6qKTwM82CpbEWGO2sBifJ6O81pWLLrTKebh/RAmKYSJWpONs1p9EH903wfx bwBLZo/JFmYfuU7dBsgILlEilVJcXrlMDAHQIyYll3FsYMcotT45mW5EHUkM1knicEwp D5lFgGx5Y36IovC80qY01h1FWSgxin4txrxU+oSEeZ5hT6hJZyWYaDfNQvi58rq0bNqC fXT32ntkqPkZIE3rkFyFSC0HyDhhCmkH5kgRkyW04o0L/tS39ihvsK2a3C5E7TUPXFAU /EAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OHDzssc6IQS33Vgpo5N5myowHmy6qw3n8Nt8ExOrf9E=; b=adoMKrdJ2ef2D40ajWDwJw3POwTj4l5Vep4g+GXmNsath2+UenxReg/jPKBPao4TmO SXIHs4jJsOm9BFPbTy0sa1CVwQFRxstdaLWuXXW8lnhgy2uQU1iWT2hHjNtoXOIffecU Vj/glm4bVUsrsMNfRRKVolvG0Z1TYKmHS5LMh2DObO/xtunbVZzQK9UgTjNn1bOBYwBs WO/DGwAtJvdmmSw1URNnSJAmEG0y/4uqfMXClNBzX7hkavG3rRcWV2ox4V96VSOZyiun q6n5WMRz1+p5+dZUdX/rvywj/47floHjBp9hvYAdfQu7WSd1+ozzCSfcZ9Ydh9MEXZw3 YicQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F/gESEU8; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si2418373pgs.181.2018.06.08.04.30.04; Fri, 08 Jun 2018 04:30:19 -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; dkim=pass header.i=@linaro.org header.s=google header.b=F/gESEU8; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbeFHL3D (ORCPT + 99 others); Fri, 8 Jun 2018 07:29:03 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33095 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751485AbeFHL3B (ORCPT ); Fri, 8 Jun 2018 07:29:01 -0400 Received: by mail-wm0-f65.google.com with SMTP id z6-v6so6743342wma.0 for ; Fri, 08 Jun 2018 04:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OHDzssc6IQS33Vgpo5N5myowHmy6qw3n8Nt8ExOrf9E=; b=F/gESEU8vWQMXETaWFjcdCmi1ExozPs71shczoqlX2DryXU8qZ5+rYJOg2sByE4ISp PD3ln8ifR3FfYeYVYuf3Uk4dOWlGm/eiAMNbZJg16rwGoXO+x6YPKRShvVULz8/YS0gG D4+EJGz+79sQgTm1ewcfMSYlBne57VB/1bDfs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OHDzssc6IQS33Vgpo5N5myowHmy6qw3n8Nt8ExOrf9E=; b=HChhquE1zMxMexEkFmt7zEjuqLtyvUo8lCcty4PfOTLuKO634xoeZKr486Q7fZz2Du O3ULQiJZOljos9te0G0bsBF91b9LBUmYPhBNdel7atBQAMA0mwsNtkRkFWRMj0l0DRod hA1LYb9IDsIFEoYvuKp6WiEJ2+vBiG82r6fdM8kY8f0bldcRO6toRZ62MEaO/vwVWYJh qelcrICggkqprx9wx43PiiamI6p5HeINW+fN9w3CsrZ10d0wIadDMqRYJqgKPEtCAlN+ s82ZFsNrRmjjX55hh/YFQUrZJ/SdFgh8VYUkcDMUk5Yp7BsZ0uDPbN9bG8+ntbWqGz8F iFlw== X-Gm-Message-State: APt69E3uM5HVUHA77rifcZSHuvf6bCGjQjFZtLptsFbf8PYal4pxGkEO ZFjo5NpwqDVIRGKqCpKcWNawpSdeRUk= X-Received: by 2002:a1c:bf43:: with SMTP id p64-v6mr1229016wmf.71.1528457340461; Fri, 08 Jun 2018 04:29:00 -0700 (PDT) Received: from [192.168.1.100] (aig34-1-88-167-228-121.fbx.proxad.net. [88.167.228.121]) by smtp.gmail.com with ESMTPSA id n7-v6sm39816574wri.27.2018.06.08.04.28.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 04:28:59 -0700 (PDT) Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests To: Petr Mladek Cc: Andy Shevchenko , Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , Linux Kernel Mailing List 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> <20180608112230.77zsd5y7we7hiqei@pathway.suse.cz> From: Thierry Escande Message-ID: <5484aaf1-ec14-0013-c2c1-fcb3e95b975d@linaro.org> Date: Fri, 8 Jun 2018 13:28:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180608112230.77zsd5y7we7hiqei@pathway.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/2018 13:22, Petr Mladek wrote: > 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. Agree but even with crng_ready() public we would have to block the test until it's ready which is not good either. Accepting "(ptrval)" as a valid result seems the least bad alternative... Regards, Thierry