0055-wifi-ath11k-Remove-redundant-pci_clear_master.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From f812e2a9f85d6bea78957ccb5197e4491316848b Mon Sep 17 00:00:00 2001
  2. From: Cai Huoqing <cai.huoqing@linux.dev>
  3. Date: Thu, 23 Mar 2023 19:26:09 +0800
  4. Subject: [PATCH] wifi: ath11k: Remove redundant pci_clear_master
  5. Remove pci_clear_master to simplify the code,
  6. the bus-mastering is also cleared in do_pci_disable_device,
  7. like this:
  8. ./drivers/pci/pci.c:2197
  9. static void do_pci_disable_device(struct pci_dev *dev)
  10. {
  11. u16 pci_command;
  12. pci_read_config_word(dev, PCI_COMMAND, &pci_command);
  13. if (pci_command & PCI_COMMAND_MASTER) {
  14. pci_command &= ~PCI_COMMAND_MASTER;
  15. pci_write_config_word(dev, PCI_COMMAND, pci_command);
  16. }
  17. pcibios_disable_device(dev);
  18. }.
  19. And dev->is_busmaster is set to 0 in pci_disable_device.
  20. Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
  21. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  22. Link: https://lore.kernel.org/r/20230323112613.7550-1-cai.huoqing@linux.dev
  23. ---
  24. drivers/net/wireless/ath/ath11k/pci.c | 5 +----
  25. 1 file changed, 1 insertion(+), 4 deletions(-)
  26. --- a/drivers/net/wireless/ath/ath11k/pci.c
  27. +++ b/drivers/net/wireless/ath/ath11k/pci.c
  28. @@ -540,7 +540,7 @@ static int ath11k_pci_claim(struct ath11
  29. if (!ab->mem) {
  30. ath11k_err(ab, "failed to map pci bar %d\n", ATH11K_PCI_BAR_NUM);
  31. ret = -EIO;
  32. - goto clear_master;
  33. + goto release_region;
  34. }
  35. ab->mem_ce = ab->mem;
  36. @@ -548,8 +548,6 @@ static int ath11k_pci_claim(struct ath11
  37. ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem);
  38. return 0;
  39. -clear_master:
  40. - pci_clear_master(pdev);
  41. release_region:
  42. pci_release_region(pdev, ATH11K_PCI_BAR_NUM);
  43. disable_device:
  44. @@ -565,7 +563,6 @@ static void ath11k_pci_free_region(struc
  45. pci_iounmap(pci_dev, ab->mem);
  46. ab->mem = NULL;
  47. - pci_clear_master(pci_dev);
  48. pci_release_region(pci_dev, ATH11K_PCI_BAR_NUM);
  49. if (pci_is_enabled(pci_dev))
  50. pci_disable_device(pci_dev);