From patchwork Fri Jun 16 08:58:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13282335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32240EB64DA for ; Fri, 16 Jun 2023 09:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YXReo7vX0LY9Ag3mj8L2uEDWZfmdeHi0/7ycBIeJdRo=; b=eCk0YXO/WV9oMo BlwwtA5uD2vTBZIXNjOQuWol7CuVD01IFH5TCVUXdr3yuH+UMOIWO+rVUBBejj3jOmTJYgtCevFH3 u0W8Zo0T9fFDU8/x9XFFiw86VLknhep1oqTWqaveoppFAqHJ4HgUam3NxBf5JAhxu6X3w7X4/PfWc Y9S1nnIIUXlz6ReKKRZ/AuQTn6fWuJH7wWOoQH/gO3vRtD2N0vsbCzknQLv8+pCDKEo98HKOg5+pL dUUM/VS6XIwBmOZQywycJamf5MEOoZx/A5eK44GuAI11gifp3jXUTFevyMH81wSuMljMY/x+qhoRT GdX0zDQCHuH5QtPaN+eQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA5Iz-00HO7w-2R; Fri, 16 Jun 2023 08:59:41 +0000 Received: from viti.kaiser.cx ([2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA5Ix-00HO6B-1m for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 08:59:40 +0000 Received: from [167.98.155.120] (helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1qA5It-0000d1-NO; Fri, 16 Jun 2023 10:59:35 +0200 From: Martin Kaiser To: Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 0/2] hwrng: st - fix potential race condition Date: Fri, 16 Jun 2023 09:58:11 +0100 Message-Id: <20230616085813.1323082-1-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230616083618.1320824-1-martin@kaiser.cx> References: <20230616083618.1320824-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_015939_731693_D95BBDA7 X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix a potential race condition in the st-rng driver. There's a short timeframe where the driver is still registered but its peripheral clock is disabled. Add support for compile-testing the driver. I do not have any hardware that supports st-rng. v2: Remove some more obsolete code and rephrase the explanation. The point is that devres does now disable the clock. Martin Kaiser (2): hwrng: st - support compile-testing hwrng: st - keep clock enabled while hwrng is registered drivers/char/hw_random/Kconfig | 2 +- drivers/char/hw_random/st-rng.c | 21 +-------------------- 2 files changed, 2 insertions(+), 21 deletions(-)