lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250212-wilc3000_bt-v1-5-9609b784874e@bootlin.com>
Date: Wed, 12 Feb 2025 16:46:24 +0100
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: Alexis Lothoré <alexis.lothore@...tlin.com>, 
 Marcel Holtmann <marcel@...tmann.org>, 
 Luiz Augusto von Dentz <luiz.dentz@...il.com>, 
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Ajay Singh <ajay.kathat@...rochip.com>, 
 Claudiu Beznea <claudiu.beznea@...on.dev>, Kalle Valo <kvalo@...nel.org>, 
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
 Simon Horman <horms@...nel.org>, 
 Nicolas Ferre <nicolas.ferre@...rochip.com>, 
 Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Marek Vasut <marex@...x.de>, 
 Thomas Petazzoni <thomas.petazzoni@...tlin.com>, 
 linux-bluetooth@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org, 
 netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 05/12] wifi: wilc1000: do not depend on power save flag to
 wake up chip

The wilc chips family has at least two mechanisms dedicated to power save:
- a firmware configuration message, currently wired to the
  set_power_mgmt_ops of the cfg80211_ops structure (and so, configured
  through iw)
- dedicated raw registers which allow to wake up the chip each time we
  need to communicate with it and to allow it again to sleep once done:
  those registers are currently manipulated almost any time we are about
  to use the SDIO/SPI bus to drive the chip.

Those mechanisms are currently coupled together, and so the second
mechanism is driven only if the first one is enabled, but it is wrong:
even without the power save feature being configured in the wlan
firmware, there are cases where the wake up and clock registers need to
be written correctly, otherwise the chip stays unresponsive. The
downstream driver seems to acknowledge this issue, since the flag
matching the first feature has been completely removed.

Decouple those two features by removing the condition on the powersave
flag in acquire_bus/release_bus to make sure that the wakeup/allow_sleep
registers are actually written when the passed enums
(WILC_BUS_ACQUIRE_AND_WAKEUP, WILC_BUS_RELEASE_ALLOW_SLEEP) explicitly
require those writes.

Signed-off-by: Alexis Lothoré <alexis.lothore@...tlin.com>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index a697caf73ac3ed06602c029c17773f50e3f8edb5..1031f8153c76ca5761c1e91d03ba357a5c915774 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -748,7 +748,7 @@ int acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
 	int ret = 0;
 
 	mutex_lock(&wilc->hif_cs);
-	if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP && wilc->power_save_mode) {
+	if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP) {
 		ret = chip_wakeup(wilc);
 		if (ret)
 			mutex_unlock(&wilc->hif_cs);
@@ -761,7 +761,7 @@ int release_bus(struct wilc *wilc, enum bus_release release)
 {
 	int ret = 0;
 
-	if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode)
+	if (release == WILC_BUS_RELEASE_ALLOW_SLEEP)
 		ret = chip_allow_sleep(wilc);
 
 	mutex_unlock(&wilc->hif_cs);

-- 
2.48.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ