Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6362994iog; Thu, 23 Jun 2022 17:52:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVZuapUFV8b7SbP3esKAfo+oLXpFDLi63/KtaK71bQwYaRQqmIH2ShDd7HfpwAi5GcoL09 X-Received: by 2002:aa7:c542:0:b0:435:75e:8a7b with SMTP id s2-20020aa7c542000000b00435075e8a7bmr14230273edr.108.1656031977121; Thu, 23 Jun 2022 17:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656031977; cv=none; d=google.com; s=arc-20160816; b=jsRY2dijx0bMvLnc+i/QfGhl13M+VmHZODDq1jGIMb0KR33UyeukwdgMfMKgYovdzQ KNMnIrO9kvSWj6uvE6PHTOkXbNCdgPbQPcwXOZ2rvqaLLwxysWVnYYxsCngutxvd3E4N KSOkiDnJyoXiur31ooWX9R/bp3OuH3vSyCVpRLBzIt3HhLPd4rTEmE6gFeWpDTuhvnDn sgbfn6Rr6izwDbX9pkeDOkWzmFgFNdZGGRXAQVuFa9jV/9NwWxgY4fZvLVthwqdU2taZ QSlJ8UK9PiyopCiYTB42k4aTQaQEHOLSJi1iQ6EaQRf8tvVTATRto9mMWTiH966hb9i3 rgyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eRETDEXMTaJXS6JXgAAWaFx9o/OTYX8S4ozCSdOASEw=; b=NlX2AC29LUVeVsthPcuJLW24zsPlwuSSgMZfkPOopLnnB0sTbxwqEb6Q0EANBfE7ZE lydw8TgV42P5Dw6ZoN1CDJRJE0WhBWkY+/d81sDicZk65sVdZPKI7n3oGDnP1Mj0nJHY YoCPM40VjQ8NlAGBJDcZXODFhM0qEFLgGTxtDXSgknh/fNPaX2nNAsWAaYh86nzVg4qR WPZTYa785ORSqZfMoJ8T1iz7d+o/hC+AuVQu/D1Q+RHXgfQNvldpos+RdM1CX72FDC/f zOAQpnpnfVPmt0h00RhL7D9JOykD7Oyc8T9kz119xjCi0LV40zqnGzFjZBDZz6Egdc/B l8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="lbMD9R3/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a056402510900b0043589eba85dsi1589444edd.8.2022.06.23.17.52.21; Thu, 23 Jun 2022 17:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="lbMD9R3/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbiFXAue (ORCPT + 99 others); Thu, 23 Jun 2022 20:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiFXAud (ORCPT ); Thu, 23 Jun 2022 20:50:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 191BF3AA5D; Thu, 23 Jun 2022 17:50:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A706C61FB4; Fri, 24 Jun 2022 00:50:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A133C3411D; Fri, 24 Jun 2022 00:50:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="lbMD9R3/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656031829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eRETDEXMTaJXS6JXgAAWaFx9o/OTYX8S4ozCSdOASEw=; b=lbMD9R3/iYVCGBYSrR7c2EiYGKasiWSlqZPZyF2QWSSVl8zGHv8DNf+ENqoZD9BEUKuJmX YaylpeO5/l8bEXlhWPf/Ij6LH2HMD0DtITZ+n2kduJefOuAZDDQBQrb7fh2QzCnqiWMr5D ++cwQ1eJa1KKMaCNfn7x4mEGBkTjzK8= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b641279a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 24 Jun 2022 00:50:29 +0000 (UTC) Date: Fri, 24 Jun 2022 02:50:26 +0200 From: "Jason A. Donenfeld" To: Gregory Erwin Cc: Rui Salvaterra , Linux Crypto Mailing List , linux-wireless Subject: Re: ath9k: hwrng blocks for several minutes when phy is un-associated Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hey again again, On Fri, Jun 24, 2022 at 02:01:22AM +0200, Jason A. Donenfeld wrote: > Hey again, > > On Fri, Jun 24, 2022 at 1:47 AM Jason A. Donenfeld wrote: > > > > Hey Gregory, > > > > On Fri, Jun 24, 2022 at 1:36 AM Gregory Erwin wrote: > > > > > > No luck. > > > > > > The first patch caused a warning and oops with ath9k_rng_read() at the > > > top of the call stack when reading from /dev/hwrng: > > > WARNING: CPU: 1 PID: 454 at kernel/kthread.c:75 kthread_should_stop+0x2a/0x30 > > > BUG: kernel NULL pointer dereference, address: 0000000000000000 > > > > > > The second didn't have a noticeable effect, for better or worse. > > > > Alright. That's actually getting us somewhere. So the path in question > > here is from reading /dev/hwrng, not from the kthread that's doing the > > same read. > > > > Can you do a `cat /dev/hwrng > /dev/null`, and then do whatever it is > > you do that causes everything to hang, and then while things are hung > > in the bad way, look at the contents of /proc/[the pid of the cat you > > just ran]/stack? > > There's another flow I'm interested in. You said it prevents the > system from sleeping. Does it also make a `ip link set wlan0 down` > hang too? If so, could you send the `/proc/[pid of ip link set > down]/stack ` of a hung ip process? That seems like the more relevant > deadlock to look into. I think I have a plausible theory. I'll send a real patch, and you can test it. Incoming shortly... Jason