From 1645f4ac10512bdb911da49bb25daa0fb7fc4780 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 9 Apr 2025 11:53:57 +0300 Subject: [PATCH] arch/mpfs/usb: Align usb_ctrlreq_s properly to 32-bit boundary The alignment of the ctrlreq was correct by luck, and was broken when the spinlock was added to the structure. In non-smp configurations spinlock_t is currently 8-bits, causing wrong alignment of the ctrlreq structure. Signed-off-by: Jukka Laitinen --- arch/risc-v/src/mpfs/hardware/mpfs_usb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/risc-v/src/mpfs/hardware/mpfs_usb.h b/arch/risc-v/src/mpfs/hardware/mpfs_usb.h index bb375c85ef..b34616e576 100644 --- a/arch/risc-v/src/mpfs/hardware/mpfs_usb.h +++ b/arch/risc-v/src/mpfs/hardware/mpfs_usb.h @@ -455,6 +455,7 @@ struct mpfs_usbdev_s /* USB-specific fields */ + aligned_data(4) struct usb_ctrlreq_s ctrl; /* Last EP0 request */ uint8_t devstate; /* State of the device (see enum mpfs_devstate_e) */ uint8_t prevstate; /* Previous state of the device before SUSPEND */