* [PATCH] wifi: mt76: mt7925: Add coredump callback in pci_driver
@ 2026-05-05 5:52 JB Tsai
0 siblings, 0 replies; only message in thread
From: JB Tsai @ 2026-05-05 5:52 UTC (permalink / raw)
To: nbd, lorenzo
Cc: linux-wireless, linux-mediatek, Deren.Wu, Sean.Wang, Quan.Zhou,
Ryder.Lee, Leon.Yen, litien.chang, jeff.hsu, jb.tsai, Jeff Hsu
From: Jeff Hsu <Jeff.Hsu@mediatek.com>
Register coredump callback(mt7925_coredump) in pci_driver,
it can let platform can trigger core dump to collect the
log and recover back after coredump complete without debugfs
Some platform not have debugfs
Signed-off-by: Jeff Hsu <Jeff.Hsu@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 1 +
drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 37cdf3e8a067..cd502166a7f9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -1014,6 +1014,7 @@ int mt7925_mcu_chip_config(struct mt792x_dev *dev, const char *cmd)
return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(CHIP_CONFIG),
&req, sizeof(req), false);
}
+EXPORT_SYMBOL_GPL(mt7925_mcu_chip_config);
int mt7925_mcu_set_deep_sleep(struct mt792x_dev *dev, bool enable)
{
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index c4161754c01d..5b3e62e5f157 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -610,6 +610,17 @@ static int mt7925_pci_restore(struct device *device)
return _mt7925_pci_resume(device, true);
}
+static void mt7925_coredump(struct device *dev)
+{
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct mt76_dev *mdev = pci_get_drvdata(pdev);
+ struct mt792x_dev *dev_792x = container_of(mdev, struct mt792x_dev, mt76);
+
+ mt792x_mutex_acquire(dev_792x);
+ mt7925_mcu_chip_config(dev_792x, "assert");
+ mt792x_mutex_release(dev_792x);
+}
+
static const struct dev_pm_ops mt7925_pm_ops = {
.suspend = pm_sleep_ptr(mt7925_pci_suspend),
.resume = pm_sleep_ptr(mt7925_pci_resume),
@@ -626,6 +637,7 @@ static struct pci_driver mt7925_pci_driver = {
.remove = mt7925_pci_remove,
.shutdown = mt7925_pci_shutdown,
.driver.pm = pm_sleep_ptr(&mt7925_pm_ops),
+ .driver.coredump = mt7925_coredump,
};
module_pci_driver(mt7925_pci_driver);
--
2.45.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-05 5:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 5:52 [PATCH] wifi: mt76: mt7925: Add coredump callback in pci_driver JB Tsai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox