Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp813264ybl; Wed, 29 Jan 2020 10:06:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyGONWb8AqlCQ+qg20UiS7UGE+HPb3YKCw0C+jn9spUOG2qnDTU+QJLR9bVUUbxBCPJ/hF/ X-Received: by 2002:a05:6808:683:: with SMTP id k3mr120976oig.50.1580321188633; Wed, 29 Jan 2020 10:06:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580321188; cv=none; d=google.com; s=arc-20160816; b=J0nzc71465v9efonpw6yK2o3zcqKkcfh+g/H/p/PvCLqjmdS6989T8pmCnUi0xmdSj xE6Dw0KV9v0zwHkDMXCiNR0u1rpWzrD7O42dqn8yAmG97NsGsldvJPTfF6E84aH9RMc9 VjlCWEczyPB2bwxkDxH4h2iuzhWGrjyh37B+kARHIcDTrUb8Yv5URirBpLY20XxdU8cE /ouydg0nH319IDoY8A+xcMyUMY+6jURrmdiug2C6hDKGyZYV4iv7bUlsKW3Wmw8lWVLC YY8pRFKhwgsQKXm+ZiaVrdtdZ4ama8bNEzkfvg7E0cKQ0jI3xOhfDFLeRm6CaIMwbXGU d3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6QNebILk02STEyIe5/0fAJxmh4v1Dv7+qDAzRC1FUDQ=; b=VjkQK93bTODs9wM2d/l8budUkuGd5HSRE/ph/1849fh5qnPpchzv4nEWmPuqem3zOW 9WcB9bH2BfDTJ4GylToktwdgK1oHaoDM/KMkf1nxS8dEamq5qr+Lr6u9uXLeIfaFkaoA aAUcdlGyeGue6WRSI1UJFho31CHYOg1/JoNPQhRD7zKz87ge0nLRNG+BJF2wwFLnAri1 AnVGRKYYomViqWS5K8u2S+L4CdWpG+c7WaGGWoGyp47v+EncBDpSfl5dBrkPZZltT780 FK/nIPlMvUrRdJGWMsaXbUWUl+8jEj/6reF/dQi+jJ/mT0iwSCUAG6NpUP3bPaMy3TqW y6XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LowdrKlK; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si1309806oie.87.2020.01.29.10.06.07; Wed, 29 Jan 2020 10:06:28 -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=@chromium.org header.s=google header.b=LowdrKlK; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726847AbgA2SEe (ORCPT + 99 others); Wed, 29 Jan 2020 13:04:34 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:38618 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgA2SEe (ORCPT ); Wed, 29 Jan 2020 13:04:34 -0500 Received: by mail-pj1-f66.google.com with SMTP id j17so125344pjz.3 for ; Wed, 29 Jan 2020 10:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6QNebILk02STEyIe5/0fAJxmh4v1Dv7+qDAzRC1FUDQ=; b=LowdrKlK0P6qecyQGM0hzYenViTrLksQTfxjJ9ni4gKyCCIp1FahM6Ho5TjGK9OAVj 7oqM88GFtBs997v7Yh1XJCADc6MeqKnvobn1CGwvE1MPLZNH0uZswwf2Zu4yOPQi3Cdi 0e9TIPoczxRInL3Xrd1lCEWURMROuKtqa8IP4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6QNebILk02STEyIe5/0fAJxmh4v1Dv7+qDAzRC1FUDQ=; b=uUWVzPgbgifrGZRDyc29NwDrCjwTs/0WJeIOCxfFrJpNTu/5HVnoFlcc1iaeF+97Av HO1RW/gQQ/LJe5m+nVysieqpveettww7besVJ664cSr0hXl+kvm8KtTBUcgMtYDKyMa4 pse0LirfDxAfqaYfJFVwig73caeppz/o3yeVZQHSpY/iCOprUhlHZhIpUrmOHHuIOhBo QF5sczZNtsPL8lmR8O7KF6R9pmRKDEa3sdRDEiDW8EJvGjzKpDeKQQ5SXWh5i8sh/2Rw UDlWDXTBlD/bMY9n9YLFdViPPXauFjhl1TcAgKEruIP57pNR4AbCn5NFwrtQAPoQvLCy pi5A== X-Gm-Message-State: APjAAAUhwtMYr89mn4rdPTjVgd1ib1UbNEQVGBCZOmcMA4hp5eezdViV ZTBGZpP6h8G/pxXrXsgt3w3zZA== X-Received: by 2002:a17:902:bf41:: with SMTP id u1mr552856pls.207.1580321073273; Wed, 29 Jan 2020 10:04:33 -0800 (PST) Received: from google.com ([2620:15c:202:1:534:b7c0:a63c:460c]) by smtp.gmail.com with ESMTPSA id q6sm3385291pgt.47.2020.01.29.10.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 10:04:32 -0800 (PST) Date: Wed, 29 Jan 2020 10:04:30 -0800 From: Brian Norris To: Franky Lin 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 Subject: Re: [PATCH] brcmfmac: abort and release host after error Message-ID: <20200129180428.GA99393@google.com> References: <20200128221457.12467-1-linux@roeck-us.net> <20200129000551.GA17256@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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? Brian