> Date: Mon, 3 Dec 2018 12:51:32 +0100
> From: Nils Frohberg <ni...@tako.de>
> 
> Hi,
> 
> is it safe to call usbd_delay_ms() from under splusb()? In axen(4),
> axen_rxeof() is called from usb_transfer_complete() which runs at
> splusb() (called via usbd_transfer()).

It is perfectly fine to call usbd_delay_ms() from within code
protected by splusb().  It is not ok to call this code from interrupt
context though.

> The following patch prevents a panic on my system.

What panic?  And what is the ddb backtrace you see?

> Index: sys/dev/usb/if_axen.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/if_axen.c,v
> retrieving revision 1.25
> diff -u -r1.25 if_axen.c
> --- sys/dev/usb/if_axen.c     12 Jun 2018 06:59:27 -0000      1.25
> +++ sys/dev/usb/if_axen.c     30 Nov 2018 14:47:49 -0000
> @@ -937,7 +937,6 @@
>       /* sanity check */
>       if (hdr_offset > total_len) {
>               ifp->if_ierrors++;
> -             usbd_delay_ms(sc->axen_udev, 100);
>               goto done;
>       }
>  
> 
> 

Reply via email to