* [PATCH] wifi: mt76: mt7925: Add flag to control if need DMA re-init
@ 2026-07-06 2:43 JB Tsai
2026-08-06 21:11 ` kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: JB Tsai @ 2026-07-06 2:43 UTC (permalink / raw)
To: nbd, lorenzo
Cc: linux-wireless, linux-mediatek, Sean.Wang, Quan.Zhou, Ryder.Lee,
Leon.Yen, litien.chang, jeff.hsu, jb.tsai, Jeff Hsu
From: Jeff Hsu <Jeff.Hsu@mediatek.com>
Add flag(skip_wpdma_reinit) to control if need do DMA re-init
Signed-off-by: Jeff Hsu <Jeff.Hsu@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 4 ++++
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 5 +++++
3 files changed, 10 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index c8537a5cdf67..154e4372664e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -650,6 +650,10 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
if (!mt7925_disable_aspm && mt76_pci_aspm_supported(pdev))
dev->aspm_supported = true;
+ /* MT7935 does not need wpdma reinit */
+ if (is_mt7928(&dev->mt76))
+ dev->skip_wpdma_reinit = true;
+
ret = __mt792x_mcu_fw_pmctrl(dev);
if (ret)
goto err_free_dev;
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index 8c7ecd3ce126..18d6e2c35606 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -271,6 +271,7 @@ struct mt792x_dev {
bool hif_idle:1;
bool hif_resumed:1;
bool regd_change:1;
+ bool skip_wpdma_reinit:1;
wait_queue_head_t wait;
struct work_struct init_work;
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_dma.c b/drivers/net/wireless/mediatek/mt76/mt792x_dma.c
index 8ad94fa58340..8308935491d3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_dma.c
@@ -418,6 +418,11 @@ int mt792x_wpdma_reinit_cond(struct mt792x_dev *dev)
struct mt76_connac_pm *pm = &dev->pm;
int err;
+ /* Skip wpdma reinit if chip doesn't need it */
+ if (dev->skip_wpdma_reinit) {
+ return 0;
+ }
+
/* check if the wpdma must be reinitialized */
if (mt792x_dma_need_reinit(dev)) {
/* disable interrutpts */
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: mt76: mt7925: Add flag to control if need DMA re-init
2026-07-06 2:43 [PATCH] wifi: mt76: mt7925: Add flag to control if need DMA re-init JB Tsai
@ 2026-08-06 21:11 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-08-06 21:11 UTC (permalink / raw)
To: JB Tsai, nbd, lorenzo
Cc: oe-kbuild-all, linux-wireless, linux-mediatek, Sean.Wang,
Quan.Zhou, Ryder.Lee, Leon.Yen, litien.chang, jeff.hsu, jb.tsai
Hi JB,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless/main]
[also build test ERROR on linus/master v7.2-rc6]
[cannot apply to wireless-next/main next-20260806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/JB-Tsai/wifi-mt76-mt7925-Add-flag-to-control-if-need-DMA-re-init/20260807-004748
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main
patch link: https://lore.kernel.org/r/20260706024306.47806-1-jb.tsai%40mediatek.com
patch subject: [PATCH] wifi: mt76: mt7925: Add flag to control if need DMA re-init
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260807/202608070519.XrTS2LxW-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260807/202608070519.XrTS2LxW-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608070519.XrTS2LxW-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/wireless/mediatek/mt76/mt7925/pci.c: In function 'mt7925_pci_probe':
>> drivers/net/wireless/mediatek/mt76/mt7925/pci.c:434:13: error: implicit declaration of function 'is_mt7928'; did you mean 'is_mt7922'? [-Wimplicit-function-declaration]
434 | if (is_mt7928(&dev->mt76))
| ^~~~~~~~~
| is_mt7922
vim +434 drivers/net/wireless/mediatek/mt76/mt7925/pci.c
300
301 static const struct mt792x_irq_map mt7927_irq_map = {
302 .host_irq_enable = MT_WFDMA0_HOST_INT_ENA,
303 .tx = {
304 .all_complete_mask = MT_INT_TX_DONE_ALL,
305 .mcu_complete_mask = MT_INT_TX_DONE_MCU,
306 },
307 .rx = {
308 .data_complete_mask = MT7927_RX_DONE_INT_ENA4,
309 .wm_complete_mask = MT7927_RX_DONE_INT_ENA6,
310 .wm2_complete_mask = MT7927_RX_DONE_INT_ENA7,
311 },
312 };
313 static int mt7925_pci_probe(struct pci_dev *pdev,
314 const struct pci_device_id *id)
315 {
316 static const struct mt76_driver_ops drv_ops = {
317 /* txwi_size = txd size + txp size */
318 .txwi_size = MT_TXD_SIZE + sizeof(struct mt76_connac_hw_txp),
319 .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ |
320 MT_DRV_AMSDU_OFFLOAD,
321 .survey_flags = SURVEY_INFO_TIME_TX |
322 SURVEY_INFO_TIME_RX |
323 SURVEY_INFO_TIME_BSS_RX,
324 .token_size = MT7925_TOKEN_SIZE,
325 .tx_prepare_skb = mt7925e_tx_prepare_skb,
326 .tx_complete_skb = mt76_connac_tx_complete_skb,
327 .rx_check = mt7925_rx_check,
328 .rx_skb = mt7925_queue_rx_skb,
329 .rx_poll_complete = mt792x_rx_poll_complete,
330 .sta_add = mt7925_mac_sta_add,
331 .sta_event = mt7925_mac_sta_event,
332 .sta_remove = mt7925_mac_sta_remove,
333 .update_survey = mt792x_update_channel,
334 };
335 static const struct mt792x_hif_ops mt7925_pcie_ops = {
336 .init_reset = mt7925e_init_reset,
337 .reset = mt7925e_mac_reset,
338 .mcu_init = mt7925e_mcu_init,
339 .drv_own = mt792xe_mcu_drv_pmctrl,
340 .fw_own = mt792xe_mcu_fw_pmctrl,
341 };
342 static const struct mt792x_irq_map irq_map = {
343 .host_irq_enable = MT_WFDMA0_HOST_INT_ENA,
344 .tx = {
345 .all_complete_mask = MT_INT_TX_DONE_ALL,
346 .mcu_complete_mask = MT_INT_TX_DONE_MCU,
347 },
348 .rx = {
349 .data_complete_mask = HOST_RX_DONE_INT_ENA2,
350 .wm_complete_mask = HOST_RX_DONE_INT_ENA0,
351 },
352 };
353 struct ieee80211_ops *ops;
354 struct mt76_bus_ops *bus_ops;
355 struct mt792x_dev *dev;
356 struct mt76_dev *mdev;
357 bool is_mt7927_hw;
358 u8 features;
359 int ret;
360 u16 cmd;
361
362 ret = pcim_enable_device(pdev);
363 if (ret)
364 return ret;
365
366 ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
367 if (ret)
368 return ret;
369
370 pci_read_config_word(pdev, PCI_COMMAND, &cmd);
371 if (!(cmd & PCI_COMMAND_MEMORY)) {
372 cmd |= PCI_COMMAND_MEMORY;
373 pci_write_config_word(pdev, PCI_COMMAND, cmd);
374 }
375 pci_set_master(pdev);
376
377 ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
378 if (ret < 0)
379 return ret;
380
381 ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
382 if (ret)
383 goto err_free_pci_vec;
384
385 is_mt7927_hw = (pdev->device == 0x6639 || pdev->device == 0x7927 ||
386 pdev->device == 0x0738);
387
388 /* MT7927: ASPM L1 causes unreliable WFDMA register access */
389 if (mt7925_disable_aspm || is_mt7927_hw)
390 mt76_pci_disable_aspm(pdev);
391
392 ops = mt792x_get_mac80211_ops(&pdev->dev, &mt7925_ops,
393 (void *)id->driver_data, &features);
394 if (!ops) {
395 ret = -ENOMEM;
396 goto err_free_pci_vec;
397 }
398
399 mdev = mt76_alloc_device(&pdev->dev, sizeof(*dev), ops, &drv_ops);
400 if (!mdev) {
401 ret = -ENOMEM;
402 goto err_free_pci_vec;
403 }
404
405 pci_set_drvdata(pdev, mdev);
406
407 dev = container_of(mdev, struct mt792x_dev, mt76);
408 dev->fw_features = features;
409 dev->hif_ops = &mt7925_pcie_ops;
410 dev->irq_map = is_mt7927_hw ? &mt7927_irq_map : &irq_map;
411 mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
412 tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
413
414 dev->phy.dev = dev;
415 dev->phy.mt76 = &dev->mt76.phy;
416 dev->mt76.phy.priv = &dev->phy;
417 dev->bus_ops = dev->mt76.bus;
418 bus_ops = devm_kmemdup(dev->mt76.dev, dev->bus_ops, sizeof(*bus_ops),
419 GFP_KERNEL);
420 if (!bus_ops) {
421 ret = -ENOMEM;
422 goto err_free_dev;
423 }
424
425 bus_ops->rr = mt7925_rr;
426 bus_ops->wr = mt7925_wr;
427 bus_ops->rmw = mt7925_rmw;
428 dev->mt76.bus = bus_ops;
429
430 if (!mt7925_disable_aspm && mt76_pci_aspm_supported(pdev))
431 dev->aspm_supported = true;
432
433 /* MT7935 does not need wpdma reinit */
> 434 if (is_mt7928(&dev->mt76))
435 dev->skip_wpdma_reinit = true;
436
437 ret = __mt792x_mcu_fw_pmctrl(dev);
438 if (ret)
439 goto err_free_dev;
440
441 ret = __mt792xe_mcu_drv_pmctrl(dev);
442 if (ret)
443 goto err_free_dev;
444
445 mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) |
446 (mt76_rr(dev, MT_HW_REV) & 0xff);
447
448 dev_info(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
449
450 if (is_mt7927_hw && mt76_chip(mdev) != 0x7927) {
451 dev_info(mdev->dev,
452 "MT7927 raw CHIPID=0x%04x, forcing chip=0x7927\n",
453 mt76_chip(mdev));
454 mdev->rev = (0x7927 << 16) | (mdev->rev & 0xff);
455 }
456
457 mt76_rmw_field(dev, MT_HW_EMI_CTL, MT_HW_EMI_CTL_SLPPROT_EN, 1);
458
459 ret = mt792x_wfsys_reset(dev);
460 if (ret)
461 goto err_free_dev;
462
463 mt76_wr(dev, irq_map.host_irq_enable, 0);
464
465 mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
466
467 ret = devm_request_irq(mdev->dev, pdev->irq, mt792x_irq_handler,
468 IRQF_SHARED, KBUILD_MODNAME, dev);
469 if (ret)
470 goto err_free_dev;
471
472 if (is_mt7927(&dev->mt76))
473 ret = mt7927_dma_init(dev);
474 else if (is_mt7925(&dev->mt76))
475 ret = mt7925_dma_init(dev);
476 else
477 ret = -EINVAL;
478
479 if (ret)
480 goto err_free_irq;
481
482 ret = mt7925_register_device(dev);
483 if (ret)
484 goto err_free_dma;
485
486 return 0;
487
488 err_free_dma:
489 mt792x_dma_cleanup(dev);
490 err_free_irq:
491 devm_free_irq(&pdev->dev, pdev->irq, dev);
492 err_free_dev:
493 mt76_free_device(&dev->mt76);
494 err_free_pci_vec:
495 pci_free_irq_vectors(pdev);
496
497 return ret;
498 }
499
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-06 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 2:43 [PATCH] wifi: mt76: mt7925: Add flag to control if need DMA re-init JB Tsai
2026-08-06 21:11 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox