Skip to content

Commit 5b93772

Browse files
P33Mpopcornmix
authored andcommitted
drivers: dwc_otg: stop GCC from patching FIQ functions
Configuring GCC to use task stack protector canaries means it will insert calls to check functions in FIQ code. This is bad, as a) the FIQ's stack is banked and b) the failure invokes __stack_chk_fail which eventually tries to call printk(). Printing to the console inside the FIQ is generally fatal. Add CFLAGS to stop this happening in FIQ code. Also catch one function where notrace wasn't specified. Signed-off-by: Jonathan Bell <[email protected]>
1 parent 99a2e37 commit 5b93772

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/usb/host/dwc_otg/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ccflags-y += -DDWC_LINUX
2828
ccflags-y += $(CFI)
2929
ccflags-y += $(BUS_INTERFACE)
3030
#ccflags-y += -DDWC_DEV_SRPCAP
31+
CFLAGS_dwc_otg_fiq_fsm.o += -fno-stack-protector
3132

3233
obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o
3334

drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ inline void fiq_fsm_spin_unlock(fiq_lock_t *lock) { }
142142
* fiq_fsm_restart_channel() - Poke channel enable bit for a split transaction
143143
* @channel: channel to re-enable
144144
*/
145-
static void fiq_fsm_restart_channel(struct fiq_state *st, int n, int force)
145+
static void notrace fiq_fsm_restart_channel(struct fiq_state *st, int n, int force)
146146
{
147147
hcchar_data_t hcchar = { .d32 = FIQ_READ(st->dwc_regs_base + HC_START + (HC_OFFSET * n) + HCCHAR) };
148148

0 commit comments

Comments
 (0)