Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1357377pxa; Thu, 20 Aug 2020 09:11:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuI5htU6jSqo6szGp8J6I+7nN8pDG8vXFQ8tJ5o6yFneZ7h5O+qPhMkkJtWUlKvHomnbYf X-Received: by 2002:a50:a165:: with SMTP id 92mr3675121edj.320.1597939900078; Thu, 20 Aug 2020 09:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597939900; cv=none; d=google.com; s=arc-20160816; b=S0OObnWTuiPbm2FxxLa+EokC/aa1iv9BcWtLhgzq4dKVkcTPLdAvVeEunj8f2c03YY F9lgcYpbB7z1Hy731Gvn0VEirXzZzHs+QSn4IXN0k86FRMeQLxu6+9cx773N/Hj6/NJi x6O5J+x89i0L5dc/wEkOy5zO8qHOeNjDm03SgV0Aavli0kBH+NClGlgDWuJ4LQbx1DnX GZvZcDRltzNWVXnx+/pKgVN+RpA6MFnX0DLlGYhvCpeUd7BUC5zbfBMmSpL4o8vCJVeC ufylglpCQ3TJheFpt35HqcrI5vPbgICtFtoU0M4S6NtqUwj+Tpsez2F27qR/48/UGDMp tybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AtcBO8+jAJdjPjcgPPPetiAvLkqAkiE26u0ODAljGk4=; b=xZH/djJMGpeX8ZNTp0qTLdV9GpQiZqc4T4g0e7naN5XBw391ZPnvj0/yLQ3dKNQdGm gMYCdx052dw6w2kH1CcjcO26EPDNLgVY8RSXXMPxFoJ9nasRC3bXq7tvVBnjy7ank3ST 3t4l4lmFvPg0bjPpogNVZZ+v7Ie/eBCHzti1LKYMqKMkzQ1dvr3DAzKx971S50IiTQSY b8ksmWT5CaGnHR9fOkZDJk/RBTgW2TGLDJz4fPFKjx/ohohyykBnPd4hyoHKlrUyQBt3 qtJRFq9kp2mxfxfxOu/fwOHswHzzjcCahSyH5sdGwVb7EQN1Cya48qIa05BhR2FLnLIr /KJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sGdCpKx9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j22si1376697ejx.663.2020.08.20.09.11.14; Thu, 20 Aug 2020 09:11:40 -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=pass header.i=@gmail.com header.s=20161025 header.b=sGdCpKx9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729374AbgHTQJG (ORCPT + 99 others); Thu, 20 Aug 2020 12:09:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729495AbgHTQI4 (ORCPT ); Thu, 20 Aug 2020 12:08:56 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08F51C061385 for ; Thu, 20 Aug 2020 09:08:54 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id g3so1402603ybc.3 for ; Thu, 20 Aug 2020 09:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AtcBO8+jAJdjPjcgPPPetiAvLkqAkiE26u0ODAljGk4=; b=sGdCpKx9bBre+CKL3IeWnMjcmFKkAGjvHrm+g9s3WNBfIO6M1bMEMfMYX2q2gE+R0q A8B6ABPCB3641v7spsX3LKWQOPv3w4jQcbZB+eGz1ZtwkQrOpCDz/M5KDRm8UCGSN6W7 cCB84WNp3wm3QhJg35gXTSGEIBNRvogJS4hG0uzT1i/n8mtYTCbg2rd9KH8++4GZHvZg 8JKPMEy5xii/kk4DbI+m6NmSVaEW/IWUkFNGrRV6qj7FmdU6eCow36M2zCAGh0YHTAuH WOzgu8eOv8uM34JO2pW6W8P6tRAThLwVz4aPQqr9zyyjc5NX8fK4zeNjxo0wUclDIn8j Tfuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AtcBO8+jAJdjPjcgPPPetiAvLkqAkiE26u0ODAljGk4=; b=YWTP+QL9yobfOo24L3u0SmqAOpsLTMJJJ8FaJMfZwuKIcRwGX6MCzMGquGkcDxuU0E ztbx5gb/3EQa9bcLp9e9TUlmGZhj7AmhC/mlPaf6MD8zJpt4UzIJsnEFuLZQyBmI51la pvvBitDHy5RL1i0jCxkbwz8pjvYd3ldG6e+csCAC+KLTEd0L/tHMvghOk+aQVlrVNv/A kWEvFm7EzgCBXZR8Dz73O8F+FyIZ6GSm/c8sBjI/loSqYgeBVQZaC8lkzJYXS088eJ5Q 0LWbWSHqWGihte/P9XPhRUNNjeih1gwwohouRshiKmsb7Lpq5GxmBWxSTN9Px178EtBK zw6w== X-Gm-Message-State: AOAM533GpYZIC0ORasJSLaqNs0Jgk4aPD4/JGb1Pa/YpQgsaXzFEtk33 hXgeMPHKgGdb4aKveaoPKWsNCXmdRmCJLRUvRsJaXVEr X-Received: by 2002:a5b:d12:: with SMTP id y18mr5575597ybp.400.1597939734162; Thu, 20 Aug 2020 09:08:54 -0700 (PDT) MIME-Version: 1.0 References: <20200214035555.24762-1-wgong@codeaurora.org> <878se9iup3.fsf@codeaurora.org> In-Reply-To: From: Krishna Chaitanya Date: Thu, 20 Aug 2020 21:38:41 +0530 Message-ID: Subject: Re: [RFC] ath10k: change to do napi_enable and napi_disable when insmod and rmmod for sdio To: Wen Gong Cc: Kalle Valo , linux-wireless , ath10k Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Aug 20, 2020 at 8:07 PM Wen Gong wrote: > > On 2020-08-20 18:52, Krishna Chaitanya wrote: > > On Thu, Aug 20, 2020 at 3:45 PM Wen Gong wrote: > >> > >> On 2020-08-20 17:19, Krishna Chaitanya wrote: > ... > >> >> I'm not really convinced that this is the right fix, but I'm no NAPI > >> >> expert. Can anyone else help? > >> > Calling napi_disable() twice can lead to hangs, but moving NAPI from > >> > start/stop to > >> > the probe isn't the right approach as the datapath is tied to > >> > start/stop. > >> > > >> > Maybe check the state of NAPI before disable? > >> > > >> > if (test_bit(NAPI_STATE_SCHED, &ar->napi.napi.state)) > >> > napi_disable(&ar->napi) > >> > or maintain napi_state like this > >> > https://patchwork.kernel.org/patch/10249365/ > >> it is better to use above link's patch. > >> napi.state is controlled by napi API, it is better ath10k not know it. > > Sure, but IMHO just canceling the async rx work should solve the issue. > Oh no, canceling the async rx work will not solve this issue, rx worker > ath10k_rx_indication_async_work call napi_schedule, after napi_complete, > the NAPI_STATE_SCHED will clear. > The issue of this patch is because 2 thread called to hif_stop and > NAPI_STATE_SCHED not clear. That fix is still valid and good to have. ndev_stop being called twice is typical scenarios (stop vs rmmod), so just checking the netdev_flags for IFF_UP and returning from hif_Stop should suffice, no?