Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp440005ybn; Wed, 2 Oct 2019 00:10:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmWkFFdSLAaricmsnuCAg1/qkFAZfnQrpheK83ZifLOVFL87anrk9fVySpKpwtRqK6m0Y0 X-Received: by 2002:a17:906:699:: with SMTP id u25mr1701686ejb.250.1570000248448; Wed, 02 Oct 2019 00:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570000248; cv=none; d=google.com; s=arc-20160816; b=HZ7SdggY6SynsOxmC51svrQKeVRHURNzOg9l1WriZnIepad/ynxy9UqEMEPCYguuBe TfkGCeucvgUorfocMPlwxnwfVkrDLeQoZ3E/ESw34I5JdL2ckEPLX3thowq+v5rn6oKm 4LFIzzls0qgJozxKrP1NGb2p0MiltRw/u1phpGanppnfZrH9wXi6Bp/Jl8basWyrdR8P NJf3ofzTNX4D3DMHqs7cDgzdmHAxXD9aL4FtLxCVv+Ah8MbRGmIaNcsij2MZxPUSvpKV GyeDVPQP39N1iHK7pLSsWA7WgAJMXZQSZMFnkURbNZ6MU/PNyqnf+43tYsZRqyuMUvWc vv1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=U+boUcTI/BLPHXlZKaNSpKx7CEZznIxmaIKkp5xZat4=; b=jRHoYNDlmqo9UFB3TcDq5AoWPDYKAtygcx5b2dWFHgR5NdemBCDTIpCv6PgunihDPo +IbXuiOsRH3Jf5M3IU2ggxKpeT88zkrq4hNIRJZviQspy+GmBZ6TZ0rRgXXiESLHXfXE 8FUVRuC4qWOiOq8/cAbE6FcoTJzARC/fyVh60bI5N3llm29CgomIUvV27LjvIu4eb4jm 8wAJfq22gB7Wx+8Dgzm+IohgVzx6M1ltzvYIQLtzaWrpdQDT9hhNm1p4+TO0uwzlE/u2 BF3qvFZArrx+0Rb4qlSsg7vDBR472Wsd5EaEmiW5DI3/U/ftezVDw4muBmI5N77AzoRs 7WiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si9807237ejx.141.2019.10.02.00.10.23; Wed, 02 Oct 2019 00:10:48 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727379AbfJBGfw (ORCPT + 99 others); Wed, 2 Oct 2019 02:35:52 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:57727 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727283AbfJBGfu (ORCPT ); Wed, 2 Oct 2019 02:35:50 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x926ZiNL013117, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x926ZiNL013117 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 2 Oct 2019 14:35:45 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Wed, 2 Oct 2019 14:35:44 +0800 From: To: CC: , Subject: [PATCH 14/14] rtw88: fix error handling when setup efuse info Date: Wed, 2 Oct 2019 14:35:31 +0800 Message-ID: <20191002063531.18135-15-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191002063531.18135-1-yhchuang@realtek.com> References: <20191002063531.18135-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ping-Ke Shih Disable efuse if the efuse is enabled when we failed to setup the efuse information, otherwise the hardware will not turn off. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Ping-Ke Shih Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index bd2d3f9bc049..e0cc4c11e513 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -1105,19 +1105,19 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev) /* power on mac to read efuse */ ret = rtw_chip_efuse_enable(rtwdev); if (ret) - goto out; + goto out_unlock; ret = rtw_parse_efuse_map(rtwdev); if (ret) - goto out; + goto out_disable; ret = rtw_dump_hw_feature(rtwdev); if (ret) - goto out; + goto out_disable; ret = rtw_check_supported_rfe(rtwdev); if (ret) - goto out; + goto out_disable; if (efuse->crystal_cap == 0xff) efuse->crystal_cap = 0; @@ -1144,9 +1144,10 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev) efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0; efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0; +out_disable: rtw_chip_efuse_disable(rtwdev); -out: +out_unlock: mutex_unlock(&rtwdev->mutex); return ret; } -- 2.17.1