Commit 7840e6f3 authored by Federico Vaga's avatar Federico Vaga

sw:drv: bugfix use IRQ save spinlock in IRQ handler

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent c67fa77d
......@@ -46,20 +46,21 @@ static inline void trtl_tty_flip_buffer_push(struct trtl_cpu *cpu)
* trtl_tty_handler_getchar - Get Character From soft-CPU
* It retrieves a character from the soft-CPU serial interface
* and it adds the character to the TTY buffer
* @cpu: the soft-CPU to use
* @cpu: the soft-CPU to use
*/
static void trtl_tty_handler_getchar(struct trtl_cpu *cpu)
{
struct trtl_dev *trtl = to_trtl_dev(cpu->dev.parent);
unsigned long flags;
char c;
/* Select the CPU and read data */
spin_lock(&trtl->lock_cpu_sel);
spin_lock_irqsave(&trtl->lock_cpu_sel, flags);
trtl_iowrite(trtl, cpu->index,
trtl->base_csr + MT_CPU_CSR_REG_CORE_SEL);
c = trtl_ioread(trtl,
trtl->base_csr + MT_CPU_CSR_REG_DBG_MSG);
spin_unlock(&trtl->lock_cpu_sel);
spin_unlock_irqrestore(&trtl->lock_cpu_sel, flags);
if (!cpu->tty_port.tty) /* Not open */
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment