mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
spi_fpga_fw: fix access uninitialized spin_lock bug
fix this bug: BUG: spinlock bad magic on CPU#0, swapper/1 lock: c0c83ffc, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [<c044f108>] (unwind_backtrace+0x0/0xdc) from [<c06f39e0>] (dump_stack+0x18/0x1c) [<c06f39e0>] (dump_stack+0x18/0x1c) from [<c055aaa8>] (spin_bug+0x90/0xa4) [<c055aaa8>] (spin_bug+0x90/0xa4) from [<c055abf0>] (_raw_spin_lock+0x2c/0x168) [<c055abf0>] (_raw_spin_lock+0x2c/0x168) from [<c06f6f84>] (_spin_lock_irqsave+0x5c/0x68) [<c06f6f84>] (_spin_lock_irqsave+0x5c/0x68) from [<c0418a78>] (fpga_dl_fw+0x98/0x358) [<c0418a78>] (fpga_dl_fw+0x98/0x358) from [<c040da68>] (machine_rk2818_board_init+0x94/0x124) [<c040da68>] (machine_rk2818_board_init+0x94/0x124) from [<c040a8c8>] (customize_machine+0x20/0x2c) [<c040a8c8>] (customize_machine+0x20/0x2c) from [<c0449364>] (do_one_initcall+0x64/0x1c0) [<c0449364>] (do_one_initcall+0x64/0x1c0) from [<c04085f4>] (kernel_init+0xa4/0x11c) [<c04085f4>] (kernel_init+0xa4/0x11c) from [<c044a8fc>] (kernel_thread_exit+0x0/0x8)
This commit is contained in:
@@ -113,10 +113,11 @@ static void __init spi_fpga_wait(unsigned int num)
|
||||
i++;
|
||||
}
|
||||
}
|
||||
static spinlock_t lock_fw;
|
||||
|
||||
static DEFINE_SPINLOCK(lock_fw);
|
||||
static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_len)
|
||||
{
|
||||
int ret;
|
||||
//int ret;
|
||||
unsigned long flags;
|
||||
unsigned char command1[6] = {0x7e, 0xaa, 0x99, 0x7e, 0x01, 0x0e};
|
||||
unsigned char command2[5] = {0x83, 0x00, 0x00, 0x26, 0x11};
|
||||
@@ -245,6 +246,7 @@ int __init fpga_dl_fw(void)
|
||||
gpio_direction_output(RK2818_PIN_PE0,1);
|
||||
udelay(2);
|
||||
gpio_direction_output(RK2818_PIN_PE0,0);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user