Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9863661ybl; Thu, 26 Dec 2019 06:38:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzk6T5LQolCsH1Y5FfIvB5ajM5x7AvGrDHyEBq9pKMaFq3aYFd6nbLEuS40nWWypGUUML6y X-Received: by 2002:a9d:708f:: with SMTP id l15mr36647028otj.229.1577371115132; Thu, 26 Dec 2019 06:38:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577371115; cv=none; d=google.com; s=arc-20160816; b=zl2twqK6ZkN7eaoRc281deL6GKS+Ti2sTsI6QeTh/3KIcK6y4/7owKiCJxrsWIcPY/ 84kpYwKkAtoYAD9Gi3Y/43NNCXaAOxbkJhQEXUwFyAMWYPK3DjNYYGnA3SmV5c2uzc1W IPfBAxsi2TZYmYioKOEIV+qCLwP1xDqp0uGGC39Y3XeCmJvgOzrzrvCbDrHBKfDUQNlU dTqCyHK74aNKHJDXe3BOy3hnFftLVK9m0tuLYQgbz+uOl48IawMmbytyd6aspcP8uJB5 7w1Jti4E6fiacLTxPLDFAqj+vo/j5ti4+j6TrBLlwKlJh5AoElXFrgei8uJLE5QuJmax 07qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2uXdMyHtTWWc+0rTxfP2Cz8myNyuUa0oqAF7KA6mwz8=; b=VnOzQHgr86u6X11fYdu0TWkx6FslqI46rNhNXY+XllKgKk/sNgzMFPAb6Ta4588LeI VETV2Oq13TUxUBzLzWoTd58vM3fXVnOrQU4xehh9c7axO/hcyw+X+npstK62Pf6m5HHI G1t1Odhe6hownzkZZp9PBmN/u+KsflCly7SIoKaxePKA4ExmVJQnZnGHXS/q6cZ2/8Uo WiGnLqvITRxNjne4pCozKzOXus7Ilrk1+qVQ+Lwbe5O7gOsKOZFWB354kG3ukvslGvom 9wpOcrGW6IAD4j9BJWU5DaGfwPtDmKeCot/FLNA72S5bTI5ZbCfzBEcN1eSgPDy6CGqm 2uWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aTqAifni; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si15829249otg.128.2019.12.26.06.38.11; Thu, 26 Dec 2019 06:38:35 -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=@gmail.com header.s=20161025 header.b=aTqAifni; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfLZOiD (ORCPT + 99 others); Thu, 26 Dec 2019 09:38:03 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44513 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfLZOiC (ORCPT ); Thu, 26 Dec 2019 09:38:02 -0500 Received: by mail-lf1-f68.google.com with SMTP id v201so18618597lfa.11; Thu, 26 Dec 2019 06:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2uXdMyHtTWWc+0rTxfP2Cz8myNyuUa0oqAF7KA6mwz8=; b=aTqAifniw/x+mvTlGZRNdXxg/Vacd5KTNENcr9w65x/UftLQ9pMULKiwyt2FQGeqeK VmHla6phspDVELC8vVU++gzau8vt7YIQuGFMqArlYykoOQdACIOGKvTmN27G3MfOVw3Q yCSSTKiJpMwy4hBO4Q2oR6/4AQc3vM0rnzcwh4OBron/Kw7FXjTkUOdrvMnVXBtQ5blL UP4IAWa95snDlFHnFnnq0qCg1LWzTqwmom+yJ1LOFviv3BLdVlUK97R/k43C4lzE+RHR jWn5k4EONVlXswHz5NECuLs27/ZvpESjC3YcuBtWcmRvdB9ifsLGHffPnwNwNh4HQubo T8WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2uXdMyHtTWWc+0rTxfP2Cz8myNyuUa0oqAF7KA6mwz8=; b=tf4KlLKo0tig6skL6VT4QiaTTAPBMXXYQgwXsLNb1uRmJnpebpoN+E0PetpWkZfvfX e6Vw+gPSpz8DvOEwbRBfbT8/O4/ypbNpRZImTqX4+US6hgwihaFKHPCq7tAZL5/to0pv qZcC68u91aHbW7y6KPqe6qh3c2Uy3rBwxPfo1uM0vGyOr6GiVOaagUs1/XMm1FM8KpJV HxZsaJ0z+bja1vVEsNSQB5eFYg3j5OU4s3zxnANAsM0ZlrFKHZPgBcskRR5j4XoDEmmY fXOXCccwSiHi020lO1FnOzFnFhYrx7prWoRxR7ebvKOJeDt0gtcMMTFbqLYTb6Gt2ao3 X4SQ== X-Gm-Message-State: APjAAAVbGjVo5uHbgBT4q4z8k1nCOSdM7l747GNN2+PS2WLkG3iA6pZU kRBrDnmpcfFH/xVmqzEnO1o= X-Received: by 2002:ac2:5582:: with SMTP id v2mr27328339lfg.183.1577371080463; Thu, 26 Dec 2019 06:38:00 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id u13sm13033823lfq.19.2019.12.26.06.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Dec 2019 06:37:59 -0800 (PST) Subject: Re: [PATCH] brcmfmac: sdio: Fix OOB interrupt initialization on brcm43362 To: Arend Van Spriel , Jean-Philippe Brucker , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, hdegoede@redhat.com Cc: franky.lin@broadcom.com, hante.meuleman@broadcom.com, chi-hsien.lin@cypress.com, wright.feng@cypress.com, kvalo@codeaurora.org, davem@davemloft.net References: <20191226092033.12600-1-jean-philippe@linaro.org> <16f419a7070.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> From: Dmitry Osipenko Message-ID: <141f055a-cd1d-66cb-7052-007cda629d3a@gmail.com> Date: Thu, 26 Dec 2019 17:37:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <16f419a7070.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 26.12.2019 12:47, Arend Van Spriel пишет: > On December 26, 2019 10:23:41 AM Jean-Philippe Brucker > wrote: > >> Commit 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling >> brcmf_bus_started()") changed the initialization order of the brcmfmac >> SDIO driver. Unfortunately since brcmf_sdiod_intr_register() is now >> called before the sdiodev->bus_if initialization, it reads the wrong >> chip ID and fails to initialize the GPIO on brcm43362. Thus the chip >> cannot send interrupts and fails to probe: >> >> [   12.517023] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout >> [   12.531214] ieee80211 phy0: brcmf_bus_started: failed: -110 >> [   12.536976] ieee80211 phy0: brcmf_attach: dongle is not responding: >> err=-110 >> [   12.566467] brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach >> failed >> >> Initialize the bus interface earlier to ensure that >> brcmf_sdiod_intr_register() properly sets up the OOB interrupt. >> >> BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908438 >> Fixes: 262f2b53f679 ("brcmfmac: call brcmf_attach() just before >> calling brcmf_bus_started()") > > Reviewed-by: Arend van Spriel > >> Signed-off-by: Jean-Philippe Brucker >> --- >> A workaround [1] disabling the OOB interrupt is being discussed. It >> works for me, but this patch fixes the wifi problem on my cubietruck. > > I missed that one. Too bad it was not sent to linux-wireless as well. > Good find here. I did see another patch dealing with the OOB interrupt > on Nvidia Tegra. Now I wonder if this is the same issue. > > Regards, > Arend > >> [1] >> https://lore.kernel.org/linux-arm-kernel/20180930150927.12076-1-hdegoede@redhat.com/ >> >> --- >> .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  | 12 ++++++------ >> 1 file changed, 6 insertions(+), 6 deletions(-) I haven't seen any driver probe failures due to OOB on NVIDIA Tegra, only suspend-resume was problematic due to the unbalanced OOB interrupt-wake enabling. But maybe checking whether OOB interrupt-wake works by invoking enable_irq_wake() during brcmf_sdiod_intr_register() causes trouble for the cubietruck board. @Jean-Philippe, could you please try this change (on top of recent linux-next): diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index b684a5b6d904..80d7106b10a9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -115,13 +115,6 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) } sdiodev->oob_irq_requested = true; - ret = enable_irq_wake(pdata->oob_irq_nr); - if (ret != 0) { - brcmf_err("enable_irq_wake failed %d\n", ret); - return ret; - } - disable_irq_wake(pdata->oob_irq_nr); - sdio_claim_host(sdiodev->func1); if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {