Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp808422iol; Sat, 11 Jun 2022 20:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ/EQWixp5ef8Vqsp+8mKxbnhiyZlSGnPMG9QvvBKmJLMKU+MpDUlPz9kZRm1tFHxhTim/ X-Received: by 2002:a17:906:851a:b0:709:d4ce:21ea with SMTP id i26-20020a170906851a00b00709d4ce21eamr48614711ejx.289.1655004005592; Sat, 11 Jun 2022 20:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655004005; cv=none; d=google.com; s=arc-20160816; b=MwdtOq9qri3wpzi9RqutERWWizGcWpIslWsSIMOj3ZeU7MYRfgTDhE/9FTyvej++yv cti+mfHGh8+Qj2SAS2zCt0WZX4m09W+3xLvOV86CiQtxTC8IoArYxvy9ER5+YgYOGazP xue4/FUqZnOkn+z8Xf7dM5T6VE4Lk+r4PRgA75OpWtzhPKIw5k24FuJ5TX8Ukh6naW8Q erko5cfnP155JhX8El1p3x5abqK/D2PMI1EEjtNN9Y4c5Y27CKBUdhYfVtPF3se0+DO0 Fb9HX5+SfDzB7pD/6RKbyBugWs7wtUbxKwfnc8aXHmYSdfxSr8g+ndD30rhOYOTzi043 wlSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ex27Ddqek/8kX9jvIpLqqO/BeeXbgOfQ4i42it+8DNw=; b=tYOLWBWaLVjobrHWyOigChN4XhhxvBFvQDQ017Ahb6ivGXwbhTXdanf86TL+fuK3I+ lmF12oox/t24saf2IWf6HuPnnA0HsVmeaaxQKj7XBrUbhbGy4cyxoEX6QkAng+8Er1Xz PMudQAYmfp4kOUXctk3ErF9qDFRdHtsuL3gxPlTYg0GP9D34slew2ODWZVAODvqFgH2+ yab4Ckek1QbPVvMIwywUDh8jBvgdSMxEBDn7n7kBcpmVR2GoSw8HITjBW+uLFz+v5Hxm CIoqE+oZpmcUmQ36o9tdFOKcUjXHj5450srTGzPwJfRnM6x7hmzBAr7UuSS8ZecYcy/j nxNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g23-20020a50d0d7000000b0042e1a76680asi3864679edf.394.2022.06.11.20.19.38; Sat, 11 Jun 2022 20:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232401AbiFLCAd (ORCPT + 65 others); Sat, 11 Jun 2022 22:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiFLCAc (ORCPT ); Sat, 11 Jun 2022 22:00:32 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B8FD54F81 for ; Sat, 11 Jun 2022 19:00:26 -0700 (PDT) X-UUID: 57555acc34ff49d0ac48ba1758706199-20220612 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.5,REQID:83495bf3-6836-4dfe-a609-1b5a7c9988c0,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-META: VersionHash:2a19b09,CLOUDID:ab247550-276a-4a9a-a4c8-ea931023add4,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:0,BEC:nil X-UUID: 57555acc34ff49d0ac48ba1758706199-20220612 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 673175378; Sun, 12 Jun 2022 10:00:18 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Sun, 12 Jun 2022 10:00:16 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 12 Jun 2022 10:00:16 +0800 From: Deren Wu To: Felix Fietkau , Lorenzo Bianconi CC: Sean Wang , Soul Huang , YN Chen , Leon Yen , "Eric-SY Chang" , Deren Wu , KM Lin , Robin Chiu , CH Yeh , Posh Sun , Eric Liang , Stella Chang , "Evelyn Tsai" , Ryder Lee , "Shayne Chen" , linux-wireless , linux-mediatek , Deren Wu Subject: [PATCH] mt76: mt7921s: fix possible sdio deadlock in command fail Date: Sun, 12 Jun 2022 09:59:47 +0800 Message-ID: <7122534ce50527e099a23fa198683a0e20c6db38.1654998031.git.deren.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Deren Wu Move sdio_release_host() to final resource handing Fixes: b12deb5e86fa ("mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl") Reported-by: YN Chen Signed-off-by: Deren Wu --- drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c index 54a5c712a3c3..1856d677fff4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c @@ -156,9 +156,9 @@ int mt7921s_mcu_fw_pmctrl(struct mt7921_dev *dev) err = readx_poll_timeout(mt76s_read_pcr, &dev->mt76, status, !(status & WHLPCR_IS_DRIVER_OWN), 2000, 1000000); +err: sdio_release_host(func); -err: if (err < 0) { dev_err(dev->mt76.dev, "firmware own failed\n"); clear_bit(MT76_STATE_PM, &mphy->state); -- 2.18.0