Skip to content

Commit c651b46

Browse files
committed
Merge tag 'mac80211-for-net-2020-04-24' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says: ==================== Just three changes: * fix a wrong GFP_KERNEL in hwsim * fix the debugfs mess after the mac80211 registration race fix * suppress false-positive RCU list lockdep warnings ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0303b3a + 8ca47eb commit c651b46

File tree

12 files changed

+54
-27
lines changed

12 files changed

+54
-27
lines changed

drivers/net/wireless/intel/iwlegacy/3945-rs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
374374
}
375375

376376
static void *
377-
il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
377+
il3945_rs_alloc(struct ieee80211_hw *hw)
378378
{
379379
return hw->priv;
380380
}

drivers/net/wireless/intel/iwlegacy/4965-rs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
24742474
}
24752475

24762476
static void *
2477-
il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
2477+
il4965_rs_alloc(struct ieee80211_hw *hw)
24782478
{
24792479
return hw->priv;
24802480
}

drivers/net/wireless/intel/iwlwifi/dvm/rs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
30193019
cpu_to_le16(priv->lib->bt_params->agg_time_limit);
30203020
}
30213021

3022-
static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
3022+
static void *rs_alloc(struct ieee80211_hw *hw)
30233023
{
30243024
return hw->priv;
30253025
}

drivers/net/wireless/intel/iwlwifi/mvm/rs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3665,7 +3665,7 @@ static void rs_fill_lq_cmd(struct iwl_mvm *mvm,
36653665
cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta));
36663666
}
36673667

3668-
static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
3668+
static void *rs_alloc(struct ieee80211_hw *hw)
36693669
{
36703670
return hw->priv;
36713671
}

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4068,7 +4068,7 @@ static void hwsim_virtio_rx_work(struct work_struct *work)
40684068
}
40694069
vq = hwsim_vqs[HWSIM_VQ_RX];
40704070
sg_init_one(sg, skb->head, skb_end_offset(skb));
4071-
err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
4071+
err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_ATOMIC);
40724072
if (WARN(err, "virtqueue_add_inbuf returned %d\n", err))
40734073
nlmsg_free(skb);
40744074
else

drivers/net/wireless/realtek/rtlwifi/rc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void rtl_rate_update(void *ppriv,
261261
{
262262
}
263263

264-
static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
264+
static void *rtl_rate_alloc(struct ieee80211_hw *hw)
265265
{
266266
struct rtl_priv *rtlpriv = rtl_priv(hw);
267267
return rtlpriv;

include/net/mac80211.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6007,7 +6007,9 @@ enum rate_control_capabilities {
60076007
struct rate_control_ops {
60086008
unsigned long capa;
60096009
const char *name;
6010-
void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
6010+
void *(*alloc)(struct ieee80211_hw *hw);
6011+
void (*add_debugfs)(struct ieee80211_hw *hw, void *priv,
6012+
struct dentry *debugfsdir);
60116013
void (*free)(void *priv);
60126014

60136015
void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);

net/mac80211/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
11831183
local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
11841184
IEEE80211_TX_STATUS_HEADROOM);
11851185

1186-
debugfs_hw_add(local);
1187-
11881186
/*
11891187
* if the driver doesn't specify a max listen interval we
11901188
* use 5 which should be a safe default
@@ -1273,6 +1271,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
12731271
if (result < 0)
12741272
goto fail_wiphy_register;
12751273

1274+
debugfs_hw_add(local);
1275+
rate_control_add_debugfs(local);
1276+
12761277
rtnl_lock();
12771278

12781279
/* add one default STA interface if supported */

net/mac80211/rate.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,16 @@ static ssize_t rcname_read(struct file *file, char __user *userbuf,
214214
ref->ops->name, len);
215215
}
216216

217-
static const struct file_operations rcname_ops = {
217+
const struct file_operations rcname_ops = {
218218
.read = rcname_read,
219219
.open = simple_open,
220220
.llseek = default_llseek,
221221
};
222222
#endif
223223

224-
static struct rate_control_ref *rate_control_alloc(const char *name,
225-
struct ieee80211_local *local)
224+
static struct rate_control_ref *
225+
rate_control_alloc(const char *name, struct ieee80211_local *local)
226226
{
227-
struct dentry *debugfsdir = NULL;
228227
struct rate_control_ref *ref;
229228

230229
ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL);
@@ -234,13 +233,7 @@ static struct rate_control_ref *rate_control_alloc(const char *name,
234233
if (!ref->ops)
235234
goto free;
236235

237-
#ifdef CONFIG_MAC80211_DEBUGFS
238-
debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir);
239-
local->debugfs.rcdir = debugfsdir;
240-
debugfs_create_file("name", 0400, debugfsdir, ref, &rcname_ops);
241-
#endif
242-
243-
ref->priv = ref->ops->alloc(&local->hw, debugfsdir);
236+
ref->priv = ref->ops->alloc(&local->hw);
244237
if (!ref->priv)
245238
goto free;
246239
return ref;

net/mac80211/rate.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ static inline void rate_control_add_sta_debugfs(struct sta_info *sta)
6060
#endif
6161
}
6262

63+
extern const struct file_operations rcname_ops;
64+
65+
static inline void rate_control_add_debugfs(struct ieee80211_local *local)
66+
{
67+
#ifdef CONFIG_MAC80211_DEBUGFS
68+
struct dentry *debugfsdir;
69+
70+
if (!local->rate_ctrl)
71+
return;
72+
73+
if (!local->rate_ctrl->ops->add_debugfs)
74+
return;
75+
76+
debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir);
77+
local->debugfs.rcdir = debugfsdir;
78+
debugfs_create_file("name", 0400, debugfsdir,
79+
local->rate_ctrl, &rcname_ops);
80+
81+
local->rate_ctrl->ops->add_debugfs(&local->hw, local->rate_ctrl->priv,
82+
debugfsdir);
83+
#endif
84+
}
85+
6386
void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata);
6487

6588
/* Get a reference to the rate control algorithm. If `name' is NULL, get the

0 commit comments

Comments
 (0)