Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2152554ybp; Sat, 12 Oct 2019 05:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOU74Kc5e0qhS5U8VhGemYXQETCfgOYKiE9NhtoukNEZvZS6dciaHmvOUIKo1ewMM2gzlj X-Received: by 2002:a50:ab10:: with SMTP id s16mr18115530edc.118.1570882255859; Sat, 12 Oct 2019 05:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570882255; cv=none; d=google.com; s=arc-20160816; b=tmCioSnp0eftqVwL6SDbC6ziVKxTHtCwzS4LPXHiEpc/zGPHliv2cr6AzLa2xfZfuH A+CC47KoilHTaxUKrbWDQQyC3EYccmnCQplk36ujHnZ/syhawtFsOlc2i8l8bPKKsDkU /k0l4kvDAKZCrKQNT6YfszZoolhYUYHbjeoufYtpYWViYOkve59I6oyEW8/MVSI7UOJ5 uNVnkzu+lrNZpEedoTfRr281o4fNajWFpwHtuaKAfmrEbr5Hb5zTfHVxN42jwaEgatRm r91raL4k/bw72uaKWjIxn99LHGf0ZT2qG0a2quzXBMNcHEnzaPnMhdkH03q5edxjgUWv 432g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dgX2Q1b8+Joj9XEaUqlM9kGddJ0fH9Ku9p/uEHkV6xM=; b=XGbPmSYP0m0odswew/niKJ6Dm+6tKv0uyTNdZUPJqYZkELxxqTXl8Ys9LDCi1fm7rw 3hMLnYTYRj8QCdbjOetKOVyRzd7cISPH/m+mO3Txx7CxYUhM/bixi25y0yEVACfJ1MHe 8BdVwqRAXEZN/a++4xE1+vRcS4FjyGIFwnruQ24MFU6mxm/DfRdRlmFmZhgReM1Rqk4J cGAbV7sF14ofgnWl4Ya4/HPoSOXRnqe2OuoRl1jNDR8zs0nPN5b++4idSjGwgvfs8osm 4EV+r3VfIYwXCJM10YRjqp2k6hQ21AtwXksX3YV9NnXxR225AhoiEji3aqbt6I7av2sF xq0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si7751131ede.380.2019.10.12.05.10.31; Sat, 12 Oct 2019 05:10:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729294AbfJLMJp (ORCPT + 99 others); Sat, 12 Oct 2019 08:09:45 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:46660 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfJLMJo (ORCPT ); Sat, 12 Oct 2019 08:09:44 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1iJGDE-0001Ae-Q3; Sat, 12 Oct 2019 23:09:34 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Sat, 12 Oct 2019 23:09:28 +1100 Date: Sat, 12 Oct 2019 23:09:28 +1100 From: Herbert Xu To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, Matt Mackall , Marek Szyprowski , linux-crypto@vger.kernel.org, 'Linux Samsung SOC' Subject: Re: [PATCH v2] hwrng: core - move add_early_randomness() out of rng_mutex Message-ID: <20191012120928.GA24544@gondor.apana.org.au> References: <20191011134724.28651-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011134724.28651-1-lvivier@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 11, 2019 at 03:47:24PM +0200, Laurent Vivier wrote: > add_early_randomness() is called every time a new rng backend is added > and every time it is set as the current rng provider. > > add_early_randomness() is called from functions locking rng_mutex, > and if it hangs all the hw_random framework hangs: we can't read sysfs, > add or remove a backend. > > This patch moves add_early_randomness() out of the rng_mutex zone. > It only needs the reading_mutex. > > Signed-off-by: Laurent Vivier > --- > > Notes: > v2: in hwrng_register, take rng->ref only if rng is the new current_rng > > drivers/char/hw_random/core.c | 61 +++++++++++++++++++++++++---------- > 1 file changed, 44 insertions(+), 17 deletions(-) Please rebase your patch on top of the cryptodev tree, i.e., make this an incremental patch with a Fixes header. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt