Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v6.12-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci

Pull pci fixes from Bjorn Helgaas:

- Hold the rescan lock while adding devices to avoid race with
concurrent pwrctl rescan that can lead to a crash (Bartosz
Golaszewski)

- Avoid binding pwrctl driver to QCom WCN wifi if the DT lacks the
necessary PMU regulator descriptions (Bartosz Golaszewski)

* tag 'pci-v6.12-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
PCI/pwrctl: Abandon QCom WCN probe on pre-pwrseq device-trees
PCI: Hold rescan lock while adding devices during host probe

+52 -5
+2
drivers/pci/probe.c
··· 3105 3105 list_for_each_entry(child, &bus->children, node) 3106 3106 pcie_bus_configure_settings(child); 3107 3107 3108 + pci_lock_rescan_remove(); 3108 3109 pci_bus_add_devices(bus); 3110 + pci_unlock_rescan_remove(); 3109 3111 return 0; 3110 3112 } 3111 3113 EXPORT_SYMBOL_GPL(pci_host_probe);
+50 -5
drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
··· 6 6 #include <linux/device.h> 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 - #include <linux/of.h> 10 9 #include <linux/pci-pwrctl.h> 11 10 #include <linux/platform_device.h> 11 + #include <linux/property.h> 12 12 #include <linux/pwrseq/consumer.h> 13 13 #include <linux/slab.h> 14 14 #include <linux/types.h> ··· 16 16 struct pci_pwrctl_pwrseq_data { 17 17 struct pci_pwrctl ctx; 18 18 struct pwrseq_desc *pwrseq; 19 + }; 20 + 21 + struct pci_pwrctl_pwrseq_pdata { 22 + const char *target; 23 + /* 24 + * Called before doing anything else to perform device-specific 25 + * verification between requesting the power sequencing handle. 26 + */ 27 + int (*validate_device)(struct device *dev); 28 + }; 29 + 30 + static int pci_pwrctl_pwrseq_qcm_wcn_validate_device(struct device *dev) 31 + { 32 + /* 33 + * Old device trees for some platforms already define wifi nodes for 34 + * the WCN family of chips since before power sequencing was added 35 + * upstream. 36 + * 37 + * These nodes don't consume the regulator outputs from the PMU, and 38 + * if we allow this driver to bind to one of such "incomplete" nodes, 39 + * we'll see a kernel log error about the indefinite probe deferral. 40 + * 41 + * Check the existence of the regulator supply that exists on all 42 + * WCN models before moving forward. 43 + */ 44 + if (!device_property_present(dev, "vddaon-supply")) 45 + return -ENODEV; 46 + 47 + return 0; 48 + } 49 + 50 + static const struct pci_pwrctl_pwrseq_pdata pci_pwrctl_pwrseq_qcom_wcn_pdata = { 51 + .target = "wlan", 52 + .validate_device = pci_pwrctl_pwrseq_qcm_wcn_validate_device, 19 53 }; 20 54 21 55 static void devm_pci_pwrctl_pwrseq_power_off(void *data) ··· 61 27 62 28 static int pci_pwrctl_pwrseq_probe(struct platform_device *pdev) 63 29 { 30 + const struct pci_pwrctl_pwrseq_pdata *pdata; 64 31 struct pci_pwrctl_pwrseq_data *data; 65 32 struct device *dev = &pdev->dev; 66 33 int ret; 34 + 35 + pdata = device_get_match_data(dev); 36 + if (!pdata || !pdata->target) 37 + return -EINVAL; 38 + 39 + if (pdata->validate_device) { 40 + ret = pdata->validate_device(dev); 41 + if (ret) 42 + return ret; 43 + } 67 44 68 45 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 69 46 if (!data) 70 47 return -ENOMEM; 71 48 72 - data->pwrseq = devm_pwrseq_get(dev, of_device_get_match_data(dev)); 49 + data->pwrseq = devm_pwrseq_get(dev, pdata->target); 73 50 if (IS_ERR(data->pwrseq)) 74 51 return dev_err_probe(dev, PTR_ERR(data->pwrseq), 75 52 "Failed to get the power sequencer\n"); ··· 109 64 { 110 65 /* ATH11K in QCA6390 package. */ 111 66 .compatible = "pci17cb,1101", 112 - .data = "wlan", 67 + .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata, 113 68 }, 114 69 { 115 70 /* ATH11K in WCN6855 package. */ 116 71 .compatible = "pci17cb,1103", 117 - .data = "wlan", 72 + .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata, 118 73 }, 119 74 { 120 75 /* ATH12K in WCN7850 package. */ 121 76 .compatible = "pci17cb,1107", 122 - .data = "wlan", 77 + .data = &pci_pwrctl_pwrseq_qcom_wcn_pdata, 123 78 }, 124 79 { } 125 80 };