Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1091979ybl; Wed, 29 Jan 2020 15:13:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxe2/c2S3WBUWsuGptD2ig0PA6EBPEnOCgNMiGGZ06yS53kO+XVSbVqzUyXrKYo6ZqFu8vw X-Received: by 2002:aca:398b:: with SMTP id g133mr947203oia.11.1580339633833; Wed, 29 Jan 2020 15:13:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580339633; cv=none; d=google.com; s=arc-20160816; b=BLprLanFcbrzSJq7zNhZIfuk8cHq+5RjOrqkt1CJv2ivY+Bbc0J2H7lSKrP8kO4trM LcutlrsWosZMF24z4AFXK13rNXjMEl5oN9aTYxFbciv3kiKqL+N6GyL8YWylXAYxSyN2 rcWY4Cas9KySZKXjhkNeSg2VbfsaFqjT+8Qrb2ZcBd3iNYBRRzBRMLvBAdElKjFCCdQs f7IbfS/EzcvLjI1GNxmO3QIfMWUV3N+mCuGNB9dY8E1Osz0CWGgk9t/A72PGGpWzj42e Kh2U+yacttFaDvwVoZlTklRuZw/S0SJWSQLUoQHGYA4mR8xx5dGlH4xPv6yoq3mMa9ps JDAA== 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=LCUbrUz7P+ZZOGgq2SEr224JKtlddICvuICcnGrb8wI=; b=BFfyQMneMwvnKD6UNpwAP9NGTG36zoSJto8TwyYZgCI5++CnQPgnrUiCPcSRJbyLFi S3s/7NwiiKrfuPwIaRValtZyYgO7R91et1jxOX4HurC1FJ7WHkgAIdol8mclKs/t6/lE ybb2l2fCrONSjiyUlDmc3F8csT9XrfazCDTT/tzCjgJlbCx/TtaSluu0k/zaA/6TrqWB XxEZCS+BUbEDTJUKXPOIbYulU0U+5L41TiDLKvVZ0vZx4Lc2H5lJ3Mf8r/Gw2RdBv6hN p97kfc/KH4orNyxJ3MnfJamvwFvj8qC6n2Rg4oNvH58ELEJZQeE5MotW9tgrRK1Q0H1x sQIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SdkOg+CG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si2021293oti.33.2020.01.29.15.13.28; Wed, 29 Jan 2020 15:13:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SdkOg+CG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbgA2XNW (ORCPT + 99 others); Wed, 29 Jan 2020 18:13:22 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:37786 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbgA2XNV (ORCPT ); Wed, 29 Jan 2020 18:13:21 -0500 Received: by mail-io1-f65.google.com with SMTP id k24so1801219ioc.4 for ; Wed, 29 Jan 2020 15:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LCUbrUz7P+ZZOGgq2SEr224JKtlddICvuICcnGrb8wI=; b=SdkOg+CGhQWsyghj0M3VcH36oGpO89eNNXRye+lGikf5O5Is0N+RxBrpq/SFFroshF X865+RzEqL7tuwe6qQBrHRSo7IIb3mgnByPT5LO1mkE3R9BlviVxtp3u+QSA2QzOryf4 gVPKzRsEO6gnwep19v1pcG56Mcttgie4MWpj4= 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=LCUbrUz7P+ZZOGgq2SEr224JKtlddICvuICcnGrb8wI=; b=W113lb5Eq7AROPRCIJ6T+HNvejEWM0fNIt5f5iB3JxDbx1SjEuY/k7BkHIEEpuOeB1 QQvL4a5cIDpcKmwl1M1yoF89I/PwLhi4UvxyrlMhjPl6fLHPLivL842McuJfZ8XWcdCy BG5IcUkwiot25bmTSTTPiGlNx7GnUUcsn13vnizM01Z+JB6/hj8g61bojCiYRwL/kLTD GXrzWNX/hA8efX2lxsit1DeaGGBR7KHcD8ncw4iBgH2Euyh9pMt5+O++XxH5SF54vD7a xA3EwnxQqQ5mKDt/77G5EY+5sk8YL1MDR5AqLk4Mk+H8zOVq951XI+LCT3v3nBfGR7xz KZCA== X-Gm-Message-State: APjAAAWKwjfHc/mP3Zn1S1dEmMLPlPqtUu+iIlCweqDW/UBDNiJ/Mm8W OzM9n1vifGZMUlTXtoEsUtGOxtrfk/BdIdg4RzzoSA== X-Received: by 2002:a5e:c907:: with SMTP id z7mr1648711iol.88.1580339600746; Wed, 29 Jan 2020 15:13:20 -0800 (PST) MIME-Version: 1.0 References: <20200128221457.12467-1-linux@roeck-us.net> <20200129000551.GA17256@roeck-us.net> <20200129180428.GA99393@google.com> In-Reply-To: <20200129180428.GA99393@google.com> From: Franky Lin Date: Wed, 29 Jan 2020 15:12:54 -0800 Message-ID: Subject: Re: [PATCH] brcmfmac: abort and release host after error To: Brian Norris Cc: Guenter Roeck , Doug Anderson , Kalle Valo , Arend van Spriel , Hante Meuleman , Chi-Hsien Lin , Dan Carpenter , linux-wireless , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , brcm80211-dev-list , netdev , LKML , Matthias Kaehlcke 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 Wed, Jan 29, 2020 at 10:04 AM Brian Norris wrote: > > Hi Franky, > > [I'm very unfamiliar with this driver, but I had the same questions as > Guenter, I think:] > > On Tue, Jan 28, 2020 at 04:57:59PM -0800, Franky Lin wrote: > > On Tue, Jan 28, 2020 at 4:05 PM Guenter Roeck wrote: > > > On Tue, Jan 28, 2020 at 03:14:45PM -0800, Doug Anderson wrote: > > > > On Tue, Jan 28, 2020 at 2:15 PM Guenter Roeck wrote: > > > > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > > > > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > > > > > @@ -1938,6 +1938,8 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) > > > > > if (brcmf_sdio_hdparse(bus, bus->rxhdr, &rd_new, > > > > > BRCMF_SDIO_FT_NORMAL)) { > > > > > rd->len = 0; > > > > > + brcmf_sdio_rxfail(bus, true, true); > > > > > + sdio_release_host(bus->sdiodev->func1); > > > > > > > > I don't know much about this driver so I don't personally know if > > > > "true, true" is the correct thing to pass to brcmf_sdio_rxfail(), but > > > > it seems plausible. Definitely the fix to call sdio_release_host() is > > > > sane. > > > > > > > > Thus, unless someone knows for sure that brcmf_sdio_rxfail()'s > > > > parameters should be different: > > > > > > > Actually, looking at brcmf_sdio_hdparse() and its other callers, > > > I think it may not be needed at all - other callers don't do it, and > > > there already are some calls to brcmf_sdio_rxfail() in that function. > > > It would be nice though to get a confirmation before I submit v2. > > > > I think invoking rxfail with both abort and NACK set to true is the > > right thing to do here so that the pipeline can be properly purged. > > Thanks for looking here. I'm not sure I totally understand your answer: > brcmf_sdio_hdparse() already calls brcmf_sdio_rxfail() in several error > cases. Is it really OK to call it twice in a row? Yes. brcmf_sdio_rxglom does the same thing that calls brcmf_sdio_rxfail again in error handling. For this instance I think it's better using the same logic as the length mismatch block below ( calling brcmf_sdio_rxfail with true ture). Thanks, - Franky