lkml.org 
[lkml]   [2018]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [LKP] [tty] c96cf923a9: WARNING:possible_circular_locking_dependency_detected
On (12/12/18 10:07), Peter Zijlstra wrote:
> > + uart_port_lock(state, flags);
> > + xmit_buf = state->xmit.buf;
> > + state->xmit.buf = NULL;
> > + uart_port_unlock(uport, flags);
> > +
> > /*
> > * Free the transmit buffer page.
> > */
> > - uart_port_lock(state, flags);
> > - if (state->xmit.buf) {
> > - free_page((unsigned long)state->xmit.buf);
> > - state->xmit.buf = NULL;
> > - }
> > - uart_port_unlock(uport, flags);
> > + if (xmit_buf)
> > + free_page((unsigned long)xmit_buf);
> > }
>
> That looks sensible anyhow. One should strive to not do alloc or free
> under locks as much as possible anyway.

Right, good point.

-ss

\
 
 \ /
  Last update: 2018-12-13 06:38    [W:0.110 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site