Re: [PATCH 4/4] media: ipu-bridge: Add the Surface Pro 11 infrared illuminator

From: Fernando Rimoli

Date: Sun Oct 25 2026 - 11:48:06 EST


Hi Sergey,

On Mon, Oct 19, 2026 at 04:28:11PM +0000, Sergey Lebedev wrote:
> +/* The infrared illuminator, strobed by the VD55G0's GPIO 1 */
> +static const u32 surface_pro_11_ir_gpios[] = { 1 };
> +
> +static const struct ipu_sensor_leds surface_pro_11_ir_leds = {
> + .hid = "SMO55F0",
> + .property = "st,leds",

[...]

> + leds = ipu_bridge_get_leds(cfg);
> + if (leds)
> + sensor->dev_properties[d++] =
> + PROPERTY_ENTRY_U32_ARRAY_LEN(leds->property, leds->gpios,
> + leds->nr_gpios);

The property entry keeps pointers to both its name and its values, and
here both point into the module image: the "st,leds" literal and the
static const surface_pro_11_ir_gpios[]. The bridge never unregisters its
software nodes, on purpose, so that a rebind can reuse them. After rmmod
ipu-bridge both pointers dangle, and a sensor driver probing again reads
freed memory for the property's name and value.

It is the same thing that a20c843c9bc4 ("media: ipu-bridge: Keep the
clock-noncontinuous property name out of rodata") fixed for
clock-noncontinuous, and that D. Manresa's v4 fixes for the
link-frequencies values and the lens-focus name:

https://lore.kernel.org/linux-media/20261010155626.2766298-1-dmanresa@xxxxxxxxx/

Following his v4, the name would go in struct ipu_property_names and the
GPIO numbers would be copied into struct ipu_sensor, so that nothing the
node points at lives in the module.

On the same hunk:

> sensor->vcm_ref[0] =
> SOFTWARE_NODE_REFERENCE(&sensor->swnodes[SWNODE_VCM]);
> - sensor->dev_properties[3] =
> + sensor->dev_properties[d++] =
> PROPERTY_ENTRY_REF_ARRAY("lens-focus", sensor->vcm_ref);

Manresa's v4 1/2 changes this same line to use names->lens_focus, so
whichever of the two lands second will need a rebase.

The Surface Pro 9 needs an entry too. Its VD55G0 drives the illuminator
from GPIO 1, as on your machine. Its DMI strings are:

sys_vendor "Microsoft Corporation"
product_name "Surface Pro 9"

I tested it with your driver by having it fall back to GPIO 1 when no
st,leds was found. In a dim room, 640x480 Y8 at exposure 600 and
analogue gain 8, the frame mean goes from 22.0 with led_mode off to 64.7
with it set to flash. There is more on how the series runs on the
Surface Pro 9 in my reply to the cover letter.

Fernando