Re: [PATCH 1/5] USB: serial: fix unthrottle races

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 29, 2019 at 11:50:58AM +0200, Oliver Neukum wrote:
> On Do, 2019-04-25 at 18:05 +0200, Johan Hovold wrote:
> > @@ -484,6 +503,12 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
> >         port->throttled = port->throttle_req = 0;
> >         spin_unlock_irq(&port->lock);
> >  
> > +       /*
> > +        * Matches the smp_mb__after_atomic() in
> > +        * usb_serial_generic_read_bulk_callback().
> > +        */
> > +       smp_mb();
> > +
> >         if (was_throttled)
> >                 usb_serial_generic_submit_read_urbs(port, GFP_KERNEL);
> 
> 
> Doesn't the spin_unlock_irq() imply smp_mb()?
> Otherwise it looks correct to me.

No, spin_unlock_irq() is only a one-way barrier, and doesn't prevent
later accesses from "moving" into the locked section.

Johan



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux