Re: [PATCH 6/6] spi: dw-g2: Add XIP support

From: Mark Brown

Date: Thu Nov 19 2026 - 15:12:16 EST


> Add memory-mapped execute-in-place through the spi-mem direct-mapping
> helpers.

> + *val = dws->xip_continuous_mode ? 1 : 0;

Please write normal conditional statements for improved legibility.

> + dws->xip_continuous_mode = !!val;
> + dev_info(dws->dev, "XIP continuous transfer mode: %s\n",
> + dws->xip_continuous_mode ? "enabled" : "disabled");

Don't log normal operations at anything above dev_db(), and consider if
they should be logged at all.

> + if (dws->xip_continuous_mode)
> + dev_info(dws->dev,
> + "Requires flash command supporting continuous read (e.g., 0xEB Quad I/O)\n");

Shouldn't this be an error then?

> +/*
> + * Module parameter: select transfer mode at load time.
> + * 1 = XIP (memory-mapped direct access)
> + * 0 = indirect (default, FIFO-based, uses exec_mem_op path)
> + *
> + * Can also be changed at runtime via sysfs:
> + * /sys/devices/.../xip_mode
> + */
> +static int xip_mode;
> +module_param(xip_mode, int, 0644);
> +MODULE_PARM_DESC(xip_mode, "Transfer mode: 0=indirect (default), 1=XIP");

No module parameters please, I see you have other interfaces for
configuring this anyway.

> -#include <linux/spi/spi.h>
> -#include <linux/io.h>
> +#include <linux/bitfield.h>
> +#include <linux/delay.h>
> #include <linux/device.h>
> -#include <linux/irqreturn.h>
> +#include <linux/io.h>
> #include <linux/iopoll.h>
> +#include <linux/irqreturn.h>
> +#include <linux/slab.h>
> +#include <linux/spi/spi.h>
> #include <linux/spi/spi-mem.h>
> +#include <linux/string.h>

You were using a bunch of these headers earlier in the series.

--
Mark Brown <broonie@xxxxxxxxxx>