summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-03-29 21:57:58 +0200
committerFelix Fietkau <nbd@nbd.name>2023-04-17 16:08:49 +0200
commit09d4d6da1b65d09414e7bce61459593f3c80ead1 (patch)
treee06a39d23371f76db39b647d642ac94f36e6ad5a /drivers/net
parentwifi: mt76: mt7921: use driver flags rather than mac80211 flags to mcu (diff)
downloadlinux-09d4d6da1b65d09414e7bce61459593f3c80ead1.tar.xz
linux-09d4d6da1b65d09414e7bce61459593f3c80ead1.zip
wifi: mt76: mt7921e: Set memory space enable in PCI_COMMAND if unset
When the BIOS has been configured for Fast Boot, systems with mt7921e have non-functional wifi. Turning on Fast boot caused both bus master enable and memory space enable bits in PCI_COMMAND not to get configured. The mt7921 driver already sets bus master enable, but explicitly check and set memory access enable as well to fix this problem. Tested-by: Anson Tsao <anson.tsao@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Acked-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
index b520cd258170..974412b6f76a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -262,6 +262,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
struct mt76_dev *mdev;
u8 features;
int ret;
+ u16 cmd;
ret = pcim_enable_device(pdev);
if (ret)
@@ -271,6 +272,11 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
+ pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+ if (!(cmd & PCI_COMMAND_MEMORY)) {
+ cmd |= PCI_COMMAND_MEMORY;
+ pci_write_config_word(pdev, PCI_COMMAND, cmd);
+ }
pci_set_master(pdev);
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);