mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
Revert "mt76: fix potential deadlock on cancelling workqueues"
This reverts commit 3a7e6bbac3
to be replaced by upstream patch.
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+1
-3
@@ -21,6 +21,7 @@ mt76x0_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
dev->beacon_ops->pre_tbtt_enable(dev, false);
|
||||
if (mt76_is_mmio(dev))
|
||||
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
|
||||
@@ -50,9 +51,6 @@ int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
int ret = 0;
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
|
||||
+2
-2
@@ -45,7 +45,6 @@ static void mt76x0e_stop_hw(struct mt76x02_dev *dev)
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
cancel_delayed_work_sync(&dev->mt76.mac_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
if (!mt76_poll(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_TX_DMA_BUSY,
|
||||
0, 1000))
|
||||
dev_warn(dev->mt76.dev, "TX DMA did not stop\n");
|
||||
@@ -57,15 +56,16 @@ static void mt76x0e_stop_hw(struct mt76x02_dev *dev)
|
||||
0, 1000))
|
||||
dev_warn(dev->mt76.dev, "TX DMA did not stop\n");
|
||||
mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_RX_DMA_EN);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static void mt76x0e_stop(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
|
||||
mt76x0e_stop_hw(dev);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+2
-3
@@ -92,8 +92,6 @@ static void mt76x0u_mac_stop(struct mt76x02_dev *dev)
|
||||
if (test_bit(MT76_REMOVED, &dev->mt76.state))
|
||||
return;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (!mt76_poll(dev, MT_USB_DMA_CFG, MT_USB_DMA_CFG_TX_BUSY, 0, 1000))
|
||||
dev_warn(dev->mt76.dev, "TX DMA did not stop\n");
|
||||
|
||||
@@ -101,7 +99,6 @@ static void mt76x0u_mac_stop(struct mt76x02_dev *dev)
|
||||
|
||||
if (!mt76_poll(dev, MT_USB_DMA_CFG, MT_USB_DMA_CFG_RX_BUSY, 0, 1000))
|
||||
dev_warn(dev->mt76.dev, "RX DMA did not stop\n");
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static int mt76x0u_start(struct ieee80211_hw *hw)
|
||||
@@ -131,7 +128,9 @@ static void mt76x0u_stop(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
mt76x0u_mac_stop(dev);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static const struct ieee80211_ops mt76x0u_ops = {
|
||||
|
||||
+4
-3
@@ -49,8 +49,10 @@ mt76x2_stop(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
|
||||
mt76x2_stop_hardware(dev);
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -58,6 +60,8 @@ mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
|
||||
set_bit(MT76_RESET, &dev->mt76.state);
|
||||
|
||||
mt76_set_channel(&dev->mt76);
|
||||
@@ -91,9 +95,6 @@ mt76x2_config(struct ieee80211_hw *hw, u32 changed)
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
int ret = 0;
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
|
||||
|
||||
+1
-3
@@ -52,6 +52,7 @@ mt76x2u_set_channel(struct mt76x02_dev *dev,
|
||||
{
|
||||
int err;
|
||||
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
set_bit(MT76_RESET, &dev->mt76.state);
|
||||
|
||||
mt76_set_channel(&dev->mt76);
|
||||
@@ -79,9 +80,6 @@ mt76x2u_config(struct ieee80211_hw *hw, u32 changed)
|
||||
struct mt76x02_dev *dev = hw->priv;
|
||||
int err = 0;
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL)
|
||||
cancel_delayed_work_sync(&dev->cal_work);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
|
||||
|
||||
Reference in New Issue
Block a user