diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-03 07:56:13 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-03 07:56:13 -0200 |
commit | a6d8d2727d0b1f6c635c4a3744592e2eac6a7452 (patch) | |
tree | 9f072b3a38f2997ca6d5d1bbc89e9af7d21ddb78 /sys | |
parent | 695ea8099809439ed40fe35451df301d75e2b39e (diff) | |
parent | 68e44b1d7045a500ada4760ebd096f99e1544d2e (diff) | |
download | FreeBSD-src-a6d8d2727d0b1f6c635c4a3744592e2eac6a7452.zip FreeBSD-src-a6d8d2727d0b1f6c635c4a3744592e2eac6a7452.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netsmb/smb_conn.c | 4 | ||||
-rw-r--r-- | sys/netsmb/smb_iod.c | 3 | ||||
-rw-r--r-- | sys/x86/x86/intr_machdep.c | 15 |
3 files changed, 18 insertions, 4 deletions
diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index d58bc72..adc171c 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -683,7 +683,9 @@ int smb_vc_disconnect(struct smb_vc *vcp) { - smb_iod_request(vcp->vc_iod, SMBIOD_EV_DISCONNECT | SMBIOD_EV_SYNC, NULL); + if (vcp->vc_iod != NULL) + smb_iod_request(vcp->vc_iod, SMBIOD_EV_DISCONNECT | + SMBIOD_EV_SYNC, NULL); return 0; } diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c index ae5c6f7..412f816 100644 --- a/sys/netsmb/smb_iod.c +++ b/sys/netsmb/smb_iod.c @@ -690,6 +690,9 @@ smb_iod_create(struct smb_vc *vcp) RFNOWAIT, 0, "smbiod%d", iod->iod_id); if (error) { SMBERROR("can't start smbiod: %d", error); + vcp->vc_iod = NULL; + smb_sl_destroy(&iod->iod_rqlock); + smb_sl_destroy(&iod->iod_evlock); free(iod, M_SMBIOD); return error; } diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c index 9a5e463..cc50321 100644 --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -197,19 +197,28 @@ int intr_remove_handler(void *cookie) { struct intsrc *isrc; - int error; + int error, mtx_owned; isrc = intr_handler_source(cookie); error = intr_event_remove_handler(cookie); if (error == 0) { - mtx_lock(&intr_table_lock); + /* + * Recursion is needed here so PICs can remove interrupts + * while resuming. It was previously not possible due to + * intr_resume holding the intr_table_lock and + * intr_remove_handler recursing on it. + */ + mtx_owned = mtx_owned(&intr_table_lock); + if (mtx_owned == 0) + mtx_lock(&intr_table_lock); isrc->is_handlers--; if (isrc->is_handlers == 0) { isrc->is_pic->pic_disable_source(isrc, PIC_NO_EOI); isrc->is_pic->pic_disable_intr(isrc); } intrcnt_updatename(isrc); - mtx_unlock(&intr_table_lock); + if (mtx_owned == 0) + mtx_unlock(&intr_table_lock); } return (error); } |