Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2733366pxa; Tue, 25 Aug 2020 01:28:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHoEBeM+GIiywcKdDfQ2nTD5dLbXjUCBLUwH5b3nU0fXCSu36abTmZRQn3+uq9foFo7toW X-Received: by 2002:a17:907:2115:: with SMTP id qn21mr9183200ejb.241.1598344100816; Tue, 25 Aug 2020 01:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598344100; cv=none; d=google.com; s=arc-20160816; b=Ga12zsPWa3lMSbsu37diIR9/uhytRq8Bu2aaTSd9y6vcCajy2X/fHuKW80klEvqJz9 cuNul+s4+7ekJZ83r6xNPJ7M/icOx2OQ5o7I20uGUCwge6Rm+vkPy8uJ77qDc3fMUz8a HmCOdL1+l9DXDCUuy3wXhmG3bdmRQFgT6dwRHb9JlQTrCCWie8JKXLAKwd+YnyH8Ky32 WscN9QqCYNmjVY+A9jdiw9gIULyqEdx/g2pKiN+aoJ3bABtdPUi5UWV/m+Qqtb7lwBG8 80Cc6IaFyNsfYF12Ld5WeM5wtHO7DQhxBPI6EgnJtSNKRkcttgrbrXPIE66iTI8OJf6K 8D7g== 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=fEcm0/mWZVF6Q0LDNpH3ElgXvSjjwXFdNhIuG7jVALc=; b=GxnJdbNHnJ1/IzpFVP0uemgJhZzib7dz0pf5x0YI9nFmHCa/Zc+4vzWqakbtjoKJQ0 X5OWa0Lf1MIFQGG3mVr79IMGh/P8qrHMJmCVKYiKGVRyqP0pQP/T2HrccjrALGrwhsNx ZWprlkhaxejTuBgOT/CxLDzAlbWJk8do4xIYt2Luy15PHkAAfc8UvQ4s72aCDx6kPsb/ wOeyyAQLX7e0gqlaOH55lFu+Bmsdh/zYwNw1umk67fjhhnLthuDS49gQ+nknV+t1S8OX tURgQqP+NoAlxSqw6ZyhOwGPY1Xt7aUl7SI2BekNBFefOfRRCjiDLCUTOx45jmKyV0dv nGjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XW04ofRE; 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 w4si8440045eji.586.2020.08.25.01.27.54; Tue, 25 Aug 2020 01:28:20 -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=XW04ofRE; 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 S1728087AbgHYIZC (ORCPT + 99 others); Tue, 25 Aug 2020 04:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgHYIZB (ORCPT ); Tue, 25 Aug 2020 04:25:01 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F62C061574 for ; Tue, 25 Aug 2020 01:25:01 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id e14so6694720ybf.4 for ; Tue, 25 Aug 2020 01:25:01 -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=fEcm0/mWZVF6Q0LDNpH3ElgXvSjjwXFdNhIuG7jVALc=; b=XW04ofREcAJ0Ifn2Bx7ghqwZAJ6eYmpee02p+fHpWpSGPwdzonQ2HVri24wjPThXbK b8CalkQUcbT1dLkm/ttkJI8kwYMeLls/wQquKAkriwB48QLs49r1UtkPgbbiDTy5leZK MnLat1prRh7M/jV7kvUmAd3j8gJVuU1Q9NmDlVAtbmFwPouf3xmpj9/6YTJvf9c5bMeg 8JVp2Lc2k6fYhyPizYbPteRi2C9pEuTwQ3TKo/MMo0U6336im6GAiEtKVziqsKFzdIHB lAXa9X27lnNGPYr/NaXodYlZb3RkKnSwKoov4qq/TWpM9DkbilL9esC1vBkOiPRz+4Eh YOfA== 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=fEcm0/mWZVF6Q0LDNpH3ElgXvSjjwXFdNhIuG7jVALc=; b=ORNikDjESHwnLQdzEoZ2g/exMGfRkrJ2ZSmQWuUq6MPcFCDp+sY00Zvlrg3adfqZjC xn+k1eZ7srlHbEptAoI12ZaSLH794gjqAGM2jGL5gpQEqWuvCe0n3A6Co902O9RI420Q QimrtuYgZUf2t2tewin64sumgGl8+XLy9L4IaYsPUU6PLHg66B2ld96+K2AKs7VYaPrF O5pWZQfY55dySFSqG/S4qTfv6Xcq9A6l2Zi/j0OmeCYlU2jYJNCJaNpa6Y/+Z/zitFkQ pA919C7AyejyfJARCKuUfaKJnxFLD7QUu/mTaQX0yWr3gqI73ZJbzuGiLsVNk9pVj8ba CK5A== X-Gm-Message-State: AOAM530iUwVnIuJMawzmNLom+T6hBuhQEZ+f5fU4dj7PrC6FFYOiCxFl fhyYC+WRsuM/dV3+HI9YAeowGG7L5LmfHziUhC4= X-Received: by 2002:a5b:308:: with SMTP id j8mr12132440ybp.185.1598343900508; Tue, 25 Aug 2020 01:25:00 -0700 (PDT) MIME-Version: 1.0 References: <1598243612-4627-1-git-send-email-wgong@codeaurora.org> <2d6362ce85956d0f7df2e596b89a7028@codeaurora.org> <663fbb682fd8df555b2964d7d86b8eca@codeaurora.org> In-Reply-To: <663fbb682fd8df555b2964d7d86b8eca@codeaurora.org> From: Krishna Chaitanya Date: Tue, 25 Aug 2020 13:54:49 +0530 Message-ID: Subject: Re: [PATCH v2] ath10k: add flag to protect napi operation to avoid dead loop hang for SDIO To: Wen Gong Cc: ath10k , linux-wireless 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 Tue, Aug 25, 2020 at 9:11 AM Wen Gong wrote: > > On 2020-08-24 19:15, Krishna Chaitanya wrote: > > On Mon, Aug 24, 2020 at 4:15 PM Wen Gong wrote: > >> > >> On 2020-08-24 18:03, Krishna Chaitanya wrote: > >> > On Mon, Aug 24, 2020 at 3:10 PM Wen Gong wrote: > >> >> > >> >> On 2020-08-24 16:35, Krishna Chaitanya wrote: > >> >> > On Mon, Aug 24, 2020 at 10:03 AM Wen Gong wrote: > >> >> >> > >> >> >> It happened "Kernel panic - not syncing: hung_task: blocked tasks" > >> >> >> when > >> >> >> test simulate crash and ifconfig down/rmmod meanwhile. > >> >> >> > >> >> ... > >> >> >> > >> >> >> #ifdef CONFIG_PM > >> >> > Even though your DUT is SDIO based we should be doing this in general > >> >> > for all, no? > >> >> > core_restart + hif_stop is common to all. > >> >> this patch does not have core_restart. > >> > I was referring to the combination which is causing the issue. > >> > > >> >> I dit not hit the issue for others bus(PCIe,SNOC...), so I can not > >> >> change them with a > >> >> assumption they also have this issue. > >> > But that doesn't make sense, the combination is being hit for others > >> > also. > >> > (they should also endup calling napi_disable twice?) or they are using > >> > some other check to avoid this (doesn't appear so from a quick look at > >> > the > >> > code). > >> Because I only use SDIO, I did not use others BUS, so I did not hit > >> the > >> issue > >> on other BUS. > > I understand, my point was based on the description the issue looks > > independent > > of the BUS type, so, the fix should also be generic. I understand that > > your testing > > is only focused on SDIO, but we should have a generic fix and probably > > use > > communities help to get it tested rather than fixing SDIO only. > I checked the ath10k, only sdio.c, snoc.c, pci.c have used napi. > I think it can change to move the > napi_synchronize/napi_disable/napi_enable from > sido.c/snoc.c/pci.c to ath10k_core.ko as below: > void ath10k_core_napi_enable(struct ath10k *ar) > { > if (!ar->napi_enabled) { > napi_enable(&ar->napi); > ar->napi_enabled = true; > } > } > EXPORT_SYMBOL(ath10k_core_napi_enable); > > void ath10k_core_napi_disable_sync(struct ath10k *ar) > { > if (ar->napi_enabled) { > napi_synchronize(&ar->napi); > napi_disable(&ar->napi); > ar->napi_enabled = false; > } > } > EXPORT_SYMBOL(ath10k_core_napi_disable_sync); > > is it appropriate? > ... Yes, this is perfect. One minor comment you can just do the check initially and return. if (ar->napi_enabled) return