Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp362749lqo; Wed, 15 May 2024 18:06:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0FYKOB55cNsVSkB7oP+Z7DgcPZF50XBBu92MZX+y64TPL0ZhBbUlXvAVU0wfuYu8OX1XXX0UMZvS6zllHir0PHEwF1FDVRBz9kG3Meg== X-Google-Smtp-Source: AGHT+IHn3+qIZ8pewPtrguDhpuMQ++9Q1i8+MZH2O4SQd+ypE6LGjFM6VHL/aQSXKCgLX5VZDBnl X-Received: by 2002:a05:6358:5926:b0:186:12cb:d1a8 with SMTP id e5c5f4694b2df-193bcfe35damr2024193655d.25.1715821607366; Wed, 15 May 2024 18:06:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715821607; cv=pass; d=google.com; s=arc-20160816; b=FFC/thb9cIODnkh4Pfhgpx9dIR4JuSc5o2u6dgK79vshrOvRrijMKbL5tJHXwDcHl2 vqpPFsQYaQT/xzypYIzVp9U5hiwTvHI7bmeQtsz55PnFoPKb+wpUX/+u75iFEKBDg3HB vxg1eUbVCbQZyQ6b4zH2/cEGEDWTPOM0144ygV3XTB88eEfD1Tmgm/EIBZRbtrDgcsCJ 9HHAQ/xcOkuJXcSiCXC1Midvr33u19C7smMJdImkGW5S/m29Va1f4n4XYKDTGQPkGGUU zJ4guRWn3GCa/jdGbfpXkItPBISRyMjAcjwgFHnkHfDQHpYKrjhhYDpLVPl8gzlzwm7k 3ctg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=QJClC+6WzxyR+x/of3D+2g2KGiCN9dKIFtkmnvUL3Cw=; fh=sj/XGO0KrP8bjM6okLag312LJGscRiHYb7yjo14ECiA=; b=dF+dwJroa2sHHqWJgdj1MrkM8YqKyKLDAsaXwLDBRToNvKylY9J2TzpPzhn4DBDaWl aOxRIWEi2uR0vAzWQZSzL0qJ1O1xIyUa7su6RM2Mxam2HDbpc978L1mtDSvH/RFeMWk6 fTryv67tQbTKLeeV0cqeLHp31d1IIHY12PrFg2MccDIxBgLJ6l3LyvR3SsSKJkhD2cui hKp4evKEq9wwOOyK+XQj4ol+HUzneEeAi5YAZV9tz4H8e4nQZWT5hWNAbtUiVjjmkTnd 554Pzf6ivXqE9Jw2COeyBAuuPBis6dFtzFEciGnihn+G+eZbWHvunXpHiY3ueQy7gRBo 4KvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=p1poIYCK; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-657df567e09si1271632a12.877.2024.05.15.18.06.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 18:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=p1poIYCK; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 61BDB283E6D for ; Thu, 16 May 2024 01:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1C82EBB; Thu, 16 May 2024 01:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="p1poIYCK" X-Original-To: linux-crypto@vger.kernel.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 058BA64F; Thu, 16 May 2024 01:06:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715821602; cv=none; b=tLjvw4pMR9ccKmQjpD0zPRsAY2/HjMo7FNeEL3HI1i9Op9gL8J21lU6FKdZlzxS+3fh73nXSS1kt5hhGioi00AE0k5Zpd+RK0/nD4lhAm42BDJqG6rDV9lhWCdXSe7x+YYH1qQktzBrvfOU0pOINZQsTaOZO0B/O9xC+o+eD9uM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715821602; c=relaxed/simple; bh=Ze1dhFWsVKgWjnGEy9izfq9xur0ir6qH0Ued8hrIwtM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ai8001XfKtmV0FLY6EZjzrxRDOjCifoFTRmelEy1dWasPpXeIqEuD4SQ1mI+KOs8KicTXZqrJdSV1G6dKimpHXN4CZpbFjlPXdJph9iHutj0+uaC/kQP1Saw7rpLxWcSNqrFXaNubE1TJCP+/9vViIe8TYCj0BDPo2fpf+gFTXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=p1poIYCK; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 5A66788315; Thu, 16 May 2024 03:06:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1715821599; bh=QJClC+6WzxyR+x/of3D+2g2KGiCN9dKIFtkmnvUL3Cw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=p1poIYCKox4lkyXS2IuXta+JnRamo/j5s20s1kPHFSGHMeU/w/JGI/aDqrnf2+WRB cuPlPE/OqHJY7v+agA0rfVl5d9pxqY/c21A7AkoBq3SUoRitIgGFo0iT1+76rdJxco pyFutT1/YvNBk/2Y9/9ZLjVtFpvPCOxoWEkoO3VC9Uinm3ulTLANE5P/ZdBs4yvzwZ rv5e24kdEu7Z4uCmxSI8I/pFIiADoLJuqNzG4voJOOecqSBoHfNiDzQAkacrl0w7+0 RoNFyXfWrfmUtt/2uogkqKsb2ahoLZDJOr8JGAIYJiqhY0Abn34+eIYzFeM402C2/m fPkPJaV0ssqNg== Message-ID: <3257e8f8-5bb0-4c75-a3a3-e5685b65de2a@denx.de> Date: Thu, 16 May 2024 03:06:35 +0200 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [RFC] clk: stm32mp1: Keep RNG1 clock always running To: Gatien CHEVALLIER , linux-crypto@vger.kernel.org Cc: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Alexandre Torgue , Gabriel Fernandez , Herbert Xu , Maxime Coquelin , Michael Turquette , Olivia Mackall , Rob Herring , Stephen Boyd , Yang Yingliang , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20240513220349.183568-1-marex@denx.de> <51951dd4-8e8c-4e67-89f6-6a710022e34f@foss.st.com> Content-Language: en-US From: Marek Vasut In-Reply-To: <51951dd4-8e8c-4e67-89f6-6a710022e34f@foss.st.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 5/15/24 11:16 AM, Gatien CHEVALLIER wrote: Hi, >>> What if you add a trace in a random generation function in random.c? >> >> Do you have a function name or line number for me ? > > I put a trace in _get_random_bytes() in drivers/char/random.c. I'm not > 100% sure but this should be the entry point when getting a random number. You're right, there is a read attempt right before the hang, and __clk_is_enabled() returns 0 in stm32_read_rng() . In fact, it is the pm_runtime_get_sync() which is returning -EACCES instead of zero, and this is currently not checked so the failure is not detected before register access takes place, to register file with clock disabled, which triggers a hard hang. I'll be sending a patch shortly, thanks for this hint ! >>> After this, I'll try to reproduce the issue. >> >> If you have a minute to test it on some ST MP15 board, that would be >> real nice. Thanks ! > > I tried to reproduce the issue you're facing on a STM32MP157C-DK2 no > SCMI on the 6.9-rc7 kernel tag. I uses OP-TEE and TF-A in the bootchain > but this should not have an impact here. > > How did you manage to test using "echo core > /sys/power/pm_test"? > In kernel/power/suspend.c, enter_state(). If the pm_test_level is core, > then an error is fired with the following trace: > "Unsupported test mode for suspend to idle, please choose > none/freezer/devices/platform." Could this be firmware related ? > I've tried using "echo devices > /sys/power/pm_test" so that I can at > least test that the driver is put to sleep then wakes up. I do not > reproduce your issue. Can you try 'processors' ? I did also notice it sometimes takes much longer than a minute to hang, but eventually it does hang. Maybe let it cycle for an hour or a few ? [...] -- Best regards, Marek Vasut