changeset 13238:9019c04b0003

401 sdcard hang Reviewed by: jason.brian.king@gmail.com Approved by: gwr@nexenta.com
author Garrett D'Amore <garrett@nexenta.com>
date Sun, 07 Nov 2010 20:18:24 -0800
parents c695c69515de
children 16739a07ac66
files usr/src/uts/common/io/sdcard/impl/sda_slot.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/sdcard/impl/sda_slot.c	Thu Oct 21 19:08:24 2010 -0400
+++ b/usr/src/uts/common/io/sdcard/impl/sda_slot.c	Sun Nov 07 20:18:24 2010 -0800
@@ -20,6 +20,7 @@
  */
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
@@ -383,12 +384,14 @@
 		 * hipri commands for now.
 		 */
 		slot->s_init = B_TRUE;
+		sda_slot_exit(slot);
 
 		/*
 		 * Card insertion occurred.  We have to run this on
 		 * another task, to avoid deadlock as the task may
 		 * need to dispatch commands.
 		 */
+
 		(void) ddi_taskq_dispatch(slot->s_hp_tq, sda_slot_insert, slot,
 		    DDI_SLEEP);
 	} else {
@@ -405,9 +408,10 @@
 		sda_slot_reset(slot);
 
 		slot->s_intransit = 0;
+		sda_slot_exit(slot);
+
 		bd_state_change(slot->s_bdh);
 	}
-	sda_slot_exit(slot);
 
 	sda_slot_wakeup(slot);
 }