Re: [PATCH net] tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent().

2018-05-04 Thread David Miller
From: Michael Chan Date: Thu, 3 May 2018 20:04:27 -0400 > tg3_free_consistent() calls dma_free_coherent() to free tp->hw_stats > under spinlock and can trigger BUG_ON() in vunmap() because vunmap() > may sleep. Fix it by removing the spinlock and relying on the > TG3_FLAG_INIT_COMPLETE flag to

[PATCH net] tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent().

2018-05-03 Thread Michael Chan
tg3_free_consistent() calls dma_free_coherent() to free tp->hw_stats under spinlock and can trigger BUG_ON() in vunmap() because vunmap() may sleep. Fix it by removing the spinlock and relying on the TG3_FLAG_INIT_COMPLETE flag to prevent race conditions between tg3_get_stats64() and tg3_free_cons