* [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode
@ 2026-06-14 8:34 Pengyu Luo
2026-06-14 8:34 ` [PATCH 2/2] spi: qcom-geni: " Pengyu Luo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Pengyu Luo @ 2026-06-14 8:34 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, linux-spi, devicetree, linux-kernel, Pengyu Luo
Some devices (such as gaokun3) do not disable FIFO mode, causing the
driver to fallback to FIFO mode by default. However, these platforms
also support GSI mode, which is highly preferred for certain
peripherals like SPI touchscreens to improve performance.
Introduce the "qcom,force-gsi-mode" device property to hint and force
the controller into GSI mode during initialization.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
.../devicetree/bindings/spi/qcom,spi-geni-qcom.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
index edf399681d7a..80e394c1c715 100644
--- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
+++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
@@ -45,6 +45,11 @@ properties:
- const: tx
- const: rx
+ qcom,force-gsi-mode:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ Use DMA (GSI) mode, even if FIFO mode is not disabled.
+
interconnects:
minItems: 2
maxItems: 3
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] spi: qcom-geni: Add property to force GSI mode
2026-06-14 8:34 [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode Pengyu Luo
@ 2026-06-14 8:34 ` Pengyu Luo
2026-06-14 8:48 ` sashiko-bot
2026-06-14 10:40 ` [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: " sashiko-bot
2026-06-14 10:55 ` Mark Brown
2 siblings, 1 reply; 5+ messages in thread
From: Pengyu Luo @ 2026-06-14 8:34 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Gross, Bjorn Andersson
Cc: linux-arm-msm, linux-spi, devicetree, linux-kernel, Pengyu Luo
Some devices (such as gaokun3) do not disable FIFO mode, causing the
driver to fallback to FIFO mode by default. However, these platforms
also support GSI mode, which is highly preferred for certain
peripherals like SPI touchscreens to improve performance.
Introduce the "qcom,force-gsi-mode" device property to hint and force
the controller into GSI mode during initialization.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
drivers/spi/spi-geni-qcom.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 26e723cfea61..eece7312f780 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -102,6 +102,7 @@ struct spi_geni_master {
int irq;
bool cs_flag;
bool abort_failed;
+ bool force_gsi_mode;
struct dma_chan *tx;
struct dma_chan *rx;
int cur_xfer_mode;
@@ -655,6 +656,9 @@ static int spi_geni_init(struct spi_geni_master *mas)
mas->oversampling = 1;
fifo_disable = readl(se->base + GENI_IF_DISABLE_RO) & FIFO_IF_DISABLE;
+ if (mas->force_gsi_mode)
+ fifo_disable = 1;
+
switch (fifo_disable) {
case 1:
ret = spi_geni_grab_gpi_chan(mas);
@@ -1133,6 +1137,9 @@ static int spi_geni_probe(struct platform_device *pdev)
if (ret)
return ret;
+ if (device_property_read_bool(&pdev->dev, "qcom,force-gsi-mode"))
+ mas->force_gsi_mode = true;
+
ret = spi_geni_init(mas);
if (ret)
return ret;
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] spi: qcom-geni: Add property to force GSI mode
2026-06-14 8:34 ` [PATCH 2/2] spi: qcom-geni: " Pengyu Luo
@ 2026-06-14 8:48 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-06-14 8:48 UTC (permalink / raw)
To: Pengyu Luo; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Forcing GSI mode via `qcom,force-gsi-mode` fails to update the hardware configuration registers (`SE_FIFO_IF_DISABLE` and `SE_DMA_IF_EN`), leaving the hardware and software in inconsistent states.
- [Medium] The new `qcom,force-gsi-mode` property is functionally redundant and bypasses the existing `qcom,enable-gsi-dma` property, muddying the device tree bindings.
--
commit 7902ba1d5ce1661e61400f2f7a40e6f1185b3264
Author: Pengyu Luo <mitltlatltl@gmail.com>
spi: qcom-geni: Add property to force GSI mode
This commit introduces a "qcom,force-gsi-mode" property to force the
controller into GSI mode during initialization for devices that do not
disable FIFO mode by default.
> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
> index 26e723cfea61e..eece7312f7805 100644
> --- a/drivers/spi/spi-geni-qcom.c
> +++ b/drivers/spi/spi-geni-qcom.c
[ ... ]
> @@ -655,6 +656,9 @@ static int spi_geni_init(struct spi_geni_master *mas)
> mas->oversampling = 1;
>
> fifo_disable = readl(se->base + GENI_IF_DISABLE_RO) & FIFO_IF_DISABLE;
> + if (mas->force_gsi_mode)
> + fifo_disable = 1;
> +
[Severity: High]
Does overriding this local variable actually configure the hardware for GSI DMA
mode?
Looking at the hardware initialization, geni_load_se_fw() is the only place
where SE_FIFO_IF_DISABLE and SE_DMA_IF_EN are written. By just overriding
fifo_disable here, the driver will attempt to use GENI_GPI_DMA mode while
the hardware's core FIFO interface might still be enabled and the DMA
interface disabled.
Could this lead to DMA failures, timeouts, or lockups since the software and
hardware states are inconsistent?
> switch (fifo_disable) {
> case 1:
> ret = spi_geni_grab_gpi_chan(mas);
[ ... ]
> @@ -1133,6 +1137,9 @@ static int spi_geni_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> + if (device_property_read_bool(&pdev->dev, "qcom,force-gsi-mode"))
> + mas->force_gsi_mode = true;
> +
[Severity: Medium]
Is this new property functionally redundant?
The subsystem already supports the qcom,enable-gsi-dma device tree property
to configure GSI DMA mode, which is parsed in geni_load_se_firmware().
Would introducing qcom,force-gsi-mode create overlapping bindings for the
same hardware configuration and pollute the device tree ABI?
It seems this new property might be introduced to work around an internal
software parsing order issue where geni_load_se_firmware() is skipped if the
firmware is already loaded.
> ret = spi_geni_init(mas);
> if (ret)
> return ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260614083424.464132-1-mitltlatltl@gmail.com?part=2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode
2026-06-14 8:34 [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode Pengyu Luo
2026-06-14 8:34 ` [PATCH 2/2] spi: qcom-geni: " Pengyu Luo
@ 2026-06-14 10:40 ` sashiko-bot
2026-06-14 10:55 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-06-14 10:40 UTC (permalink / raw)
To: Pengyu Luo; +Cc: robh, devicetree, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `qcom,force-gsi-mode` property dictates driver software behavior instead of describing hardware configuration, violating Devicetree principles.
--
commit 0692b669eca2d4de46bd91bb83f4d52a4fe1f11d
Author: Pengyu Luo <mitltlatltl@gmail.com>
spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode
This commit introduces a new devicetree property, "qcom,force-gsi-mode",
to the Qualcomm SPI Geni binding. The property is intended to instruct
the driver to prioritize DMA (GSI) mode over FIFO mode during initialization
on platforms where FIFO mode isn't explicitly disabled.
> diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> index edf399681d7a9..80e394c1c7159 100644
> --- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> +++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> @@ -45,6 +45,11 @@ properties:
> - const: tx
> - const: rx
>
> + qcom,force-gsi-mode:
> + $ref: /schemas/types.yaml#/definitions/flag
> + description:
> + Use DMA (GSI) mode, even if FIFO mode is not disabled.
[Severity: Medium]
Does this property violate the principle that devicetree bindings should
describe hardware capabilities rather than software behavior?
The hardware's capability to use DMA is typically already described by standard
properties like dmas and dma-names. Since qcom,force-gsi-mode acts as a hint to
override the driver's default fallback logic, could the driver instead make
this decision internally?
For example, the driver could default to DMA when the resources are available,
or apply a quirk based on the board's compatible string, avoiding the need to
introduce an OS-specific policy flag into the devicetree.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260614083424.464132-1-mitltlatltl@gmail.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode
2026-06-14 8:34 [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode Pengyu Luo
2026-06-14 8:34 ` [PATCH 2/2] spi: qcom-geni: " Pengyu Luo
2026-06-14 10:40 ` [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: " sashiko-bot
@ 2026-06-14 10:55 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-06-14 10:55 UTC (permalink / raw)
To: Pengyu Luo
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
Bjorn Andersson, linux-arm-msm, linux-spi, devicetree,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 724 bytes --]
On Sun, Jun 14, 2026 at 04:34:23PM +0800, Pengyu Luo wrote:
> Some devices (such as gaokun3) do not disable FIFO mode, causing the
> driver to fallback to FIFO mode by default. However, these platforms
> also support GSI mode, which is highly preferred for certain
> peripherals like SPI touchscreens to improve performance.
>
> Introduce the "qcom,force-gsi-mode" device property to hint and force
> the controller into GSI mode during initialization.
This is an optimisation not a fundamental part of how these devices
operate. The DT should describe whatever it is about these SoCs that
allows this mode, or this should be triggered based on the compatible
for the variant of the device that can do this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-14 10:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-14 8:34 [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: Add property to force GSI mode Pengyu Luo
2026-06-14 8:34 ` [PATCH 2/2] spi: qcom-geni: " Pengyu Luo
2026-06-14 8:48 ` sashiko-bot
2026-06-14 10:40 ` [PATCH 1/2] spi: dt-bindings: qcom,spi-geni-qcom: " sashiko-bot
2026-06-14 10:55 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox