From de326662a6a32883a987a79ad903faf59b800f53 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:04 -0600 Subject: [PATCH 01/10] trusty: ipc: Submit shared-memory handles as premapped buffers Trusty IPC allocates and shares message storage before queuing it. The virtqueue descriptor must carry that shared-memory handle, not the address of the message-buffer bookkeeping structure. Set the scatterlist DMA fields explicitly and use the premapped virtqueue helpers for TX, initial RX and recycled RX. Remove the transport's private DMA override. The combined local stack passed Trusty IPC and AoC startup on lynx on November 13. This changes the shared transport on every Trusty board; Pixel 7 Pro IPC, AoC and dependent-service regression testing is required. This preparation is rebased and has not run on hardware. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/trusty/trusty-ipc.c | 21 +++++++++++++++------ drivers/trusty/trusty-virtio.c | 25 ++----------------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/drivers/trusty/trusty-ipc.c b/drivers/trusty/trusty-ipc.c index 470089df6d..1010b64448 100644 --- a/drivers/trusty/trusty-ipc.c +++ b/drivers/trusty/trusty-ipc.c @@ -432,6 +432,15 @@ static struct tipc_msg_buf *vds_get_txbuf(struct tipc_virtio_dev *vds, return mb; } +/* Trusty descriptors contain shared-memory handles, not physical addresses. */ +static void tipc_msg_buf_sg(struct scatterlist *sg, struct tipc_msg_buf *mb, + size_t len) +{ + sg_init_one(sg, mb->buf_va, len); + sg_dma_address(sg) = mb->buf_id; + sg_dma_len(sg) = len; +} + static int vds_queue_txbuf(struct tipc_virtio_dev *vds, struct tipc_msg_buf *mb) { @@ -441,8 +450,8 @@ static int vds_queue_txbuf(struct tipc_virtio_dev *vds, mutex_lock(&vds->lock); if (vds->state == VDS_ONLINE) { - sg_init_one(&sg, mb, mb->wpos); - err = virtqueue_add_outbuf(vds->txvq, &sg, 1, mb, GFP_KERNEL); + tipc_msg_buf_sg(&sg, mb, mb->wpos); + err = virtqueue_add_outbuf_premapped(vds->txvq, &sg, 1, mb, GFP_KERNEL); need_notify = virtqueue_kick_prepare(vds->txvq); } else { err = -ENODEV; @@ -2089,8 +2098,8 @@ static int _handle_rxbuf(struct tipc_virtio_dev *vds, drop_it: /* add the buffer back to the virtqueue */ - sg_init_one(&sg, rxbuf, rxbuf->buf_sz); - err = virtqueue_add_inbuf(vds->rxvq, &sg, 1, rxbuf, GFP_KERNEL); + tipc_msg_buf_sg(&sg, rxbuf, rxbuf->buf_sz); + err = virtqueue_add_inbuf_premapped(vds->rxvq, &sg, 1, rxbuf, NULL, GFP_KERNEL); if (err < 0) { dev_err(dev, "failed to add a virtqueue buffer: %d\n", err); return err; @@ -2201,8 +2210,8 @@ static int tipc_virtio_probe(struct virtio_device *vdev) goto err_free_rx_buffers; } - sg_init_one(&sg, rxbuf, rxbuf->buf_sz); - err = virtqueue_add_inbuf(vds->rxvq, &sg, 1, rxbuf, GFP_KERNEL); + tipc_msg_buf_sg(&sg, rxbuf, rxbuf->buf_sz); + err = virtqueue_add_inbuf_premapped(vds->rxvq, &sg, 1, rxbuf, NULL, GFP_KERNEL); WARN_ON(err); /* sanity check; this can't really happen */ } diff --git a/drivers/trusty/trusty-virtio.c b/drivers/trusty/trusty-virtio.c index ae70fd4d74..bb50db5b94 100644 --- a/drivers/trusty/trusty-virtio.c +++ b/drivers/trusty/trusty-virtio.c @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -232,8 +231,8 @@ static int trusty_virtio_finalize_features(struct virtio_device *vdev) u64 features = vdev->features; /* - * We set VIRTIO_F_ACCESS_PLATFORM to enable the dma mapping hooks. - * The other side does not need to know. + * IPC buffers are already shared with Trusty and use the premapped + * virtqueue API. Keep the local mapping feature out of its feature word. */ features &= ~(1ULL << VIRTIO_F_ACCESS_PLATFORM); @@ -699,24 +698,6 @@ static int trusty_virtio_add_devices(struct trusty_ctx *tctx) return ret; } -/* - * The IPC driver maps its message buffers through this device; the "DMA - * address" handed to Trusty is the buffer's shared memory id. - */ -static dma_addr_t trusty_virtio_dma_map_phys(struct device *dev, - phys_addr_t phys, size_t size, - enum dma_data_direction dir, - unsigned long attrs) -{ - struct tipc_msg_buf *buf = phys_to_virt(phys); - - return buf->buf_id; -} - -static const struct dma_map_ops trusty_virtio_dma_map_ops = { - .map_phys = trusty_virtio_dma_map_phys, -}; - static int trusty_virtio_probe(struct platform_device *pdev) { int ret; @@ -734,8 +715,6 @@ static int trusty_virtio_probe(struct platform_device *pdev) INIT_WORK(&tctx->kick_vqs, kick_vqs); platform_set_drvdata(pdev, tctx); - set_dma_ops(&pdev->dev, &trusty_virtio_dma_map_ops); - tctx->check_wq = alloc_workqueue("trusty-check-wq", WQ_UNBOUND | WQ_HIGHPRI, 0); if (!tctx->check_wq) { From 606acfce4f48f5b66df75620b8ec0104af46121d Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:04 -0600 Subject: [PATCH 02/10] soc: google: aoc: Preserve GSA probe deferral GSA may defer until its Trusty IPC channel is available. Preserve that error from find_gsa_device() so the driver core can retry AoC instead of turning a supplier dependency into a permanent invalid-argument failure. The combined lynx test stack reached 82 services on November 13. The error propagation also changes shared AoC probe behavior; reference-phone startup must be requalified before merge. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/soc/google/aoc/aoc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/soc/google/aoc/aoc.c b/drivers/soc/google/aoc/aoc.c index 366bdca832..a68e9482da 100644 --- a/drivers/soc/google/aoc/aoc.c +++ b/drivers/soc/google/aoc/aoc.c @@ -2751,8 +2751,7 @@ static int aoc_platform_probe(struct platform_device *pdev) rc = find_gsa_device(prvdata); if (rc) { - dev_err(dev, "Failed to initialize gsa device: %d\n", rc); - rc = -EINVAL; + dev_err_probe(dev, rc, "failed to initialize GSA device\n"); goto err_failed_prvdata_alloc; } From 6cf20ccee3715a88055c9bdf04ef9f2069c863ba Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:04 -0600 Subject: [PATCH 03/10] soc: google: aoc: Map chip ID without a second resource claim The exynos-chipid driver already owns the read-only chip-ID resource. AoC needs a mapping of the same range, so keep resource lookup and error handling but do not reserve the range a second time. The combined lynx test stack reached AoC online with this mapping. This is shared code and still requires Pixel 7 Pro startup validation; the rebased preparation has not run on either phone. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/soc/google/aoc/aoc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/soc/google/aoc/aoc.c b/drivers/soc/google/aoc/aoc.c index a68e9482da..0824243ccd 100644 --- a/drivers/soc/google/aoc/aoc.c +++ b/drivers/soc/google/aoc/aoc.c @@ -2837,10 +2837,15 @@ static int aoc_platform_probe(struct platform_device *pdev) goto err_watchdog_iommu_irq; } } - prvdata->chipid_virt = - devm_platform_ioremap_resource_byname(pdev, "chipid"); - if (IS_ERR(prvdata->chipid_virt)) { - rc = PTR_ERR(prvdata->chipid_virt); + /* exynos-chipid owns this read-only range; do not claim it again. */ + rsrc = platform_get_resource_byname(pdev, IORESOURCE_MEM, "chipid"); + if (!rsrc) { + rc = -EINVAL; + goto err_watchdog_iommu_irq; + } + prvdata->chipid_virt = devm_ioremap(dev, rsrc->start, resource_size(rsrc)); + if (!prvdata->chipid_virt) { + rc = -ENOMEM; goto err_watchdog_iommu_irq; } aoc_chipid_virt = prvdata->chipid_virt; From 103acaf99c06dc202eafcafa2bd3e92a183eb095 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:04 -0600 Subject: [PATCH 04/10] soc: google: aoc: Expose firmware readiness to WLAN consumers WLAN power on lynx must wait for the specified AoC firmware to be online, not just for the platform device to exist. Export a read-only state query and an optional phandle check which fails closed for an invalid or offline supplier. Boards without the dependency keep their existing consumer path. This is a point-in-time readiness check, not a lifetime guarantee across AoC crashes or removal. It supports the attended manual lab sequence; automatic startup, retry notification and restart handling need review. The combined local stack passed once; this rebase is not runtime-tested. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/soc/google/aoc/aoc.c | 11 ++++++++ include/linux/soc/google/gs201-aoc.h | 38 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 include/linux/soc/google/gs201-aoc.h diff --git a/drivers/soc/google/aoc/aoc.c b/drivers/soc/google/aoc/aoc.c index 0824243ccd..9a9bc9ed16 100644 --- a/drivers/soc/google/aoc/aoc.c +++ b/drivers/soc/google/aoc/aoc.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,16 @@ enum AOC_FW_STATE aoc_state; struct platform_device *aoc_platform_device; +bool gs201_aoc_firmware_online(const struct device_node *np) +{ + struct platform_device *pdev = READ_ONCE(aoc_platform_device); + + /* No MMIO or access to the protected firmware carve-out. */ + return pdev && pdev->dev.of_node == np && + READ_ONCE(aoc_state) == AOC_STATE_ONLINE; +} +EXPORT_SYMBOL_GPL(gs201_aoc_firmware_online); + /* TODO: Reduce the global variables (move into a driver structure) */ /* Resources found from the device tree */ struct resource *aoc_sram_resource; diff --git a/include/linux/soc/google/gs201-aoc.h b/include/linux/soc/google/gs201-aoc.h new file mode 100644 index 0000000000..894c441d20 --- /dev/null +++ b/include/linux/soc/google/gs201-aoc.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _LINUX_SOC_GOOGLE_GS201_AOC_H +#define _LINUX_SOC_GOOGLE_GS201_AOC_H + +#include +#include +#include +#include + +#if IS_REACHABLE(CONFIG_GS201_AOC) +bool gs201_aoc_firmware_online(const struct device_node *np); +#else +static inline bool gs201_aoc_firmware_online(const struct device_node *np) +{ + return false; +} +#endif + +/* Optional for other boards; a malformed dependency must not permit power. */ +static inline int gs201_aoc_require_online(struct device *dev) +{ + struct device_node *np; + + if (!of_find_property(dev->of_node, "google,aoc", NULL)) + return 0; + + np = of_parse_phandle(dev->of_node, "google,aoc", 0); + if (!np) + return -EINVAL; + if (!gs201_aoc_firmware_online(np)) { + of_node_put(np); + return -EPROBE_DEFER; + } + of_node_put(np); + return 0; +} + +#endif From 497f2d510763bb4902e8ba4a8e12d2c19deb72f2 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 05/10] dt-bindings: regulator: qcom,qca6390: Describe an AoC dependency Describe the optional AoC firmware supplier used by lynx before WLAN power assertion. The existing WCN6855 Bluetooth path does not gain the property by default; it will be applied only by the attended test overlay. This binding accompanies experimental sequencing code and does not enable hardware or redistribute firmware. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- .../devicetree/bindings/regulator/qcom,qca6390-pmu.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml b/Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml index 105174df7d..8c3f9cf060 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml +++ b/Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml @@ -31,6 +31,12 @@ properties: vdd-supply: description: VDD supply regulator handle + google,aoc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + AoC supplying the WLAN boot strap. Its firmware must be online before + acquiring the enable GPIO or enabling the WLAN target. + vddaon-supply: description: VDD_AON supply regulator handle From cf0c84692adb29acb1f12bb3e9768a24becf08fe Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 06/10] power: sequencing: qcom-wcn: Check AoC before WLAN power When an AoC phandle is supplied, defer before GPIO acquisition and check readiness again before asserting WLAN_EN. Initialize that WLAN GPIO low. Consumers without the property retain GPIOD_ASIS and their existing path. Use the tristate dependency to avoid a built-in consumer referencing a modular AoC symbol. This limits that configuration combination globally and must be considered when reviewing the cross-subsystem dependency. One combined lynx connection passed; Bluetooth coexistence, unattended startup and the rebased source remain unqualified. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/power/sequencing/Kconfig | 1 + drivers/power/sequencing/pwrseq-qcom-wcn.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/power/sequencing/Kconfig b/drivers/power/sequencing/Kconfig index 226c62704d..fc87fc87c1 100644 --- a/drivers/power/sequencing/Kconfig +++ b/drivers/power/sequencing/Kconfig @@ -17,6 +17,7 @@ config POWER_SEQUENCING_QCOM_WCN tristate "Qualcomm WCN family PMU driver" default m if ARCH_QCOM depends on OF || COMPILE_TEST + depends on GS201_AOC || !GS201_AOC help Say Y here to enable the power sequencing driver for Qualcomm WCN Bluetooth/WLAN chipsets. diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c index d41793e1fc..27822b511d 100644 --- a/drivers/power/sequencing/pwrseq-qcom-wcn.c +++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,7 @@ struct pwrseq_qcom_wcn_pdata { }; struct pwrseq_qcom_wcn_ctx { + struct device *dev; struct pwrseq_device *pwrseq; struct device_node *of_node; const struct pwrseq_qcom_wcn_pdata *pdata; @@ -200,8 +202,15 @@ static const struct pwrseq_unit_data pwrseq_qcom_wcn6855_bt_unit_data = { static int pwrseq_qcom_wcn_wlan_enable(struct pwrseq_device *pwrseq) { struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); + int ret; pwrseq_qcom_wcn_ensure_gpio_delay(ctx); + ret = gs201_aoc_require_online(ctx->dev); + if (ret) + return ret; + if (of_find_property(ctx->of_node, "google,aoc", NULL)) + dev_info(ctx->dev, "AoC online; asserting WLAN_EN\n"); + gpiod_set_value_cansleep(ctx->wlan_gpio, 1); ctx->last_gpio_enable_jf = jiffies; @@ -461,11 +470,17 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev) struct pwrseq_config config; int i, ret; + /* The GPIO acquisition below preserves its level: defer before that too. */ + ret = gs201_aoc_require_online(dev); + if (ret) + return dev_err_probe(dev, ret, "AoC firmware is not online\n"); + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; ctx->of_node = dev->of_node; + ctx->dev = dev; ctx->pdata = device_get_match_data(dev); if (!ctx->pdata) @@ -504,7 +519,8 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev) * the link down handling is implemented in the controller driver. */ ctx->wlan_gpio = devm_gpiod_get_optional(dev, "wlan-enable", - GPIOD_ASIS); + of_find_property(dev->of_node, "google,aoc", NULL) ? + GPIOD_OUT_LOW : GPIOD_ASIS); if (IS_ERR(ctx->wlan_gpio)) return dev_err_probe(dev, PTR_ERR(ctx->wlan_gpio), "Failed to get the WLAN enable GPIO\n"); From 4f09a37133e4c0c6580437cf297dfc467cd6cf38 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 07/10] dt-bindings: PCI: google,gs201: Describe lynx MSI and AoC ordering Describe the lynx controller variant and its AoC firmware supplier. The variant uses the wrapper's combined DWC MSI interrupt; the existing gs201 compatible retains its INTx implementation. Hardware remains disabled in the board preparation. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- .../bindings/pci/google,gs201-pcie.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/google,gs201-pcie.yaml b/Documentation/devicetree/bindings/pci/google,gs201-pcie.yaml index 19181b1434..c9d9fcff32 100644 --- a/Documentation/devicetree/bindings/pci/google,gs201-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/google,gs201-pcie.yaml @@ -22,6 +22,14 @@ description: the controller interrupt by a child interrupt controller. allOf: + - if: + properties: + compatible: + contains: + const: google,gs201-lynx-pcie + then: + required: + - google,aoc - $ref: /schemas/pci/pci-host-bridge.yaml# - $ref: /schemas/pci/snps,dw-pcie-common.yaml# - if: @@ -45,6 +53,14 @@ properties: - items: - const: google,zumapro-pcie - const: google,zuma-pcie + - items: + - const: google,gs201-lynx-pcie + - const: google,gs201-pcie + + google,aoc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + AoC whose firmware must be online before powering the WLAN endpoint. reg: minItems: 3 From fd4f799a0d3287207a41add6355e4fc491aba32d Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 08/10] PCI: dwc: gs201: Add lynx combined MSI handling after link reset Select the DWC MSI host setup for the lynx compatible and dispatch it from the shared ELBI handler. Publish the initialized domain before IRQ enablement, restore the MSI rising-edge enable after link reset, and synchronize MSI teardown before destroying its domain. Export the DWC handler for a modular gs201 host. Check the optional AoC supplier before probe and host initialization. The existing compatible retains its INTx host operations; the optional supplier is absent on reference boards. Shared functions and the Kconfig relationship still need reference-device review. Firmware and scan passed in the local lynx stack. That earlier stack later stalled during connection, so this commit is not a qualified connection fix. No rebased candidate has booted. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/pci/controller/dwc/Kconfig | 1 + .../pci/controller/dwc/pcie-designware-host.c | 1 + drivers/pci/controller/dwc/pcie-gs201.c | 83 +++++++++++++++++-- 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index f5226c8db0..0b50af4158 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig @@ -422,6 +422,7 @@ config PCIE_GS201 tristate "Google gs201 PCIe controller (host mode)" depends on OF && (ARCH_EXYNOS || COMPILE_TEST) depends on PCI_MSI + depends on GS201_AOC || !GS201_AOC select PCIE_DW_HOST select PCI_PWRCTRL_GENERIC help diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index f5a38e6fd8..31e1566647 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -85,6 +85,7 @@ void dw_handle_msi_irq(struct dw_pcie_rp *pp) generic_handle_demux_domain_irq(pp->irq_domain, irq_off + pos); } } +EXPORT_SYMBOL_GPL(dw_handle_msi_irq); /* Chained MSI interrupt service routine */ static void dw_chained_msi_isr(struct irq_desc *desc) diff --git a/drivers/pci/controller/dwc/pcie-gs201.c b/drivers/pci/controller/dwc/pcie-gs201.c index b114c6be96..d53edd8de8 100644 --- a/drivers/pci/controller/dwc/pcie-gs201.c +++ b/drivers/pci/controller/dwc/pcie-gs201.c @@ -10,8 +10,8 @@ * controller/dwc-whi/pcie-exynos-rc.c (exynos_pcie_rc_resumed_phydown(), * exynos_pcie_rc_poweron() and exynos_pcie_rc_establish_link()). * - * Only legacy INTx interrupts are supported, which is what the Pixel 7 Wi-Fi - * uses on stock firmware too. + * Pixel 7 Wi-Fi uses legacy INTx. Pixel 7a uses the DWC iMSI-RX, demuxed + * from the shared ELBI interrupt after link reset has completed. * * Bring-up runs in numbered stages, each touching one more part of the * hardware. The stop_after parameter ends probe after a given stage, and @@ -40,6 +40,7 @@ #include #include #include +#include #include "pcie-designware.h" @@ -53,6 +54,7 @@ #define GS201_ELBI_IRQ1_LINK_DOWN BIT(10) #define GS201_ELBI_IRQ2 0x008 #define GS201_ELBI_IRQ2_CPL_TIMEOUT BIT(24) +#define GS201_ELBI_IRQ2_MSI_RISING BIT(17) #define GS201_ELBI_IRQ0_EN 0x010 #define GS201_ELBI_IRQ1_EN 0x014 #define GS201_ELBI_IRQ2_EN 0x018 @@ -176,10 +178,12 @@ MODULE_PARM_DESC(cmu_acg_off, * the soft power reset before the PHY powers down, as Google's * exynos_pcie_rc_poweroff() does for the zuma family. Only zumapro so * far: it hasn't run on a zuma board here. + * @wcn_msi: lynx's WCN endpoint requires iMSI-RX and online AoC firmware */ struct gs201_pcie_soc_data { bool ctrl_reset_before_phy; bool pwr_reset_before_phy_off; + bool wcn_msi; }; struct gs201_pcie { @@ -203,6 +207,7 @@ struct gs201_pcie { bool phy_on; int irq; struct irq_domain *intx_domain; + bool msi_ready; raw_spinlock_t lock; }; @@ -439,8 +444,10 @@ static bool gs201_pcie_link_up(struct dw_pcie *pci) ltssm <= DW_PCIE_LTSSM_L1_IDLE; } -static void gs201_pcie_enable_irqs(struct gs201_pcie *gp) +static int gs201_pcie_enable_irqs(struct gs201_pcie *gp) { + u32 enabled; + gs201_trace(gp, "about to clear ELBI IRQ0-2 and enable link-down and completion-timeout interrupts"); /* Clear anything latched during training */ @@ -453,6 +460,21 @@ static void gs201_pcie_enable_irqs(struct gs201_pcie *gp) gs201_elbi_rmw(gp, GS201_ELBI_IRQ1_EN, 0, GS201_ELBI_IRQ1_LINK_DOWN); gs201_elbi_rmw(gp, GS201_ELBI_IRQ2_EN, 0, GS201_ELBI_IRQ2_CPL_TIMEOUT); + /* Link soft reset clears this bit too. Arm only after the link is up. */ + if (gp->data->wcn_msi) { + if (upper_32_bits(gp->pci.pp.msi_data)) + return dev_err_probe(gp->pci.dev, -ERANGE, + "MSI target exceeds 32 bits\n"); + gs201_elbi_rmw(gp, GS201_ELBI_IRQ2_EN, 0, + GS201_ELBI_IRQ2_MSI_RISING); + enabled = gs201_elbi_readl(gp, GS201_ELBI_IRQ2_EN); + if (!(enabled & GS201_ELBI_IRQ2_MSI_RISING)) + return dev_err_probe(gp->pci.dev, -EIO, + "MSI interrupt enable did not latch\n"); + dev_info(gp->pci.dev, "MSI armed after link up, ELBI IRQ2_EN %#x\n", + enabled); + } + return 0; } static void gs201_pcie_disable_irqs(struct gs201_pcie *gp) @@ -816,14 +838,22 @@ static int gs201_pcie_start_link(struct dw_pcie *pci) return ret; } - /* - * Leave the LTSSM running even on failure: dw_pcie_wait_for_link() - * reports the final state, and a card that shows up late can still - * train. - */ + /* MSI must be armed before the DWC core can enumerate an endpoint. */ + if (ret && gp->data->wcn_msi) + return ret; + + /* The existing INTx path permits a card to train during DWC's wait. */ if (!ret) { dev_info(dev, "link up on try %u\n", try); - gs201_pcie_enable_irqs(gp); + /* Publish the initialized MSI domain before the handler uses it. */ + smp_store_release(&gp->msi_ready, gp->data->wcn_msi); + ret = gs201_pcie_enable_irqs(gp); + if (ret) { + WRITE_ONCE(gp->msi_ready, false); + gs201_pcie_disable_irqs(gp); + synchronize_irq(gp->irq); + return ret; + } gs201_pcie_check_iocc(gp, "after link up"); } @@ -839,7 +869,10 @@ static void gs201_pcie_stop_link(struct dw_pcie *pci) { struct gs201_pcie *gp = to_gs201_pcie(pci); + WRITE_ONCE(gp->msi_ready, false); gs201_pcie_disable_irqs(gp); + if (gp->data->wcn_msi) + synchronize_irq(gp->irq); gs201_elbi_writel(gp, GS201_ELBI_LTSSM_EN, 0); } @@ -865,6 +898,10 @@ static int gs201_pcie_host_init(struct dw_pcie_rp *pp) struct device *dev = pci->dev; int ret; + ret = gs201_aoc_require_online(dev); + if (ret) + return ret; + gpiod_set_value_cansleep(gp->perst, 1); ret = gs201_pcie_bringup(gp, GS201_STAGE_WAKE, false); @@ -951,6 +988,11 @@ static const struct dw_pcie_host_ops gs201_pcie_host_ops = { .msi_init = gs201_pcie_msi_init, }; +static const struct dw_pcie_host_ops gs201_pcie_host_ops_msi = { + .init = gs201_pcie_host_init, + .deinit = gs201_pcie_host_deinit, +}; + static void gs201_pcie_intx_mask(struct irq_data *d) { struct gs201_pcie *gp = irq_data_get_irq_chip_data(d); @@ -1026,6 +1068,11 @@ static void gs201_pcie_irq_handler(struct irq_desc *desc) for_each_set_bit(bit, &intx, PCI_NUM_INTX) generic_handle_domain_irq(gp->intx_domain, bit); + /* DWC owns the MSI domain; our handler owns the shared interrupt. */ + /* Pairs with publication after link training, before IRQ enable. */ + if (smp_load_acquire(&gp->msi_ready)) + dw_handle_msi_irq(&gp->pci.pp); + chained_irq_exit(chip, desc); } @@ -1164,6 +1211,10 @@ static int gs201_pcie_probe(struct platform_device *pdev) struct resource *res; int ret; + ret = gs201_aoc_require_online(dev); + if (ret) + return dev_err_probe(dev, ret, "AoC firmware is not online\n"); + gp = devm_kzalloc(dev, sizeof(*gp), GFP_KERNEL); if (!gp) return -ENOMEM; @@ -1175,6 +1226,15 @@ static int gs201_pcie_probe(struct platform_device *pdev) pci->dev = dev; pci->ops = &gs201_pcie_dw_ops; pci->pp.ops = &gs201_pcie_host_ops; + if (gp->data->wcn_msi) { + if (!pci_msi_enabled()) + return dev_err_probe(dev, -ENODEV, "lynx requires PCI MSI\n"); + if (!of_find_property(np, "google,aoc", NULL)) + return dev_err_probe(dev, -EINVAL, "missing AoC dependency\n"); + pci->pp.ops = &gs201_pcie_host_ops_msi; + pci->pp.msi_irq[0] = -ENXIO; + pci->pp.num_vectors = MAX_MSI_IRQS_PER_CTRL; + } dev_info(dev, "stage 0/%u: %s (stop_after=%u, trace=%d, use_ia=%d, cmu_acg_off=%d)\n", GS201_STAGE_LINK, gs201_stage_names[GS201_STAGE_NONE], @@ -1258,6 +1318,10 @@ static void gs201_pcie_remove(struct platform_device *pdev) static const struct gs201_pcie_soc_data gs201_pcie_data = { }; +static const struct gs201_pcie_soc_data lynx_pcie_data = { + .wcn_msi = true, +}; + static const struct gs201_pcie_soc_data zuma_pcie_data = { .ctrl_reset_before_phy = true, }; @@ -1268,6 +1332,7 @@ static const struct gs201_pcie_soc_data zumapro_pcie_data = { }; static const struct of_device_id gs201_pcie_of_match[] = { + { .compatible = "google,gs201-lynx-pcie", .data = &lynx_pcie_data }, { .compatible = "google,gs201-pcie", .data = &gs201_pcie_data }, { .compatible = "google,zumapro-pcie", .data = &zumapro_pcie_data }, { .compatible = "google,zuma-pcie", .data = &zuma_pcie_data }, From 628facc0867dfafca9f486cc8138dc1403a748e4 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 09/10] PCI: dwc: gs201: Rearm the lynx MSI edge after dispatch A vector arriving behind the DWC dispatch snapshot can leave the MSI output asserted after the wrapper has consumed its rising edge. Pulse the DWC masks under its IRQ-chip lock, preserving Linux's current masks, so pending status can assert a new edge. This follows the mask-pulse mechanism in Google's GPL combined-MSI handler. One guarded connection and verified HTTPS request passed on lynx with this candidate on November 13. An earlier WMI/TX stall remains unexplained; the result does not establish that this change fixes it. Keep this candidate separate for review, stress testing and possible rejection. It is selected only by the new lynx compatible. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- drivers/pci/controller/dwc/pcie-gs201.c | 29 ++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-gs201.c b/drivers/pci/controller/dwc/pcie-gs201.c index d53edd8de8..89a2552bb3 100644 --- a/drivers/pci/controller/dwc/pcie-gs201.c +++ b/drivers/pci/controller/dwc/pcie-gs201.c @@ -883,6 +883,33 @@ static const struct dw_pcie_ops gs201_pcie_dw_ops = { .stop_link = gs201_pcie_stop_link, }; +static void gs201_pcie_handle_msi(struct gs201_pcie *gp) +{ + struct dw_pcie_rp *pp = &gp->pci.pp; + unsigned long flags; + unsigned int ctrl, num_ctrls; + u32 offset; + + dw_handle_msi_irq(pp); + + /* + * The wrapper latches a rising edge, while iMSI-RX remains asserted + * until all unmasked status bits are cleared. A lower vector arriving + * while an upper vector is handled can miss the status snapshot and + * leave the line high without another edge. As Google's combined-MSI + * handler does, pulse the mask to re-pend it. Preserve Linux's masks + * under the same lock used by the DWC IRQ chip's mask/unmask paths. + */ + num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL; + raw_spin_lock_irqsave(&pp->lock, flags); + for (ctrl = 0; ctrl < num_ctrls; ctrl++) { + offset = PCIE_MSI_INTR0_MASK + ctrl * MSI_REG_CTRL_BLOCK_SIZE; + dw_pcie_writel_dbi(&gp->pci, offset, U32_MAX); + dw_pcie_writel_dbi(&gp->pci, offset, pp->irq_mask[ctrl]); + } + raw_spin_unlock_irqrestore(&pp->lock, flags); +} + static void gs201_pcie_irq_handler(struct irq_desc *desc); /* @@ -1071,7 +1098,7 @@ static void gs201_pcie_irq_handler(struct irq_desc *desc) /* DWC owns the MSI domain; our handler owns the shared interrupt. */ /* Pairs with publication after link training, before IRQ enable. */ if (smp_load_acquire(&gp->msi_ready)) - dw_handle_msi_irq(&gp->pci.pp); + gs201_pcie_handle_msi(gp); chained_irq_exit(chip, desc); } From dfdf8ce251c89d3cd05a6325c61ed7ea1c61a741 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 14 Nov 2026 09:32:05 -0600 Subject: [PATCH 10/10] arm64: dts: exynos: google: lynx: Describe disabled WLAN PCIe Describe the WCN6855 endpoint, virtual PMU supplies and lynx controller variant, keeping PCIe explicitly disabled. Define but do not select the low WLAN_EN pin state. Label the existing PMU for the separate lab overlay. Do not add an AoC dependency or WLAN GPIO to the existing enabled PMU in the shipping tree: that would alter its already working Bluetooth path. The mobile bring-up overlay opts into those experimental properties and the low pin state only for an attended test. The local November 13 stack provides the underlying one-run evidence; this disabled-by-default revision is a new preparation and has not booted. No boot-time Wi-Fi enablement or firmware is included. Assisted-by: OpenAI Codex Signed-off-by: Chris Gray --- .../boot/dts/exynos/google/gs201-lynx.dts | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/exynos/google/gs201-lynx.dts b/arch/arm64/boot/dts/exynos/google/gs201-lynx.dts index b43ff60bad..bfdfa02c40 100644 --- a/arch/arm64/boot/dts/exynos/google/gs201-lynx.dts +++ b/arch/arm64/boot/dts/exynos/google/gs201-lynx.dts @@ -200,7 +200,7 @@ regulator-always-on; }; - wcn6855-pmu { + lynx_wcn_pmu: wcn6855-pmu { compatible = "qcom,wcn6855-pmu"; pinctrl-0 = <&bt_reg_on>; pinctrl-names = "default"; @@ -269,6 +269,46 @@ /* gph2 (the buck's GPIO) is on HSI2, disabled in gs201.dtsi. */ &pinctrl_hsi2 { status = "okay"; + + lynx_wlan_low: wlan-low-pins { + samsung,pins = "gph2-4"; + samsung,pin-function = ; + samsung,pin-val = <0>; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; +}; + +/* Bench only: disabled until an attended, watchdog-protected test. */ +&pcie_1 { + status = "disabled"; + compatible = "google,gs201-lynx-pcie", "google,gs201-pcie"; + google,aoc = <&aoc>; + + pcie@0,0 { + compatible = "pciclass,0604"; + device_type = "pci"; + reg = <0 0 0 0 0>; + bus-range = <0x01 0xff>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@0,0 { + compatible = "pci17cb,1103"; + reg = <0x10000 0 0 0 0>; + qcom,ath11k-calibration-variant = "google,gs201-lynx"; + vddrfacmn-supply = <&vreg_pmu_rfa_cmn_0p8>; + vddaon-supply = <&vreg_pmu_aon_0p8>; + vddwlcx-supply = <&vreg_pmu_wlcx_0p8>; + vddwlmx-supply = <&vreg_pmu_wlmx_0p8>; + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; + vddrfa1p8-supply = <&vreg_pmu_rfa_1p7>; + vddpcie0p9-supply = <&vreg_pmu_pcie_0p9>; + vddpcie1p8-supply = <&vreg_pmu_pcie_1p8>; + }; + }; }; &pinctrl_peric0 {