From patchwork Wed Dec 13 21:32:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukrut Bellary X-Patchwork-Id: 13491897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33FEFC4332F for ; Wed, 13 Dec 2023 21:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=du8By2rBwdXmCH9sNWF3xsVE00yogf6X/6052YrR1Ns=; b=feD4Ne4d0F6x3j gW2U/gtjwIAOj2I/X10131aB6bH/4mFAz2au3NCNJq+khmaxU3gPvqDes3mYIC5QxtXk+J+5eqQzx b1RXJzwkJeqjJVWqo5H9+9OIODfPkB0o8ZrmdyoubzkGeuzElIZQRd1oULBrbAFjXBq/ILKXv5cyE tThA/NES1Zly3ZuydADOM4AsOlV0OP0B2WD8kN+yi/SdzVjIBN9HsBs/5XR88ScY7Ty/uMsyt5kuw Kc9a4t6vMmh1e1MFotoqp9JvKTfh1+jBzTqxHGJomFIGHdpXHQk9DQuFS/eneh05+bg3APXDK1g7I 9WrnPrK4Y/onLwuoLFYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDWqR-00G3eD-3D; Wed, 13 Dec 2023 21:32:44 +0000 Received: from mail-pf1-f172.google.com ([209.85.210.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDWqO-00G3d8-0g for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2023 21:32:42 +0000 Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6ce939ecfc2so6932164b3a.2 for ; Wed, 13 Dec 2023 13:32:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702503156; x=1703107956; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9vLldFUT2lj5En/2c0eRbR6cRR7RYkOf947WEF4oTy8=; b=vVV2bouEZ7GbRxERaNlf4rjcInz+Qyc8c/1O6P6hWwIoTMno9RPLE2KLifn4ayOcm1 BthUslQMrxpJD6EDiHkfeESfu7nHQTiClEPEgeb03aSnhtdzvzZhKfG6VpBw/8/YWsjU Xxj6yVuesVD1mSNGyy7qUpm3EKBsfL0K5z9RmaBe5xHPop6LFSaahIQKlgFAazl8/pt2 wOhc61mfNEFzfpYMIrM8B0e25LyVevJm8lxFqjtaVh7JFL8abNHyMZpTyLoDVYmpTTf/ 8sbrP0yxDt8UJ+e7IS/uX6hhCrLeo2odly19+Kl8ZYJ6efoOdG5VpwZIeBxUoGPD41xW T7sQ== X-Gm-Message-State: AOJu0YyNW5TGAfvZZmMM44pTMJTvdUNruWJLf03p/0r4zqct1cK8veBr If9s69h8hVe2qR39Hw3D9bQ= X-Google-Smtp-Source: AGHT+IFeHj1sZHbZlIX7LHxiM+jET3cKuq1LbZO13kqqQ2WkZ3POeQpJjFyD/xFuF7j1BPNZzRS0KQ== X-Received: by 2002:a05:6a00:4601:b0:6cd:f91e:dfe4 with SMTP id ko1-20020a056a00460100b006cdf91edfe4mr9061145pfb.2.1702503155583; Wed, 13 Dec 2023 13:32:35 -0800 (PST) Received: from dev-linux.lan (070-095-021-110.res.spectrum.com. [70.95.21.110]) by smtp.gmail.com with ESMTPSA id p51-20020a056a0026f300b006cef5c09ca3sm3190824pfw.147.2023.12.13.13.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 13:32:35 -0800 (PST) From: Sukrut Bellary To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Sukrut Bellary , Robert Nelson , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, d-gole@ti.com, Shengyu Qu Subject: [PATCH] arm64: dts: ti: k3-am625-beagleplay: Use pwrseq for TI's wl18xx enable. Date: Wed, 13 Dec 2023 13:32:19 -0800 Message-Id: <20231213213219.566369-1-sukrut.bellary@linux.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231213_133240_270481_0B8E3FF8 X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org BeaglePlay SBC has Texas Instrument's WL18xx WiFi Chipset. BeaglePlay SBC: https://www.beagleboard.org/boards/beagleplay TI WL18XX: https://www.ti.com/lit/ds/symlink/wl1807mod.pdf Currently, WLAN_EN is configured as regulator and regulator-always-on. During hibernation thaw, WiFi fails to come online. During freeze/suspend, the WLAN_EN line is not put to low '0' to power down the WiFi. So during restore, the WiFi driver tries to load the FW without following correct power sequence. WLAN_EN => '1'/assert (high) to power-up the chipset. WLAN_EN => '0'/deassert (low) to shut-down the chipset. thaw failure log below: Use mmc-pwrseq-simple to drive TI's WiFi (WL18xx) chipset enable 'WLAN_EN'. mmc-pwrseq-simple provides power sequence flexibility with support for post power-on and power-off delays. ================ thaw failure Log ================ [ 161.418528] ------------[ cut here ]------------ [ 161.418540] WARNING: CPU: 1 PID: 45 at drivers/net/wireless/ti/wlcore/sdio.c:123 wl12xx_sdio_raw_write+0xe4/0x168 [wlcore_sdio] [ 161.418576] Modules linked in: br_netfilter bridge stp llc overlay usb_f_mass_storage usb_f_acm u_serial usb_f_ncm usb_f_rndis u_ether libcomposite wl18xx wlcore mac80211 libarc4 cfg80211 rfkill crct10dif_ce6[ 161.418676] CPU: 1 PID: 45 Comm: kworker/u8:2 Not tainted 6.5.0-rc6+ #2 [ 161.418684] Hardware name: BeagleBoard.org BeaglePlay (DT) [ 161.418691] Workqueue: events_unbound async_run_entry_fn [ 161.418711] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 161.418719] pc : wl12xx_sdio_raw_write+0xe4/0x168 [wlcore_sdio] [ 161.418731] lr : wl12xx_sdio_raw_write+0x94/0x168 [wlcore_sdio] [ 161.418743] sp : ffff800082b43970 [ 161.418746] x29: ffff800082b43970 x28: ffff800083c5b000 x27: 0000000000000003 [ 161.418757] x26: ffff80007aab3800 x25: ffff800083c53000 x24: 0000000000000000 [ 161.418767] x23: 0000000000004000 x22: ffff00000f938000 x21: ffff000005bd3010 [ 161.418778] x20: 0000000000008000 x19: ffff000005bd2000 x18: 0000000000000000 [ 161.418789] x17: 0000000000000100 x16: 0000000000000000 x15: f44fb9a9e0200014 [ 161.418799] x14: 0000000000000049 x13: 000000000000038f x12: 0000000000000000 [ 161.418809] x11: 0000000000000001 x10: 0000000000000a50 x9 : ffff800082b43550 [ 161.418819] x8 : ffff000000ca2830 x7 : ffff00007fb92f40 x6 : 00000007e5428bd2 [ 161.418829] x5 : 03ffffffffffffff x4 : ffff0000002569c0 x3 : 0000000000000000 [ 161.418839] x2 : 0000000000000001 x1 : ffff000000256810 x0 : 00000000ffffff92 [ 161.418850] Call trace: [ 161.418856] wl12xx_sdio_raw_write+0xe4/0x168 [wlcore_sdio] [ 161.418869] wlcore_raw_write.constprop.0+0x4c/0xac [wlcore] [ 161.418931] wlcore_boot_upload_firmware+0x140/0x3c0 [wlcore] [ 161.418973] wl18xx_boot+0x574/0x77c [wl18xx] [ 161.419011] wl1271_op_add_interface+0x5f0/0xaa8 [wlcore] [ 161.419052] drv_add_interface+0x3c/0x88 [mac80211] [ 161.419228] ieee80211_reconfig+0x1a8/0xf1c [mac80211] [ 161.419330] ieee80211_resume+0x54/0x70 [mac80211] [ 161.419432] wiphy_resume+0x84/0xf8 [cfg80211] [ 161.419562] device_resume+0x84/0x178 [ 161.419576] async_resume+0x28/0x74 [ 161.419584] async_run_entry_fn+0x34/0xe0 [ 161.419596] process_one_work+0x1e0/0x340 [ 161.419605] worker_thread+0x68/0x428 [ 161.419613] kthread+0x114/0x118 [ 161.419620] ret_from_fork+0x10/0x20 [ 161.419630] ---[ end trace 0000000000000000 ]--- [ 161.419726] wl1271_sdio mmc2:0001:2: sdio write failed (-110) [ 162.341981] wlcore: using inverted interrupt logic: 2 [ 170.553515] ------------[ cut here ]------------ [ 180.315942] ieee80211 phy0: PM: dpm_run_callback(): wiphy_resume+0x0/0xf8 [cfg80211] returns -110 [ 180.316090] ieee80211 phy0: PM: failed to thaw async: error -110 ====================================================== Full thaw failure log - https://gist.github.com/sukrutb/8b02a9ffa7bd1cb9fb514220e9af097e Suggested-by: Shengyu Qu Signed-off-by: Sukrut Bellary --- .../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts index eadbdd9ffe37..d388c5e78658 100644 --- a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts @@ -83,6 +83,15 @@ wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9db00000 { }; }; + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_en_pins_default>; + post-power-on-delay-ms = <1>; + power-off-delay-us = <80>; + reset-gpios = <&main_gpio0 38 GPIO_ACTIVE_LOW>; + }; + vsys_5v0: regulator-1 { bootph-all; compatible = "regulator-fixed"; @@ -105,20 +114,6 @@ vdd_3v3: regulator-2 { regulator-boot-on; }; - wlan_en: regulator-3 { - /* OUTPUT of SN74AVC2T244DQMR */ - compatible = "regulator-fixed"; - regulator-name = "wlan_en"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - enable-active-high; - regulator-always-on; - vin-supply = <&vdd_3v3>; - gpio = <&main_gpio0 38 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&wifi_en_pins_default>; - }; - vdd_3v3_sd: regulator-4 { /* output of TPS22918DBVR-U21 */ bootph-all; @@ -849,7 +844,6 @@ &sdhci1 { }; &sdhci2 { - vmmc-supply = <&wlan_en>; pinctrl-names = "default"; pinctrl-0 = <&wifi_pins_default>, <&wifi_32k_clk>; bus-width = <4>; @@ -857,6 +851,7 @@ &sdhci2 { ti,fails-without-test-cd; cap-power-off-card; keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; ti,driver-strength-ohm = <50>; assigned-clocks = <&k3_clks 157 158>; assigned-clock-parents = <&k3_clks 157 160>;