Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp172898lqs; Thu, 13 Jun 2024 07:10:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXx2FSOKHAzYRK4jZ0aBoctMjeLmNlfiL9QRpP0szPNpGWDOhe0B0bLPkeS2V+l/3Ve7T/0oEab+Sl80yw0ip0bOocqZA9aGxH2tGNXHA== X-Google-Smtp-Source: AGHT+IG40QZ66X421gYzlE9ubIiLweSOE3iU8FzT9Tlf+DDFytQxzkIz3m/sbiCJg1RjijFWRxe3 X-Received: by 2002:a05:6808:f11:b0:3d2:1f71:1901 with SMTP id 5614622812f47-3d23e040ca1mr5158363b6e.29.1718287845486; Thu, 13 Jun 2024 07:10:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718287845; cv=pass; d=google.com; s=arc-20160816; b=zdjUM+1zRWYA9I8Vrais39QuSEF4l3oo2fyj7Olc8DCg9JwgJ7Y2RFeA2VQeduuFzJ 2SWDtnoSCWaoTtB1vjz97mTE9O3+rX+Wk3OOOm01jjdVaV4P5jxmvvZl284v4P/XM9fU HYKYB2VL28g+07pQ/IiDs5a+k3L698DCYPe7D3flLYTsC9dw9fphJbVXEMIovrc84zEA 6g5jaeDaLJktmud5gWV80SOQAs2kWkd26J65BxUPRyg5alUXeIEoRmqCxAlnregod6ub 5C7YJ7ZhMuBUkP9qxWOVVDx0FY3+lcysXzAO1Je9iRJ2IAL5CcrpWN9YaJreja+eGsyt hp2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=qMuh+5SjoWabgRcuPKc16rfOCZ4xON70zkQc74UXvbk=; fh=hf7yt6gAq86lBfLhZUgknSIsFJxesf1c5mfeIKl6aZk=; b=aeZbftwS7jhti7FHwACOzSCvIc+7FhWH8BTlLKqVvZ817CtePh7+Nhbo8lGk1IEUVh wIo07HEfmo44mrIFRrvdTYAzY3utNX1oHvhsa8odeR8mZ+poAHouawKCRT4uCQB/Ch8J hqN37oH9QjfaRKQAixL77yMe6wncOsz+tJ/+/5/g79upWn7GBxcLE4DGNWX+eEIINWLo C8MLFLhYPCl5mnVerIY94Bi1kwYu/X3ZeGxMrgHuIUHK6EB95FIkM3LLJqNM0N/7Qh65 q6bNSHOc8VSNQj/Ii1fYicEhMuCFu5tK6gM9jF06T6ZHwMiv+LKr3yIQ/daO+ppjtCQp 2GAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=URBdQX0v; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-wireless+bounces-8980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 5614622812f47-3d2477b2d6asi512333b6e.130.2024.06.13.07.10.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=URBdQX0v; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-wireless+bounces-8980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 661F32823A1 for ; Thu, 13 Jun 2024 14:10:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B600145B18; Thu, 13 Jun 2024 14:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="URBdQX0v" X-Original-To: linux-wireless@vger.kernel.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 3AA311DFFC; Thu, 13 Jun 2024 14:10:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718287822; cv=none; b=Wa/o3DlKUizKcMZMBT7qwrnoCj7uMYHIcYbe6AdrmHUJ+/S2gTOgL1wSE7SxcCJctXtY4g7DKQjd0Clcg+93EE/JpqxLh2ozRW+bmOL+oUn3KI/7Xh9Q+9YuKNORH4iMFK1Shz80VQI80ucfSLQqHdotg2nK4pCbdSpLqp4vEWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718287822; c=relaxed/simple; bh=ZFaFXJ/5FkNcomE8Riab0CfZAzjtblxo3xgwjf0mA8M=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=GW22e7+HY8ZxsWfmlN0Ev5119ScPoW81di2lR0s8qs+kqCionwHm7kLDi5Db/GE2onWS8u9DYPTP7ZoDq6Mc4euEeg7erhv0jW1jXFUocBId4S5NMuNRBz2h4FC6EK5cVIOVX+KxBNfW9zSrVyXxX+kcR0k/xJArGy44snka7Os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=URBdQX0v; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 6F2CB1BF20F; Thu, 13 Jun 2024 14:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718287811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMuh+5SjoWabgRcuPKc16rfOCZ4xON70zkQc74UXvbk=; b=URBdQX0vcncG2RMb2tU6slxnjH+jsgZVVVJXMO2Wdk8vQgeXvphD+4EAzqrw4G7RJgjCwv AjWxnm5S1/3v5sdlfzvYT4xziIswciqAH4GDNUGbJqE6FYAs50hgrqXszqHyYw98iD+6+f IdtSx6W45Yj0g2Dp0QitGxs5qpkZh6hMXZbhYLUt6nS0BuAK3zPsps+DwTizglsXcniTbQ yL37AqAiZO/u3TaF8wIjPrlTGw37oWubUdTf4MDJQXsfadlFvL8z/7x1ttL9+x4y0ZiNcG LL6+hNf3ZD6Q3diOse2779aLc9+6PzwCs44NTvk34UmQhd6i56WVhztHGMglFw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Subject: [PATCH 0/6] wifi: wilc1000: update power management Date: Thu, 13 Jun 2024 16:06:39 +0200 Message-Id: <20240613-wilc_suspend-v1-0-c2f766d0988c@bootlin.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAO/8amYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDQyNj3fLMnOT44tLigtS8FF0TE8NEU0sTkxRLE0MloJaCotS0zAqwcdG xtbUAZzIHZV4AAAA= To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , Thomas Petazzoni , linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.13.0 X-GND-Sasl: alexis.lothore@bootlin.com Despite being implemented, power management for wilc1000 does not work as expected and suffer some issues. Those issues can be observed by executing "echo devices > /sys/power/pm_test && echo mem > /sys/power/state": - system does not resume correctly (at least on my testing platform, sama5d27-wlsom1-evk, either with devices test mode or user button configured as wake up source) - warnings are triggered during suspend This series brings fixes for those issues, and more generally try to improve things a bit: - implement only one pair of suspend/resume callbacks (those are currently implemented for both 802.11 class and driver, with one depending on the other) - fix some warnings (for example, IRQ still being enabled on SDIO func while going to suspend) - fix some scenarios leading to chip becoming unresponsive to SDIO re-enumeration (error -110) With this series the following sequence works: - echo devices > /sys/power/pm_test - echo mem > /sys/power/state - chip is properly disconnected from any AP when entering suspend - chip properly reconnects on resume The patches comes both from Microchip internal patches (slightly reworked) and new patches based on encountered issues. Tested on SAMA5D27 EVK with a WILC 1000 SD module, tested both in SDIO mode and SPI mode Signed-off-by: Alexis Lothoré --- Ajay Singh (1): wifi: wilc1000: disable power sequencer Alexis Lothoré (5): wifi: wilc1000: let host->chip suspend/resume notifications manage chip wake/sleep wifi: wilc1000: do not keep sdio bus claimed during suspend/resume wifi: wilc1000: move sdio suspend method next to resume and pm ops definition wifi: wilc1000: remove suspend/resume from cfg80211 part wifi: wilc1000: disable SDIO func IRQ before suspend drivers/net/wireless/microchip/wilc1000/cfg80211.c | 19 ------ drivers/net/wireless/microchip/wilc1000/netdev.h | 1 - drivers/net/wireless/microchip/wilc1000/sdio.c | 74 ++++++++-------------- drivers/net/wireless/microchip/wilc1000/wlan.c | 8 +-- drivers/net/wireless/microchip/wilc1000/wlan.h | 1 - 5 files changed, 30 insertions(+), 73 deletions(-) --- base-commit: 3971a5a8f911615f9a816f76c83c37d51ac522a9 change-id: 20240123-wilc_suspend-441a5944d941 Best regards, -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com