From patchwork Wed Jun 13 12:01:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michael_B=C3=BCsch?= X-Patchwork-Id: 10462115 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39FF660329 for ; Wed, 13 Jun 2018 12:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25D7628958 for ; Wed, 13 Jun 2018 12:02:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1966028962; Wed, 13 Jun 2018 12:02:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, FROM_EXCESS_BASE64, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A287528958 for ; Wed, 13 Jun 2018 12:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935365AbeFMMCh (ORCPT ); Wed, 13 Jun 2018 08:02:37 -0400 Received: from bues.ch ([80.190.117.144]:52414 "EHLO bues.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935360AbeFMMCg (ORCPT ); Wed, 13 Jun 2018 08:02:36 -0400 Received: by bues.ch with esmtpsa (Exim 4.89) (envelope-from ) id 1fT4To-0001Vu-LB; Wed, 13 Jun 2018 14:02:24 +0200 Date: Wed, 13 Jun 2018 14:01:48 +0200 From: Michael =?UTF-8?B?QsO8c2No?= To: Wirz Cc: linux-wireless , b43-dev@lists.infradead.org, Matt Mackall , Herbert Xu , linux-crypto@vger.kernel.org Subject: Re: b43 crashes on rmmod (bcm4331) Message-ID: <20180613140148.1b57a566@wiggum> In-Reply-To: <20180613130905.420695e7@wiggum> References: <75e4b424-4c75-5abd-1ef0-c2537d329b10@lukas-wirz.de> <20180609171159.59b5209c@wiggum> <6a78c68e-1062-5ad8-876c-f7d4c49ea492@lukas-wirz.de> <20180609220130.3ceb834f@wiggum> <20180611224634.28ccd288@wiggum> <7d564b8b-2b71-73f6-3ae7-ede0187a4151@lukas-wirz.de> <20180613122751.2fe89737@wiggum> <538cd7b7-8d63-1795-7bfc-69231d2bf3c0@lukas-wirz.de> <20180613130905.420695e7@wiggum> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 13 Jun 2018 13:09:05 +0200 Michael Büsch wrote: > On Wed, 13 Jun 2018 14:01:53 +0300 > Wirz wrote: > > > > CONFIG_B43_HWRNG completely switches off hwrng support in b43. > > > I don't see how a change in hwrng core could still lead to a crash in > > > b43 with this option switched off. > > > > > > What do you mean by "manually in the .config"? > > > > What I meant is, that I have outcommented the line 'CONFIG_B43_HWRNG=y' > > in .config. > > > > > Can you try to properly switch off the setting with make menuconfig and > > > then recompile everything from scratch (make clean)? > > > > I was intending to do that before, but I cannot find the option for > > that. Searching for b43_hwrng in menuconfig only shows the dependencies > > of that option, and the Kconfig file where it is defined, but not the > > path in menuconfig. Do I indirectly set CONFIG_B43_HWRNG through the > > parameters it depends on? I'm sorry, but this is obviously above my > > level of expertise ... > > Whoops, sorry. You are right. This is an automatic config option. > That also means your manual editing of .config would be overridden. > > You can edit drivers/net/wireless/broadcom/b43/Kconfig > go to the section config B43_HWRNG > and change 'default y' to 'default n' > > That should disable it. Could you please also try the attached patch? There seems to be a problem in hwrng core in that it does not disable the current RNG, if the new RNG fails to initialize. I don't know if that's the problem here, though. diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 91bb98c42a1c..aaf9e5afaad4 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -516,11 +516,18 @@ EXPORT_SYMBOL_GPL(hwrng_register); void hwrng_unregister(struct hwrng *rng) { + int err; + mutex_lock(&rng_mutex); list_del(&rng->list); - if (current_rng == rng) - enable_best_rng(); + if (current_rng == rng) { + err = enable_best_rng(); + if (err) { + drop_current_rng(); + cur_rng_set_by_user = 0; + } + } if (list_empty(&rng_list)) { mutex_unlock(&rng_mutex);