Re: [patch]fix usb serial race due to late shutdown
Oliver Neukum <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Organization | Novell |
| Message-ID | <[email protected]> |
Am Freitag, 16. März 2007 20:56 schrieb Alan Stern:
> On Fri, 16 Mar 2007, Oliver Neukum wrote:
>
> > Hi,
> >
> > this uses Greg's idea to call shutdown() during disconnect().
> > It can do so by decoupling subdriver and core upon disconnect():
> > Having made sure that no callbacks into a subdriver can occur, the
> > subdriver's memory can be freed immediately.
>
> > @@ -104,6 +106,7 @@
> > for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) {
> > serial_table[i] = serial;
> > serial->port[j++]->number = i;
> > + __clear_bit(i % 32, &deathrow[i / 32]);
>
> You shouldn't need to do these computations. clear_bit(i, deathrow)
> will work just as well. But the bitops want their argument to be an array
> of unsigned long, not u32.
OK. How do I size this cleanly? BITS_PER_LONG?
Regards
Oliver
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel