Commit 46a74187 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76x0: remove hw_atomic_mutex mutex in mt76x0_dev

Remove hw_atomic_mutex mutex in mt76x0_dev data structure
since mt76x0_phy_set_channel is already protected by mt76_dev
mutex while mt76x0_chip_onoff is used just at device probe or
cleanup
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 63cc936b
...@@ -73,8 +73,6 @@ void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset) ...@@ -73,8 +73,6 @@ void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset)
{ {
u32 val; u32 val;
mutex_lock(&dev->hw_atomic_mutex);
val = mt76_rr(dev, MT_WLAN_FUN_CTRL); val = mt76_rr(dev, MT_WLAN_FUN_CTRL);
if (reset) { if (reset) {
...@@ -96,8 +94,6 @@ void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset) ...@@ -96,8 +94,6 @@ void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset)
udelay(20); udelay(20);
mt76x0_set_wlan_state(dev, val, enable); mt76x0_set_wlan_state(dev, val, enable);
mutex_unlock(&dev->hw_atomic_mutex);
} }
EXPORT_SYMBOL_GPL(mt76x0_chip_onoff); EXPORT_SYMBOL_GPL(mt76x0_chip_onoff);
...@@ -346,7 +342,6 @@ mt76x0_alloc_device(struct device *pdev, ...@@ -346,7 +342,6 @@ mt76x0_alloc_device(struct device *pdev,
dev = container_of(mdev, struct mt76x0_dev, mt76); dev = container_of(mdev, struct mt76x0_dev, mt76);
mutex_init(&dev->reg_atomic_mutex); mutex_init(&dev->reg_atomic_mutex);
mutex_init(&dev->hw_atomic_mutex);
atomic_set(&dev->avg_ampdu_len, 1); atomic_set(&dev->avg_ampdu_len, 1);
return dev; return dev;
......
...@@ -72,8 +72,6 @@ enum mt_bw { ...@@ -72,8 +72,6 @@ enum mt_bw {
* @mutex: ensures exclusive access from mac80211 callbacks. * @mutex: ensures exclusive access from mac80211 callbacks.
* @reg_atomic_mutex: ensures atomicity of indirect register accesses * @reg_atomic_mutex: ensures atomicity of indirect register accesses
* (accesses to RF and BBP). * (accesses to RF and BBP).
* @hw_atomic_mutex: ensures exclusive access to HW during critical
* operations (power management, channel switch).
*/ */
struct mt76x0_dev { struct mt76x0_dev {
struct mt76_dev mt76; /* must be first */ struct mt76_dev mt76; /* must be first */
...@@ -84,7 +82,6 @@ struct mt76x0_dev { ...@@ -84,7 +82,6 @@ struct mt76x0_dev {
struct mt76x0_caldata caldata; struct mt76x0_caldata caldata;
struct mutex reg_atomic_mutex; struct mutex reg_atomic_mutex;
struct mutex hw_atomic_mutex;
atomic_t avg_ampdu_len; atomic_t avg_ampdu_len;
......
...@@ -614,8 +614,7 @@ void mt76x0_phy_set_txpower(struct mt76x0_dev *dev) ...@@ -614,8 +614,7 @@ void mt76x0_phy_set_txpower(struct mt76x0_dev *dev)
mt76x02_phy_set_txpower(&dev->mt76, info[0], info[1]); mt76x02_phy_set_txpower(&dev->mt76, info[0], info[1]);
} }
static int int mt76x0_phy_set_channel(struct mt76x0_dev *dev,
__mt76x0_phy_set_channel(struct mt76x0_dev *dev,
struct cfg80211_chan_def *chandef) struct cfg80211_chan_def *chandef)
{ {
u32 ext_cca_chan[4] = { u32 ext_cca_chan[4] = {
...@@ -713,18 +712,6 @@ __mt76x0_phy_set_channel(struct mt76x0_dev *dev, ...@@ -713,18 +712,6 @@ __mt76x0_phy_set_channel(struct mt76x0_dev *dev,
return 0; return 0;
} }
int mt76x0_phy_set_channel(struct mt76x0_dev *dev,
struct cfg80211_chan_def *chandef)
{
int ret;
mutex_lock(&dev->hw_atomic_mutex);
ret = __mt76x0_phy_set_channel(dev, chandef);
mutex_unlock(&dev->hw_atomic_mutex);
return ret;
}
void mt76x0_phy_recalibrate_after_assoc(struct mt76x0_dev *dev) void mt76x0_phy_recalibrate_after_assoc(struct mt76x0_dev *dev)
{ {
u32 tx_alc, reg_val; u32 tx_alc, reg_val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment