NetBSD-Bugs archive

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

re: kern/54495: stopping axe(4) may locks up if NET_MPSAFE is enabled

The following reply was made to PR kern/54495; it has been noted by GNATS.

From: matthew green <>
Subject: re: kern/54495: stopping axe(4) may locks up if NET_MPSAFE is enabled
Date: Thu, 29 Aug 2019 08:45:05 +1000

 actually, i see how usbnet_tick triggers this.  some of
 the driver did this, and i copied it into all, but i see
 how it is espcially bad for axe(4) -- it has many many
 more usbd_delay_us() calls compared to most of the other
 usbnet converted drivers.
 i can see a few ideas for fixes.
 - remove any access to adaptive locks in softint context,
   which comes down to don't take the lock in usbnet_tick().
 - arrange to have the un_lock passed to kpause so it is
   dropped and re-taken during kpause.
 - push *all* the work in usbnet_tick() into the
   usbnet_tick_task() (hm, this may also be #1.)
 i think the first idea is best and simplest.  i suspect
 that it needs to be written like;
         struct usbnet_private * const unp =3D un->un_pri;
         if (unp !=3D NULL && !unp->unp_stopping && !unp->unp_dying) {
                 /* Perform periodic stuff in process context */
                 usb_add_task(un->un_udev, &unp->unp_ticktask, USB_TASKQ_DR=
 can you test?  my axe(4) is broken.
 (i've got a few more fixes to check unp for NULL in a
 tree i'm testing, thanks to a report from maxv about
 upl(4) crash during detach, which is the only fixed
 part so far, though the rest of them are more safety
 than actually fixing bugs.)

Home | Main Index | Thread Index | Old Index