kernel - Fix bug in SILI, remove debugging in AHCI
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 23 Mar 2012 16:06:57 +0000 (09:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 23 Mar 2012 16:06:57 +0000 (09:06 -0700)
* Fix the same unlock/lock sequence bug in the SILI driver that was
  fixed in the AHCI driver.

* Remove a flag that was being added to the service set in AHCI for
  debugging purposes.

sys/dev/disk/ahci/ahci_dragonfly.c
sys/dev/disk/sili/sili.c
sys/dev/disk/sili/sili_cam.c
sys/dev/disk/sili/sili_dragonfly.c

index 7fa2d5d..0ecc69f 100644 (file)
@@ -396,7 +396,7 @@ ahci_port_thread(void *arg)
         */
        mask = ap->ap_signal;
        while ((mask & AP_SIGF_STOP) == 0) {
-               ahci_port_thread_core(ap, mask | AP_SIGF_PORTINT);
+               ahci_port_thread_core(ap, mask);
                lockmgr(&ap->ap_sig_lock, LK_EXCLUSIVE);
                if (ap->ap_signal == 0) {
                        lksleep(&ap->ap_thread, &ap->ap_sig_lock, 0,
index 22cb218..6809bf5 100644 (file)
@@ -1616,10 +1616,8 @@ sili_port_thread_core(struct sili_port *ap, int mask)
        if (mask & AP_SIGF_PORTINT) {
                sili_port_intr(ap, 1);
                sili_port_interrupt_reenable(ap);
-               sili_os_unlock_port(ap);
-       } else {
-               sili_os_unlock_port(ap);
        }
+       sili_os_unlock_port(ap);
 }
 
 /*
index 36dad4e..11fc695 100644 (file)
@@ -1620,9 +1620,9 @@ sili_ata_complete_disk_synchronize_cache(struct ata_xfer *xa)
                break;
        }
        sili_ata_put_xfer(xa);
-       sili_os_unlock_port(ap);
+       /*sili_os_unlock_port(ap);*/
        xpt_done(ccb);
-       sili_os_lock_port(ap);
+       /*sili_os_lock_port(ap);*/
 }
 
 /*
@@ -1661,9 +1661,9 @@ sili_ata_complete_disk_rw(struct ata_xfer *xa)
        }
        ccb->csio.resid = xa->resid;
        sili_ata_put_xfer(xa);
-       sili_os_unlock_port(ap);
+       /*sili_os_unlock_port(ap);*/
        xpt_done(ccb);
-       sili_os_lock_port(ap);
+       /*sili_os_lock_port(ap);*/
 }
 
 /*
@@ -1708,9 +1708,9 @@ sili_atapi_complete_cmd(struct ata_xfer *xa)
        }
        ccb->csio.resid = xa->resid;
        sili_ata_put_xfer(xa);
-       sili_os_unlock_port(ap);
+       /*sili_os_unlock_port(ap);*/
        xpt_done(ccb);
-       sili_os_lock_port(ap);
+       /*sili_os_lock_port(ap);*/
 }
 
 /*
index ed4c9a8..c0c74fb 100644 (file)
@@ -195,7 +195,7 @@ void
 sili_os_start_port(struct sili_port *ap)
 {
        atomic_set_int(&ap->ap_signal, AP_SIGF_INIT);
-       lockinit(&ap->ap_lock, "silipo", 0, 0);
+       lockinit(&ap->ap_lock, "silipo", 0, LK_CANRECURSE);
        lockinit(&ap->ap_sim_lock, "silicam", 0, LK_CANRECURSE);
        lockinit(&ap->ap_sig_lock, "siport", 0, 0);
        kthread_create(sili_port_thread, ap, &ap->ap_thread,