svn commit: r311707 - in head/sys/dev/rtwn: . usb
Andriy Voskoboinyk
avos at freebsd.org
Tue Jan 10 00:04:15 UTC 2017
Mon, 09 Jan 2017 10:08:13 +0200 було написано Hans Petter Selasky
<hps at selasky.org>:
Hi,
The race should be fixed in r311838.
> On 01/09/17 00:41, Andriy Voskoboinyk wrote:
>> Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
>> ==============================================================================
>> --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:25:46
>> 2017 (r311706)
>> +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:41:17
>> 2017 (r311707)
>> @@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW
>> .type = UE_BULK,
>> .endpoint = UE_ADDR_ANY,
>> .direction = UE_DIR_IN,
>> - .bufsize = RTWN_RXBUFSZ,
>> .flags = {
>> .pipe_bof = 1,
>> .short_xfer_ok = 1
>> @@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
>> break;
>> }
>>
>> + rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;
>
> Hi,
>
> You should copy the rtwn_config to the stack/softc, and not write to the
> static struct, which should be made "static const" after this change!
>
> This might lead to a race when multiple adapters are connecting at the
> same time! Remember USB enumeration is multithreaded.
>
> Else your change looks good.
>
> --HPS
More information about the svn-src-all
mailing list