Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp318591pxb; Wed, 15 Sep 2021 02:50:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ4VhoR5mhCMyUkpa+rxnV/SuMvEyW8CoYCQDBQK87fcrEnKHdt5pov5aRrof3eA1NlZLA X-Received: by 2002:a5e:8711:: with SMTP id y17mr17289930ioj.16.1631699430593; Wed, 15 Sep 2021 02:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631699430; cv=none; d=google.com; s=arc-20160816; b=qI8X/x12bil5IYxiJU7Ag6M+a0g0LKK0Y2MsUnC8DyMLGg3RfJ6dTD8ZRTIEBBhGu0 DpxpCxfmqtjSF6F5SxFRsyT9Q/Adw+Jk+KO/KVh5FRNf/zUkxz2mBI3U0sgAPTFN6mur kz52gX1JRKndxmkyKUTtxwFUTfSLMWRh6Wqbj8Sij07TSymbjRrcczcy8Uqmc5wJqBQ8 Mm1DeKfyczKW4GqNogQ16JYblBHcTeoYvN3fMWc44i+9wh89tByVp6erFMPED8ZZHzHG 6H+ED+JrXrumlmMXIl5O7wNnInq8sAfgrQX20miUlrmsO/Rhad4BctKSUzwlU39S4KhK bKqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=uBSC+UP9PeMZXmiRRocmqxiy4fu/aY9BBVkaqRDY24Q=; b=MIt0AUd0yQJptZJhxXRCUU/hRTTd3La41GxanZVV1vvXVFeagdhbPO+4rGdCKh1It6 SNG1w+JnLACBjDhwDnWNIVN5iqwcoEVi0wQ5DmF1xjTPYQz/J6P/zeJ1OwsNSqLj4iSl 57sa/kyrU1WtljDw9sJTn/55qVfEvrlM2/DV6wKY9dJY5yaLCV1DJy8T/nZMvQnHccvn 4GQYhFR7oVUmpWM9ugfXmN6aarMQqsMhKuq4bXFKy7aopn6NfCFF0jIhVnQkVi87dKYz El/vBRjrKV39Fnifi6kQLexL//V+G1gOXbum/wb9Xu8ortXnwsMrViNKhsLrBVGNNgf8 c6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=XkYHuvDy; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si15450548ilc.19.2021.09.15.02.50.14; Wed, 15 Sep 2021 02:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=XkYHuvDy; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbhIOJue (ORCPT + 99 others); Wed, 15 Sep 2021 05:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232046AbhIOJuc (ORCPT ); Wed, 15 Sep 2021 05:50:32 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A653FC061574; Wed, 15 Sep 2021 02:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uBSC+UP9PeMZXmiRRocmqxiy4fu/aY9BBVkaqRDY24Q=; b=XkYHuvDygrf6X+nNo7iF5BkJQb gymhJ5QvZuH8mJYuJm5iizimdP0XJl4woKTukUH7EEQ0XkXMwkpQG+n3z+vf6N4QAhAijfeLM8KjU Ii6N2Adtzx6ckx89PMXWTL3zhVPgFnORVzaWa0g+KW/KbybViNK8PBhJOn753y+ZScMQ=; Received: from p57a6f913.dip0.t-ipconnect.de ([87.166.249.19] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1mQRXE-0006CG-Lo; Wed, 15 Sep 2021 11:48:56 +0200 To: =?UTF-8?Q?Linus_L=c3=bcssing?= , Kalle Valo , Sujith Manoharan , ath9k-devel@qca.qualcomm.com Cc: linux-wireless@vger.kernel.org, "David S . Miller" , Jakub Kicinski , "John W . Linville" , Felix Fietkau , Simon Wunderlich , Sven Eckelmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Linus_L=c3=bcssing?= References: <20210914192515.9273-1-linus.luessing@c0d3.blue> <20210914192515.9273-4-linus.luessing@c0d3.blue> From: Felix Fietkau Subject: Re: [PATCH 3/3] ath9k: Fix potential hw interrupt resume during reset Message-ID: <255a49c7-d763-50d9-87e0-da22f4a9b053@nbd.name> Date: Wed, 15 Sep 2021 11:48:55 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210914192515.9273-4-linus.luessing@c0d3.blue> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-09-14 21:25, Linus Lüssing wrote: > From: Linus Lüssing > > There is a small risk of the ath9k hw interrupts being reenabled in the > following way: > > 1) ath_reset_internal() > ... > -> disable_irq() > ... > <- returns > > 2) ath9k_tasklet() > ... > -> ath9k_hw_resume_interrupts() > ... > > 1) ath_reset_internal() continued: > -> tasklet_disable(&sc->intr_tq); (= ath9k_tasklet() off) > > By first disabling the ath9k interrupt there is a small window > afterwards which allows ath9k hw interrupts being reenabled through > the ath9k_tasklet() before we disable this tasklet in > ath_reset_internal(). Leading to having the ath9k hw interrupts enabled > during the reset, which we should avoid. I don't see a way in which interrupts can be re-enabled through the tasklet. disable_irq disables the entire PCI IRQ (not through ath9k hw registers), and they will only be re-enabled by the corresponding enable_irq call. - Felix