From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753898AbbETTin (ORCPT ); Wed, 20 May 2015 15:38:43 -0400 Received: from mail.eperm.de ([89.247.134.16]:58047 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbbETTil (ORCPT ); Wed, 20 May 2015 15:38:41 -0400 From: Stephan Mueller To: Herbert Xu Cc: pebolle@tiscali.nl, andreas.steffen@strongswan.org, tytso@mit.edu, sandyinchina@gmail.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v7 1/5] random: Blocking API for accessing nonblocking_pool Date: Wed, 20 May 2015 21:38:38 +0200 Message-ID: <1985784.azciXBjbjY@tachyon.chronox.de> User-Agent: KMail/4.14.7 (Linux/3.19.7-200.fc21.x86_64; KDE/4.14.7; x86_64; ; ) In-Reply-To: <3555912.bTyystq8tU@tachyon.chronox.de> References: <1693038.ndeE0L22jl@tachyon.chronox.de> <20150520184535.GA15438@gondor.apana.org.au> <3555912.bTyystq8tU@tachyon.chronox.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 20. Mai 2015, 20:49:45 schrieb Stephan Mueller: Hi Herbert, > > This is just a convoluted way of doing an uninterruptible sleep. > > Either make it uninterruptible or allow the function to return > > an error. > > Sorry, I overlooked the availability of wait_event. I was looking for it > initially, but missed it. I will fix it right away. After checking a bit more, I see that an uninterruptible sleep cannot be canceled with cancel_work_sync. Therefore, replacing it with wait_event does not work. Thus, go get an uninterruptible sleep which yet can be canceled seems to require wait_event_interruptible together with the check for ERESTARTSYS. Nonetheless, I move the loop out to the DRBG code as requested. -- Ciao Stephan