From patchwork Wed Jun 21 21:18:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 9802905 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5CCF6038C for ; Wed, 21 Jun 2017 21:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A281227FA6 for ; Wed, 21 Jun 2017 21:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9728828372; Wed, 21 Jun 2017 21:18:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E1027FA6 for ; Wed, 21 Jun 2017 21:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751144AbdFUVSW (ORCPT ); Wed, 21 Jun 2017 17:18:22 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35069 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdFUVSV (ORCPT ); Wed, 21 Jun 2017 17:18:21 -0400 Received: by mail-wr0-f170.google.com with SMTP id k67so1765360wrc.2 for ; Wed, 21 Jun 2017 14:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A1HZCEheRbXrQ+T9RAKC2735L9qbssOTZM0DJt1IFyU=; b=B/GTXQjoHPb6hXwajlgR2Xgz2nZsQGpFArQGFuDsafAHzEDAlUBFMEoT1vnJ0bSmk4 gEMzLTgWtugx9bByAbc6tnVa3TQcBDIGCYb33e1PA7QN+6LL7fX/vYUerfw5MezEdmMg Yp3iIteH8WQtLLUiR2z8W8HwNWGd+XvEOc/cI= 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=A1HZCEheRbXrQ+T9RAKC2735L9qbssOTZM0DJt1IFyU=; b=OwBqJUFUVhgr8xe1YOLPI55/P1p8bIUSkdvtpkOUgpicfkwxaZLQjP5i3l5rg7j9lu 0xP+fEsg2fv4Q7ybdKmLViND1gjkK9ADeO8QO95PZdWJtMWLGyk94/qC8EUr1+1TbQ/f egDkxXvZNmqjB8ZoYaQg023KPw9NLylvcMUwIN2xS8sX/si2tGnxa0MMrJxvNu42GeBB aiZPWps4bqhXFQKv15GnjZYk3aBBnmedA+8W11IQDXiD55z39Ktnc2cYd4vDlie63o/t aq/OBgYfxs/lHCbRMJaUk0OyqcHN2z4PhTQIoN5Ls+hIlbf1Fjslw4IeLwzQPcKpkdR1 MsDg== X-Gm-Message-State: AKS2vOzy1h1FSvpf41zwlrmRatfoRb0Au2HCmFw900UtCZEO5i722dG/ BXYh5cbWphrSXsds X-Received: by 10.223.170.150 with SMTP id h22mr11742818wrc.140.1498079900241; Wed, 21 Jun 2017 14:18:20 -0700 (PDT) Received: from [10.177.251.110] ([192.19.248.250]) by smtp.gmail.com with ESMTPSA id 92sm21117615wrb.55.2017.06.21.14.18.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 14:18:19 -0700 (PDT) Subject: Re: [PATCH] wireless: brcmfmac: initialize oob irq data before request_irq() To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com Cc: Franky Lin , Hante Meuleman , Kalle Valo References: From: Arend van Spriel Message-ID: Date: Wed, 21 Jun 2017 23:18:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 13-06-17 18:02, Michał Mirosław wrote: > This fixes spin-forever in irq handler when IRQ is already asserted > at request_irq() time. With all the patchwork misery flying by I almost forgot to respond to this. We suspect you are covering up a hardware issue here. At the time of the request_irq() the device configuration for OOB is not yet done and as such it is an input which makes the OOB line floating. Can you tell me what platform you are seeing the spin-forever issue. Could it be that is does not have a proper pull-up/down on the OOB irq line. Could you try whether moving the request_irq() and enable_irq_wake() calls further down after device configuration (see below) solve your issue. Still it would be better to fix the hardware. Regards, Arend if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) { @@ -161,6 +146,22 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiode brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); sdio_release_host(sdiodev->func[1]); + + ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler, + pdata->oob_irq_flags, "brcmf_oob_intr", + &sdiodev->func[1]->dev); + if (ret != 0) { + brcmf_err("request_irq failed %d\n", ret); + return ret; + } + 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; + } + sdiodev->irq_wake = true; } else { brcmf_dbg(SDIO, "Entering\n"); sdio_claim_host(sdiodev->func[1]); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers index 9b970dc..e57a211 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -114,26 +114,11 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiod if (pdata->oob_irq_supported) { brcmf_dbg(SDIO, "Enter, register OOB IRQ %d\n", pdata->oob_irq_nr); - ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler, - pdata->oob_irq_flags, "brcmf_oob_intr", - &sdiodev->func[1]->dev); - if (ret != 0) { - brcmf_err("request_irq failed %d\n", ret); - return ret; - } - sdiodev->oob_irq_requested = true; spin_lock_init(&sdiodev->irq_en_lock); spin_lock_irqsave(&sdiodev->irq_en_lock, flags); sdiodev->irq_en = true; spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags); - ret = enable_irq_wake(pdata->oob_irq_nr); - if (ret != 0) { - brcmf_err("enable_irq_wake failed %d\n", ret); - return ret; - } - sdiodev->irq_wake = true; - sdio_claim_host(sdiodev->func[1]);