Re: [PATCH] staging: fbtft: fix unaligned vmem writes when txbuf is byte-offset

From: Andy Shevchenko

Date: Thu Jun 25 2026 - 10:02:10 EST


On Thu, Jun 25, 2026 at 07:02:37PM +0800, suryasaimadhu wrote:
> fbtft_write_vmem16_bus8() and fb_ra8875's write_vmem16_bus8() offset
> txbuf16 by one byte for a command/start prefix, then store 16-bit pixel
> data via txbuf16[i]. On strict-alignment architectures this can fault
> the same way as the write_reg path fixed in the previous patch.

.write_reg()

Can you provide a real world example of the failure?

> Use put_unaligned() for these stores.

Sounds like a fix without Fixes tag.

> Signed-off-by: suryasaimadhu <suryasaimadhu369@xxxxxxxxx>

Use your name in accordance with your official documents.

...

> +++ b/drivers/staging/fbtft/fb_ra8875.c
> @@ -10,6 +10,7 @@
> #include <linux/delay.h>

>

You should move this blank line to be...

> #include <linux/gpio/consumer.h>
> +#include <linux/unaligned.h>

...here.

> #include "fbtft.h"

...

> #define DRVNAME "fb_ra8875"

Are other drivers also being affected?

...

> +++ b/drivers/staging/fbtft/fbtft-bus.c

Also needs linux/unaligned.h.

> + put_unaligned(cpu_to_be16(vmem16[i]), &txbuf16[i]);

--
With Best Regards,
Andy Shevchenko