lkml.org 
[lkml]   [2016]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 1/4] usb: dbc: early driver for xhci debug capability
From
Date
Hi,

On 11/09/2016 05:37 PM, Thomas Gleixner wrote:
> On Tue, 1 Nov 2016, Lu Baolu wrote:
>> +static void early_xdbc_write(struct console *con, const char *str, u32 n)
>> +{
>> + int chunk, ret;
>> + static char buf[XDBC_MAX_PACKET];
>> + int use_cr = 0;
>> +
>> + if (!xdbc.xdbc_reg)
>> + return;
>> + memset(buf, 0, XDBC_MAX_PACKET);
> How is that dealing with reentrancy?
>
> early_printk() does not protect against it. Peter has a patch to prevent
> concurrent access from different cpus, but it cannot and will never prevent
> reentrancy on the same cpu (interrupt, nmi).

I can use a spinlock_irq to protect reentrancy of interrupt on the same
cpu. But I have no idea about the nmi one. This seems to be a common
issue for all early printk drivers.

Peter, any idea?

Best regards,
Lu Baolu

\
 
 \ /
  Last update: 2016-11-10 02:21    [W:0.070 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site