NetBSD-Bugs archive

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

Re: port-i386/53628 Regular panic. Possibly twa driver.



The following reply was made to PR port-i386/53628; it has been noted by GNATS.

From: Michael van Elst <mlelstv%serpens.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: port-i386/53628 Regular panic. Possibly twa driver.
Date: Wed, 10 Oct 2018 15:19:32 +0200

 The ld driver is supposed to be MPSAFE, just removing the flag is a bit
 strong.
 
 But maybe this is enough:
 
 Index: ld.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/ld.c,v
 retrieving revision 1.104
 diff -u -r1.104 ld.c
 --- ld.c        28 Oct 2017 03:47:24 -0000      1.104
 +++ ld.c        10 Oct 2018 13:17:52 -0000
 @@ -369,7 +369,11 @@
                 return (error);
  
         if (sc->sc_ioctl) {
 +               if ((sc->sc_flags & LDF_MPSAFE) == 0)
 +                       KERNEL_LOCK(1, curlwp);
                 error = (*sc->sc_ioctl)(sc, cmd, addr, flag, 0);
 +               if ((sc->sc_flags & LDF_MPSAFE) == 0)
 +                       KERNEL_UNLOCK_ONE(curlwp);
                 if (error != EPASSTHROUGH)
                         return (error);
         }
 @@ -388,7 +392,11 @@
         struct ld_softc *sc = device_private(self);
  
         if (sc->sc_ioctl) {
 +               if ((sc->sc_flags & LDF_MPSAFE) == 0)
 +                       KERNEL_LOCK(1, curlwp);
                 error = (*sc->sc_ioctl)(sc, DIOCCACHESYNC, NULL, 0, poll);
 +               if ((sc->sc_flags & LDF_MPSAFE) == 0)
 +                       KERNEL_UNLOCK_ONE(curlwp);
                 if (error != 0)
                         device_printf(self, "unable to flush cache\n");
         }
 
 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index