diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-08-10 03:26:12 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-08-10 03:26:12 +0000 |
commit | 1d8cd2e98fc16d64845f602824c3aea58a95729d (patch) | |
tree | fc1b916847837f0add0dbce416efcefd7244e039 /xpp/xpp_zap.c | |
parent | 605fae59f8489a3e2a1eea4631916e2b01431543 (diff) |
Solves spinlock-panic in CentOS 4.
zt_transmit() was called in spinlock protected context. However, it may
call back our hook setting code which tries to lock the same spinlock.
As a safeguard, the same logic was applied to zt_receive().
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1289 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/xpp_zap.c')
-rw-r--r-- | xpp/xpp_zap.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c index 3e7fc9c..3aad1d4 100644 --- a/xpp/xpp_zap.c +++ b/xpp/xpp_zap.c @@ -903,7 +903,13 @@ static void xpp_transmitprep(xpd_t *xpd) } else { w = writechunk = xpd->writechunk + ZT_CHUNKSIZE * CHANNELS_PERXPD /* + 1 */; } + spin_unlock_irqrestore(&xpd->lock, flags); + /* + * This should be out of spinlocks, as it may call back our hook setting + * methods + */ zt_transmit(&xpd->span); + spin_lock_irqsave(&xpd->lock, flags); for (i = 0; i < channels; i++) { if (xpd->delay_until_dialtone[i] > 0) { @@ -1011,8 +1017,12 @@ static void xpp_receiveprep(xpd_t *xpd) memcpy(xpd->ec_chunk1[i], chans[i].writechunk, ZT_CHUNKSIZE); } #endif - zt_receive(&xpd->span); spin_unlock_irqrestore(&xpd->lock, flags); + /* + * This should be out of spinlocks, as it may call back our hook setting + * methods + */ + zt_receive(&xpd->span); } static int xpp_startup(struct zt_span *span) |