Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp132832lqk; Sat, 9 Mar 2024 03:58:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaYqf0XSCzkxHFVH+T04/klEySHt2yF9/nKyMfTVbcrlQcO3cI1U4ryX8+Man8vnwKJtzJPtBimqilRKF8Ur9Zuxt2pqXwrMqO27gpkA== X-Google-Smtp-Source: AGHT+IHOTydyfhdqAoguv+uL2JoytkTo2EXxu13+lzE9ycgPMgK0fu0M5erYycLIzLDJGJd2abWQ X-Received: by 2002:a05:6e02:1948:b0:365:44:1ed6 with SMTP id x8-20020a056e02194800b0036500441ed6mr2247823ilu.5.1709985515575; Sat, 09 Mar 2024 03:58:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709985515; cv=pass; d=google.com; s=arc-20160816; b=loR6Kulee2+AwftLGOTecpsKXN4oKdQMUAsXDgSFcehcFhFOqpR+bD/7FVTJ3+HLuG CR3P1fFkeM7wX0vfY9BwBcfVMQRt15CzvnZzvoC2z0fTUH7/m4vByFYO356KMnHqieB7 6QdNxAh5eIn7o7zcMzfafwZKJKkYfCvASrIBTDOdtJ8DMrR9byuoqHsI2tTu09CtRGQo WGxR2ZpE9bQicmTQT8DJfcFiaDWtDojxnF23wua+KtFpDizhavjEKMZevoiC9tagPnK9 K5N/uZmCLtUBP/4fMByXSy6NrGAhgo7v7HOqFgwSmSn23dlI6s9ODKfYa2LBI4JBHORq v8sQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=plbjCIHs4pvFW5UZ3I7qAZCzwNaxuHsS2zRZbspdNY0=; fh=vioCFxE9EDeLWBo4RaQu0jJXdc5Dsw8ZcaS0cbULLd0=; b=yfeIJ88uHfEf6ZAdIq9qrvwXgjgSBYb/A5dFEEYyy+CO7WcJy7TkufVQtSkL+AMaRs uNORVgROsQ2RL478brLI3c+8oMeEFt4wc+FVBFKvgxm11PDYwG8dqTxpmLTFzjw6OQ20 /Qnt0xH1wqzqIjtG7qwyIFqf9KrtDPZOVWgA5/01tjKsE+BDoUPyDcBz2fli2n4M1wDI AxIzQ4bb2RCYylczlNS1bcPPVv0KTaNwgbm7vOxY73bM9uM9u9vKVcGI6CctM9fkoxoj qiApLkZfFob0U9aiRfCCUH2zBSdOtsT0nVTmTOtDQ3XVBmFP+ER1G3vl9R1iRfN1+Atc FMYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=m0OBqLoh; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-wireless+bounces-4513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s13-20020a65690d000000b005dc7c05e470si1353177pgq.590.2024.03.09.03.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 03:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=m0OBqLoh; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-wireless+bounces-4513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF7EFB212FA for ; Sat, 9 Mar 2024 11:58:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE67E3B7A8; Sat, 9 Mar 2024 11:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=fiona.klute@gmx.de header.b="m0OBqLoh" X-Original-To: linux-wireless@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF2F63A1CD; Sat, 9 Mar 2024 11:57:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709985469; cv=none; b=V1sE1VGSfZmrmt+nNbPP2C7F2VdEwUl5u93m6wii1ccJI4Vndrbli/aQx2Ku5cMnXEA44d+SKYyDT6OitGToXaefi6kW5TfbhSpxaAE3t8E/aA/QtpL11NSB94bwuumX3d00dG+OBUM9tR9v05gzfLRI9Hvp/FiE+ZE9W7EO87s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709985469; c=relaxed/simple; bh=KwZr///IvqX1ALEKr4OOy/LNKMTrPfYHY9pB5hMd8FY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EsnrrQCo17lECXv+jSpNuORKRnSOOQ68PVLRLM3WTvVnrVmkvUH+k6TjHkC6oo2D5wDhybVmXCkHNHcT08ogpqWfNeBF+dDqxfOG0IY77GgGSn6pm5RQm9ONszvUKSff3iaw/Ecgc7sZyS1P6DlwBcex7zBqpxHQe3CV60wkOoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=fiona.klute@gmx.de header.b=m0OBqLoh; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1709985457; x=1710590257; i=fiona.klute@gmx.de; bh=KwZr///IvqX1ALEKr4OOy/LNKMTrPfYHY9pB5hMd8FY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=m0OBqLohlsM40d09ZxwbMhQhbqjpS7FK90qN8NZe/+fuYevE/GmTiCX6sAaiPKf+ NN6ZLz0VBO7LXogMkCAly8jqx6QdqmY1Z/CjwJlfw0wRsr6IjtOOKtvD7ReyBwXoJ Z9rBKeD6phs9aaqa40TowZVWmMpgX8v+YKVEh8/LuVqsjsFrjJu6HKOQTQNUIf8eK cNhtPW9oCmEU4gspnZun7sBAKXTjqEBYgTC7d8wb8Q3AirPm5ckDc7rSJNTxtI5It uOl5aq6HwggjAh1WARm3JAN0nMeA02ZZU/PDyq1Ax2/XG5v2TIpDDJgoQ8RejqxCM PWWZHudkYsJTmiMm7Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.112.71]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MqJqD-1r6L2o03Vb-00nRyw; Sat, 09 Mar 2024 12:57:37 +0100 From: Fiona Klute To: linux-wireless@vger.kernel.org, Ping-Ke Shih Cc: Fiona Klute , Kalle Valo , Ulf Hansson , linux-mmc@vger.kernel.org, Pavel Machek , =?UTF-8?q?Ond=C5=99ej=20Jirman?= Subject: [PATCH v3 8/9] wifi: rtw88: Reset 8703b firmware before download Date: Sat, 9 Mar 2024 12:56:44 +0100 Message-ID: <20240309115650.367204-9-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240309115650.367204-1-fiona.klute@gmx.de> References: <20240309115650.367204-1-fiona.klute@gmx.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:93Wh7zjC7xWE+cYTuIkuM2UtTC4hTovN9b6LKXltcwQCHKW9iNu e/T8kg3mRAneHl/m/sV1vcRtignez4Ec3qc/3Hxs9g0nMk67enttwpMOYgFijbk6ptFKcuj P1P3U1JDmr4dokDjrFs+oYRoPGA1i1bxI6kip8AZjd8l/KURBAAKxlc8QllKugg8nLKdDyA I4vksvRAEqm5K2ObvILHA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NG+efRHEFds=;xkjLljadMslbiPLJ0M2iv6rgyMv WUEDgmlZGX+yzBIL3SuZXgxzd/np/w9Vq2JNs2OjWg1g9lVLUBq2ejRm/p78feAZ8X1x9rzqa U6pvsuCWZQIQSfZWiRnoZkBpxIP1KMf6uV0VCxVNToIDKZkI9h8NpGFE7JmGKCKNcqtwH33us dy9VKCDL7QCLRAIPfjdJzWcLDzCwjoiDnXB4+dXaciazBobyOwVFaE78EivKqZf9KAuJQzuq9 K1Bn1HZF5vNvSIXGcA9IriTSaCnnAF/udzqsY9nYLedaZZ002kZi229nhUEf8dKyAuKe7S2+R Yp4UHHXpXxdT2o2DYapIvw7SwBLXV0+8uO3ibgNm/hpbZUGi2BpmEWC2iNQXZ7GjuVWRO/Q9I rk55jvbFg5r5LBoM5PmAzQ+UIrGjJNKXf5v1+R2vWn+prcs0BiCRS9zYUhzxKRrECP+Ed3RO7 uevNn8WsGoB4tZgCbjnQv4LIQeU+AVzEDLKcPMv9XAOk5jjwwg2B7ZeT6Obvk3TqC6b0IUAgP yl8WFJAYhT6HGpaKkC40AAnstOYITitrh4b3daMxO9UjRR9udn6BJRAjmPF5liyAbPyKTOtaP ksCMM0R9JoJTzuRayd2yg8lNvYTlXfe633ALnJo7KSucvqqdq/3/hfNrofKG5fmtHAC/kZ737 R7bmtp5+44FuAprX6nHrfcoRGzRrfVohlkHb2jxE67w1nRmECoHbToQkGuLEmkjkYJziCaEL1 5sXt+43sVDa2uhOYLWMWEeXCGZukn39rI1l+vfpqR1/qMZI1WItoPUK3VJhrC9vBf0QojPiO0 uZCY8jazskYD8eZc5fDSLRnuxM/GiDf8sMNSmho5xUj90= Sometimes 8703b firmware is still active from previous use when the driver needs to download the firmware during MAC activation. Reset it in that case. Acked-by: Ping-Ke Shih Tested-by: Pavel Machek Signed-off-by: Fiona Klute =2D-- drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wirele= ss/realtek/rtw88/mac.c index 298663b0358..5fa38b1068e 100644 =2D-- a/drivers/net/wireless/realtek/rtw88/mac.c +++ b/drivers/net/wireless/realtek/rtw88/mac.c @@ -936,6 +936,12 @@ static int __rtw_download_firmware_legacy(struct rtw_= dev *rtwdev, { int ret =3D 0; + /* reset firmware if still present */ + if (rtwdev->chip->id =3D=3D RTW_CHIP_TYPE_8703B && + rtw_read8_mask(rtwdev, REG_MCUFW_CTRL, BIT_RAM_DL_SEL)) { + rtw_write8(rtwdev, REG_MCUFW_CTRL, 0x00); + } + en_download_firmware_legacy(rtwdev, true); ret =3D download_firmware_legacy(rtwdev, fw->firmware->data, fw->firmwar= e->size); en_download_firmware_legacy(rtwdev, false); =2D- 2.43.0