Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp172681lqs; Thu, 13 Jun 2024 07:10:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpDQZ2k027sLsH25+05GYTDwIRf6IQlsbFE48+u8jfUceCfcgrQVkKMJmYTlQcUnV3iuWnEd6WkkDRZ9igmXmJzpd+epJ9EKfZM6xXyg== X-Google-Smtp-Source: AGHT+IEirZfSjURd8JmeVMy6/qJO82uX57CptYql4+Is2kz0dr67W1jbIQF8R48MyoV4wYGvrKDI X-Received: by 2002:a17:907:20ab:b0:a6f:12:8c48 with SMTP id a640c23a62f3a-a6f47f982ffmr359310166b.39.1718287826759; Thu, 13 Jun 2024 07:10:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718287826; cv=pass; d=google.com; s=arc-20160816; b=O202DZhgPEjt5ta8fD1m8s2VkstXIWl+nl1663N7884S4dj0yd6noZCh4XhGtAQTau QIznQZ2yerHnJFGnIBZmmqNDTHtF9Uwn3IAH2fZpInFw1msKxzU9nC/UBiGXJWYJOSAw wQCsMypANWPm5JkS/wqGHTYo6e+3X2oSu4XGYBLHrIcjnHGnFysFE0fPMMhEEPce4zP+ JfJykV5OohHYqlQW/ymdxxF15Y8Fdn7LrFSPg2HONib97dPvg2EM9v/F33JCbDfMkA1K JXtDwtJGMEH4FWUSyLHGXFqLYK6eJLJhCseRJkB6T+JBpy+pa2DCpvJFRfmldXEY/Sn7 mO5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=CJ/8Ln8PiAlnF/RNZphdxqw6/7DeJ5l7lzf3rL7r59s=; fh=hf7yt6gAq86lBfLhZUgknSIsFJxesf1c5mfeIKl6aZk=; b=yffQ3019wx3wzxg4QGZp2WLAWgtYRHV/qMwIpPHzi5cRwCzVCJqU7t9zM57O4hJhc1 IjOgWhl7S/w0PrtT/Piiew9gLjPKusxgr+j3X7WtYD5aa+S6Hog0MnXFmY+y+x+S08h8 yAApkFz+l0cFGUrc1WhIFlzjIw3Ky/1hXPW/nrH67gmqOcYIiR4hG2WKP5lULsHG80WB JdjmJmuJLG1zAsXmshaoCTr+VZkPVxbgQATyXM+JlJFmYdoB/0hUv0sPaubE7Tn4PS4D q7ZvLmB8yTfQTKW7VBQNU7D2V6WmFFmf+UpVa9maqvFoSqHSlSfO5WCIZMEmxM1aQK8Z m2rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VmFJEbaV; 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-8977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8977-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56dd66ffsi70438066b.362.2024.06.13.07.10.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:10:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VmFJEbaV; 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-8977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8977-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 571EC1F215D7 for ; Thu, 13 Jun 2024 14:10:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB0621459E8; Thu, 13 Jun 2024 14:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VmFJEbaV" 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 3AA7B142E73; 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=1718287821; cv=none; b=KN+07GmtVFm29AuBp40XgkEd5NXf8ZAVjMZKruG7XAbzldIicZK0nLHfNvYxQHQYoaCD4reUZx6pGrenNHi4g+v4W/iEbPjdCRZGQT81g0RUoRjJtGPyCwEX2Bm4hGu1T4z2Uo4dszuGGt6/sKXup51F5Ofm79Kw4IeXXiXJyQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718287821; c=relaxed/simple; bh=kfbDOTov0/7uKDAmdCfshJARzEdStSiJq1qjZfUJEvI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WnsgQHBcBx71HbpysGHC/eHICsdLvqo+Mua5t8NP/b8bYS0Y5sgPz1oXCbM/lTUnNnKP6Km2I05f8ymeU/NH5RZkdYGQXTSlLCIHBhpv+Iu6xZW1EkbZqR3shbW40dTbBnh35xSDxaXs1EfazXYcZ6Nme0wS//UszJdaZ4xJ6G0= 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=VmFJEbaV; 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 D9AE41BF211; 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=1718287812; 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: in-reply-to:in-reply-to:references:references; bh=CJ/8Ln8PiAlnF/RNZphdxqw6/7DeJ5l7lzf3rL7r59s=; b=VmFJEbaVkjgUtVGCNpij8d+BhEpJDDRps6/9iul5OKTCS1fcbH4sothWfZK6PcpnOx27A9 9ogIujCO5q7tzcLvNqo0PKQ2Zkz9n1cVLotxehykx/yl1TOMb+Anwj6bVwe2F0Lxi9/CCF sUMFT8AEKN7tFSHuQML/05WmHr6kiHBmE3nWF7eFQPG5eZwIzWmxaQI+zu1AMlsJKnupio TvlnobClnh0lUHAcIrn1k54sLYuljWw9F2aMfJBMValmBZ5WQV+doh/TR0QPFETaYYiPUW RCzRLomv5cTJf+jAKR0zTHh2aJUS5oyE3tmXxSYp154ae7PQi+Ut4YSdbOXt6Q== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Thu, 13 Jun 2024 16:06:40 +0200 Subject: [PATCH 1/6] wifi: wilc1000: disable power sequencer 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 Message-Id: <20240613-wilc_suspend-v1-1-c2f766d0988c@bootlin.com> References: <20240613-wilc_suspend-v1-0-c2f766d0988c@bootlin.com> In-Reply-To: <20240613-wilc_suspend-v1-0-c2f766d0988c@bootlin.com> 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 From: Ajay Singh Driver systematically disables some power mechanism each time it starts the chip firmware (so mostly when interface is brought up). This has a negative impact on some specific scenarios when the chip is exposed as a hotpluggable SDIO card (eg: WILC1000 SD): - when executing suspend/resume sequence while interface has been brought up - rebooting the platform while module is plugged and interface has been brought up Those scenarios lead to mmc core trying to initialize again the chip which is now unresponsive (because of the power sequencer setting), so it fails in mmc_rescan->mmc_attach_sdio and enter a failure loop while trying to send CMD5: mmc0: error -110 whilst initialising SDIO card mmc0: error -110 whilst initialising SDIO card mmc0: error -110 whilst initialising SDIO card [...] Preventing the driver from disabling this "power sequencer" fixes those enumeration issues without affecting nominal operations. Signed-off-by: Ajay Singh Signed-off-by: Alexis LothorĂ© --- drivers/net/wireless/microchip/wilc1000/sdio.c | 15 --------------- drivers/net/wireless/microchip/wilc1000/wlan.h | 1 - 2 files changed, 16 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index e6e20c86b791..6461a3ec0120 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -907,27 +907,12 @@ static int wilc_sdio_sync_ext(struct wilc *wilc, int nint) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct wilc_sdio *sdio_priv = wilc->bus_data; - u32 reg; if (nint > MAX_NUM_INT) { dev_err(&func->dev, "Too many interrupts (%d)...\n", nint); return -EINVAL; } - /** - * Disable power sequencer - **/ - if (wilc_sdio_read_reg(wilc, WILC_MISC, ®)) { - dev_err(&func->dev, "Failed read misc reg...\n"); - return -EINVAL; - } - - reg &= ~BIT(8); - if (wilc_sdio_write_reg(wilc, WILC_MISC, reg)) { - dev_err(&func->dev, "Failed write misc reg...\n"); - return -EINVAL; - } - if (sdio_priv->irq_gpio) { u32 reg; int ret, i; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index d72a0a81bbda..dd2fb3c2f06a 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -56,7 +56,6 @@ #define WILC_HOST_RX_CTRL (WILC_PERIPH_REG_BASE + 0x80) #define WILC_HOST_RX_EXTRA_SIZE (WILC_PERIPH_REG_BASE + 0x84) #define WILC_HOST_TX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x88) -#define WILC_MISC (WILC_PERIPH_REG_BASE + 0x428) #define WILC_INTR_REG_BASE (WILC_PERIPH_REG_BASE + 0xa00) #define WILC_INTR_ENABLE WILC_INTR_REG_BASE #define WILC_INTR2_ENABLE (WILC_INTR_REG_BASE + 4) -- 2.45.2