From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>,
Kalle Valo <quic_kvalo@quicinc.com>,
Sasha Levin <sashal@kernel.org>,
kvalo@kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, ath11k@lists.infradead.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.0 26/77] wifi: ath11k: Register shutdown handler for WCN6750
Date: Sun, 9 Oct 2022 18:07:03 -0400 [thread overview]
Message-ID: <20221009220754.1214186-26-sashal@kernel.org> (raw)
In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org>
From: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
[ Upstream commit ac41c2b642b136a1e633379fcb87a9db0ee07f5b ]
When the system shuts down, SMMU driver will be stopped and
will not assist in IOVA translations. SMMU driver expects all
of its consumers to shutdown before shutting down itself.
WCN6750 being one of the consumer device should not perform any
DMA operations after the SMMU has shutdown which will otherwise
result in SMMU faults.
SMMU driver will call the shutdown() callback of all its
consumer devices and the consumers shall stop further DMA
activity after the invocation of their respective shutdown()
callbacks.
Register the shutdown() callback to the platform core for WCN6750.
Change will not impact other AHB ath11k devices.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220720134710.15523-1-quic_mpubbise@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/ahb.c | 58 ++++++++++++++++++++------
drivers/net/wireless/ath/ath11k/core.c | 2 +
2 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index c47414710138..911eee9646a4 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1088,20 +1088,10 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
return ret;
}
-static int ath11k_ahb_remove(struct platform_device *pdev)
+static void ath11k_ahb_remove_prepare(struct ath11k_base *ab)
{
- struct ath11k_base *ab = platform_get_drvdata(pdev);
unsigned long left;
- if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {
- ath11k_ahb_power_down(ab);
- ath11k_debugfs_soc_destroy(ab);
- ath11k_qmi_deinit_service(ab);
- goto qmi_fail;
- }
-
- reinit_completion(&ab->driver_recovery);
-
if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) {
left = wait_for_completion_timeout(&ab->driver_recovery,
ATH11K_AHB_RECOVERY_TIMEOUT);
@@ -1111,19 +1101,60 @@ static int ath11k_ahb_remove(struct platform_device *pdev)
set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags);
cancel_work_sync(&ab->restart_work);
+ cancel_work_sync(&ab->qmi.event_work);
+}
+
+static void ath11k_ahb_free_resources(struct ath11k_base *ab)
+{
+ struct platform_device *pdev = ab->pdev;
- ath11k_core_deinit(ab);
-qmi_fail:
ath11k_ahb_free_irq(ab);
ath11k_hal_srng_deinit(ab);
ath11k_ahb_fw_resource_deinit(ab);
ath11k_ce_free_pipes(ab);
ath11k_core_free(ab);
platform_set_drvdata(pdev, NULL);
+}
+
+static int ath11k_ahb_remove(struct platform_device *pdev)
+{
+ struct ath11k_base *ab = platform_get_drvdata(pdev);
+
+ if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {
+ ath11k_ahb_power_down(ab);
+ ath11k_debugfs_soc_destroy(ab);
+ ath11k_qmi_deinit_service(ab);
+ goto qmi_fail;
+ }
+
+ ath11k_ahb_remove_prepare(ab);
+ ath11k_core_deinit(ab);
+
+qmi_fail:
+ ath11k_ahb_free_resources(ab);
return 0;
}
+static void ath11k_ahb_shutdown(struct platform_device *pdev)
+{
+ struct ath11k_base *ab = platform_get_drvdata(pdev);
+
+ /* platform shutdown() & remove() are mutually exclusive.
+ * remove() is invoked during rmmod & shutdown() during
+ * system reboot/shutdown.
+ */
+ ath11k_ahb_remove_prepare(ab);
+
+ if (!(test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)))
+ goto free_resources;
+
+ ath11k_core_deinit(ab);
+
+free_resources:
+ ath11k_ahb_free_resources(ab);
+}
+
static struct platform_driver ath11k_ahb_driver = {
.driver = {
.name = "ath11k",
@@ -1131,6 +1162,7 @@ static struct platform_driver ath11k_ahb_driver = {
},
.probe = ath11k_ahb_probe,
.remove = ath11k_ahb_remove,
+ .shutdown = ath11k_ahb_shutdown,
};
static int ath11k_ahb_init(void)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index c3e9e4f7bc24..9df6aaae8a44 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -1563,6 +1563,8 @@ static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
wake_up(&ab->wmi_ab.tx_credits_wq);
wake_up(&ab->peer_mapping_wq);
+
+ reinit_completion(&ab->driver_recovery);
}
static void ath11k_core_post_reconfigure_recovery(struct ath11k_base *ab)
--
2.35.1
next prev parent reply other threads:[~2022-10-09 22:12 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221009220754.1214186-1-sashal@kernel.org>
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 03/77] wifi: rtw88: phy: fix warning of possible buffer overflow Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 04/77] wifi: ath10k: Set tx credit to one for WCN3990 snoc based devices Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 05/77] wifi: brcmfmac: fix invalid address access when enabling SCAN log level Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 07/77] ice: set tx_tstamps when creating new Tx rings via ethtool Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 08/77] net: ethernet: ti: davinci_mdio: Add workaround for errata i2329 Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 09/77] openvswitch: Fix double reporting of drops in dropwatch Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 10/77] openvswitch: Fix overreporting " Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 11/77] net: dsa: all DSA masters must be down when changing the tagging protocol Sasha Levin
2022-10-10 11:54 ` Vladimir Oltean
2022-10-13 18:15 ` Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 12/77] net: mscc: ocelot: adjust forwarding domain for CPU ports in a LAG Sasha Levin
2022-10-10 11:57 ` Vladimir Oltean
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 13/77] tcp: annotate data-race around tcp_md5sig_pool_populated Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 14/77] micrel: ksz8851: fixes struct pointer issue Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 15/77] wifi: mac80211: accept STA changes without link changes Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 16/77] wifi: mac80211: fix control port frame addressing Sasha Levin
2022-10-10 7:03 ` Johannes Berg
2022-10-13 18:16 ` Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 17/77] genetlink: hold read cb_lock during iteration of genl_fam_idr in genl_bind() Sasha Levin
2022-10-10 15:49 ` Jakub Kicinski
2022-10-13 18:16 ` Sasha Levin
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 18/77] net: dsa: mv88e6xxx: Allow external SMI if serial Sasha Levin
2022-10-10 11:54 ` Vladimir Oltean
2022-10-09 22:06 ` [PATCH AUTOSEL 6.0 20/77] wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg() Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 23/77] net: axienet: Switch to 64-bit RX/TX statistics Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 24/77] net-next: Fix IP_UNICAST_IF option behavior for connected sockets Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 25/77] xfrm: Update ipcomp_scratches with NULL when freed Sasha Levin
2022-10-09 22:07 ` Sasha Levin [this message]
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 27/77] rtw89: ser: leave lps with mutex Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 28/77] net: broadcom: Fix return type for implementation of Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 29/77] net: xscale: Fix return type for implementation of ndo_start_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 30/77] net: sunplus: " Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 31/77] net: lantiq_etop: " Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 32/77] netlink: Bounds-check struct nlmsgerr creation Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 33/77] net: ftmac100: fix endianness-related issues from 'sparse' Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 34/77] iavf: Fix race between iavf_close and iavf_reset_task Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 35/77] wifi: brcmfmac: fix use-after-free bug in brcmf_netdev_start_xmit() Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 36/77] net: sparx5: fix function return type to match actual type Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 37/77] net: mscc: ocelot: report FIFO drop counters through stats->rx_dropped Sasha Levin
2022-10-10 11:57 ` Vladimir Oltean
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 40/77] wifi: ath11k: mhi: fix potential memory leak in ath11k_mhi_register() Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 41/77] wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 42/77] wifi: rtw89: free unused skb to prevent memory leak Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 43/77] wifi: rtw89: fix rx filter after scan Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 44/77] Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 45/77] net: ax88796c: Fix return type of ax88796c_start_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 46/77] net: davicom: Fix return type of dm9000_start_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 47/77] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 48/77] net: ethernet: litex: Fix return type of liteeth_start_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 49/77] net: korina: Fix return type of korina_send_packet Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 50/77] net: wwan: iosm: Fix return type of ipc_wwan_link_transmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 51/77] net: wwan: t7xx: Fix return type of t7xx_ccmni_start_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 52/77] net: sfp: re-implement soft state polling setup Sasha Levin
2022-10-10 7:21 ` Russell King (Oracle)
2022-10-13 18:01 ` Sasha Levin
2022-10-13 22:06 ` Russell King (Oracle)
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 53/77] net: sfp: move quirk handling into sfp.c Sasha Levin
2022-10-10 7:15 ` Russell King (Oracle)
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 54/77] net: sfp: move Alcatel Lucent 3FE46541AA fixup Sasha Levin
2022-10-10 7:16 ` Russell King (Oracle)
2022-10-13 18:01 ` Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 55/77] net/sched: taprio: taprio_dump and taprio_change are protected by rtnl_mutex Sasha Levin
2022-10-10 11:57 ` Vladimir Oltean
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 56/77] Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 57/77] Bluetooth: hci_event: Make sure ISO events don't affect non-ISO connections Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 58/77] wifi: ath10k: reset pointer after memory free to avoid potential use-after-free Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 59/77] bnxt_en: replace reset with config timestamps Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 61/77] can: bcm: check the result of can_send() in bcm_can_tx() Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 62/77] wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620 Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 63/77] wifi: rt2x00: set correct TX_SW_CFG1 MAC register for MT7620 Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 64/77] wifi: rt2x00: set VGC gain for both chains of MT7620 Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 65/77] wifi: rt2x00: set SoC wmac clock register Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 66/77] wifi: rt2x00: correctly set BBP register 86 for MT7620 Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 68/77] net: If sock is dead don't access sock's sk_wq in sk_stream_wait_memory Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 70/77] bpf: use bpf_prog_pack for bpf_dispatcher Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 71/77] Bluetooth: L2CAP: Fix user-after-free Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 72/77] net: sched: cls_u32: Avoid memcpy() false-positive warning Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 75/77] net: sparx5: Fix return type of sparx5_port_xmit_impl Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 76/77] net: lan966x: Fix return type of lan966x_port_xmit Sasha Levin
2022-10-09 22:07 ` [PATCH AUTOSEL 6.0 77/77] r8152: Rate limit overflow messages Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009220754.1214186-26-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_kvalo@quicinc.com \
--cc=quic_mpubbise@quicinc.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).