Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2838492rwb; Mon, 19 Sep 2022 10:41:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JV1moIxOhiJHHzHH1FTmvnb4ZILd0FnYaP6yMhnqp0JPoX7qnHHpgkS1CJ0SbLBxgptWO X-Received: by 2002:a17:906:4fce:b0:780:e1d8:eacc with SMTP id i14-20020a1709064fce00b00780e1d8eaccmr8742430ejw.366.1663609317118; Mon, 19 Sep 2022 10:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663609317; cv=none; d=google.com; s=arc-20160816; b=05NxjV/P9xoWgL5CCm+XsINWQ3BaB44K6Wic+EuAgfy3kdIXhwyZf1FNuy1oYOY0KM XyCVsF3oZaHZIw2/X1qxcO90sPJmU4v/lgYgiji3lNxx1Y06S3rdqXepA5PK8zRqtIbc /IM7NJrhY1Dd9P1PdpMs8uAwoWTmWW8zXxn4P1UQPULMYTrCzy0MxkUTHtsy57lF7B8q 0zkDExm5TUQOBOoA+oF4swRhe39smMKz3lAk5XZcDa2SZDh1MOh8bFkJsOi2Qq9ryu7M H+C6/1dTOmeQuMD4vbtxKLREbwxQGSk5IKL32Dcti9megRlBE7wppmnM0/08vQnIh/SX CUyQ== 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=dRf0ty06/uotKyN1jAoSPPbSnVAvm0buWGfL71jirrE=; b=QwImUbDccrUEtVE3q+md+J8TYwB5Q6mloN+CObNo7pbRbVL6h1KwzA0t0u6uJOudax YRn4s3lb1nM8TSCr5StpdDcITlFhkiqEzYY0UiXwHE+mpOkDoq7GTenXLqTLjDc82Psc jW00IA2YQOLNw9CqmvouwzWDAlQmlDoKob8aq1Kfye3x9DPhYvzyXtkADgewXDQ8KfnW Tb4cVvEYdc8Jm1eudSz9vNzLCzAFJoCKWo6W8KwyKn71Zz6n7evEraD1PAIrZld068ub O5PAhjpy7+64KbbpTei0a6UQ82Uk/i5OYWuXQJZ56CfuvEQ8JEiwVsyejgua4aOZvorm w5ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="RC/Vi3Kc"; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl1-20020a1709073c8100b0077ef3eece57si21603040ejc.144.2022.09.19.10.41.21; Mon, 19 Sep 2022 10:41:57 -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=@chromium.org header.s=google header.b="RC/Vi3Kc"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbiISRT5 (ORCPT + 99 others); Mon, 19 Sep 2022 13:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbiISRTz (ORCPT ); Mon, 19 Sep 2022 13:19:55 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66681658D for ; Mon, 19 Sep 2022 10:19:53 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id a8so47979908lff.13 for ; Mon, 19 Sep 2022 10:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=dRf0ty06/uotKyN1jAoSPPbSnVAvm0buWGfL71jirrE=; b=RC/Vi3Kc9McNRFaLh5HLy+9shoIAOcCiokeINHvd0TsUg1EChRhJCYFS3Nf3K+9Q7G fvg0JgltwdUiR9FsG9L97XUYl6DR6T2vKj56jFI86zKWmD3c4bw/C1KoPyJ0dLxbYWUW m6ST2MtAyJxyFlVpsgSOXIzQ3pV7NTOo4sSqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=dRf0ty06/uotKyN1jAoSPPbSnVAvm0buWGfL71jirrE=; b=0wkNtYyJkbHjzVT46dZbbjhAV4eYOC3EU5OXKFnCcOA0qvNRSjJrgwOki3VMWc8V0L NgH+Jnu95wZo3jXEoEB3g+0f+Dg/f1rD+PjirMUkovcWEOoHwNA2oltx0NfldMvLjF5x M2CNiX0hwo9UwvEysmZcmbgqSS5GEkvzZhm7S59S2BIHj4VFcyQPj1Hw7W1Xcz978+Ln R0ZvnnT+6vAPfXLHaNdQAiy6sHroOF4lvv3GHScp/66XIk6GaeYF/Rlynt5okNc20mN0 9NmS0PCGSLl2bsEZY++eZ/kFkgnWTh0wziQ/a0E+Ngl7uxnwx3SFBJCl5JvSLqe+jj7G DDBw== X-Gm-Message-State: ACrzQf0duhET/LD8FVXzkH5s5BYr1m+6c5dbRhPO1wul0D2SGGJCYrzy nNZiA7WHVs+xStDiSvxCzR0+K7/tUl69MHIaz14= X-Received: by 2002:a05:6512:22c7:b0:49f:c780:4886 with SMTP id g7-20020a05651222c700b0049fc7804886mr945356lfu.389.1663607992323; Mon, 19 Sep 2022 10:19:52 -0700 (PDT) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id s9-20020ac25c49000000b0049493c14b17sm5264131lfp.181.2022.09.19.10.19.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 10:19:52 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id h3so26299978lja.1 for ; Mon, 19 Sep 2022 10:19:51 -0700 (PDT) X-Received: by 2002:a05:651c:178d:b0:261:bd23:a5f8 with SMTP id bn13-20020a05651c178d00b00261bd23a5f8mr5202580ljb.411.1663607990563; Mon, 19 Sep 2022 10:19:50 -0700 (PDT) MIME-Version: 1.0 References: <20220915002235.v2.1.I7c0a79e9b3c52584f5b637fde5f1d6f807605806@changeid> In-Reply-To: From: Sven van Ashbrook Date: Mon, 19 Sep 2022 13:19:39 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] random: move add_hwgenerator_randomness()'s wait outside function To: "Jason A. Donenfeld" Cc: Dominik Brodowski , Peter Huewe , Jarkko Sakkinen , LKML , Herbert Xu , Olivia Mackall , Alex Levin , Andrey Pronin , Stephen Boyd , Rajat Jain , Eric Biggers , Petr Mladek , Sebastian Andrzej Siewior , "Theodore Ts'o" , linux-crypto@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 On Mon, Sep 19, 2022 at 11:06 AM Jason A. Donenfeld wrote: > > By the way, there was a recent ath9k patch that kind of went to a > similar tune. [...] Maybe that's a potential solution here, or > something similar to it. Jason was kind enough to point me to the patch in question: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=36cb6494429bd64b27b7ff8b4af56f8e526da2b4 This patch limits the long sleep inside the fillfn kthread, by terminating the sleep on hwrng_unregister(). This doesn't appear like a viable approach for the suspend/resume issue? - there is a great multitude of tpm_msleep()/msleep() calls in the tpm's rng_get_data() path. They would all have to be made interruptible. - even if interrupted successfully, now the kthread must be blocked until after resume. If so, what is the point of using a non-freezable kthread.