Commit f9e75447 authored by Johannes Berg's avatar Johannes Berg Committed by Wey-Yi Guy

iwlwifi: remove debugfs logspam

There really is no point in printing very verbose
error messages when somebody tries to access a
debugfs file before it is ready. Or even worse,
printing verbose messages when memory allocation
fails which *already* prints a huge warning.

Remove all IWL_ERR messages from debugfs.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 9543c5f3
...@@ -230,10 +230,8 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, ...@@ -230,10 +230,8 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
/* default is to dump the entire data segment */ /* default is to dump the entire data segment */
if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
priv->dbgfs_sram_offset = 0x800000; priv->dbgfs_sram_offset = 0x800000;
if (!priv->ucode_loaded) { if (!priv->ucode_loaded)
IWL_ERR(priv, "No uCode has been loadded.\n");
return -EINVAL; return -EINVAL;
}
img = &priv->fw->img[priv->cur_ucode]; img = &priv->fw->img[priv->cur_ucode];
priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len;
} }
...@@ -411,23 +409,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, ...@@ -411,23 +409,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
size_t eeprom_len = priv->cfg->base_params->eeprom_size; size_t eeprom_len = priv->cfg->base_params->eeprom_size;
buf_size = 4 * eeprom_len + 256; buf_size = 4 * eeprom_len + 256;
if (eeprom_len % 16) { if (eeprom_len % 16)
IWL_ERR(priv, "NVM size is not multiple of 16.\n");
return -ENODATA; return -ENODATA;
}
ptr = priv->eeprom; ptr = priv->eeprom;
if (!ptr) { if (!ptr)
IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
return -ENOMEM; return -ENOMEM;
}
/* 4 characters for byte 0xYY */ /* 4 characters for byte 0xYY */
buf = kzalloc(buf_size, GFP_KERNEL); buf = kzalloc(buf_size, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION); eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, " pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, "
"version: 0x%x\n", "version: 0x%x\n",
...@@ -461,10 +454,8 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, ...@@ -461,10 +454,8 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ); supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ);
if (supp_band) { if (supp_band) {
...@@ -566,10 +557,8 @@ static ssize_t iwl_dbgfs_rx_handlers_read(struct file *file, ...@@ -566,10 +557,8 @@ static ssize_t iwl_dbgfs_rx_handlers_read(struct file *file,
ssize_t ret; ssize_t ret;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
for (cnt = 0; cnt < REPLY_MAX; cnt++) { for (cnt = 0; cnt < REPLY_MAX; cnt++) {
if (priv->rx_handlers_stats[cnt] > 0) if (priv->rx_handlers_stats[cnt] > 0)
...@@ -683,11 +672,8 @@ static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file, ...@@ -683,11 +672,8 @@ static ssize_t iwl_dbgfs_disable_ht40_write(struct file *file,
return -EFAULT; return -EFAULT;
if (!iwl_is_any_associated(priv)) if (!iwl_is_any_associated(priv))
priv->disable_ht40 = ht40 ? true : false; priv->disable_ht40 = ht40 ? true : false;
else { else
IWL_ERR(priv, "Sta associated with AP - "
"Change to 40MHz channel support is not allowed\n");
return -EINVAL; return -EINVAL;
}
return count; return count;
} }
...@@ -834,10 +820,8 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file, ...@@ -834,10 +820,8 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
ssize_t ret; ssize_t ret;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate buffer\n");
return -ENOMEM; return -ENOMEM;
}
if (priv->tx_traffic && iwl_have_debug_level(IWL_DL_TX)) { if (priv->tx_traffic && iwl_have_debug_level(IWL_DL_TX)) {
ptr = priv->tx_traffic; ptr = priv->tx_traffic;
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
...@@ -950,10 +934,8 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file, ...@@ -950,10 +934,8 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file,
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
/* /*
* the statistic information display here is based on * the statistic information display here is based on
...@@ -1379,10 +1361,8 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file, ...@@ -1379,10 +1361,8 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
/* the statistic information display here is based on /* the statistic information display here is based on
* the last statistics notification from uCode * the last statistics notification from uCode
...@@ -1581,10 +1561,8 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file, ...@@ -1581,10 +1561,8 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file,
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
/* the statistic information display here is based on /* the statistic information display here is based on
* the last statistics notification from uCode * the last statistics notification from uCode
...@@ -1707,16 +1685,11 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file, ...@@ -1707,16 +1685,11 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
ret = iwl_send_statistics_request(priv, CMD_SYNC, false); ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
if (ret) { if (ret)
IWL_ERR(priv,
"Error sending statistics request: %zd\n", ret);
return -EAGAIN; return -EAGAIN;
}
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
/* /*
* the statistic information display here is based on * the statistic information display here is based on
...@@ -1793,10 +1766,8 @@ static ssize_t iwl_dbgfs_reply_tx_error_read(struct file *file, ...@@ -1793,10 +1766,8 @@ static ssize_t iwl_dbgfs_reply_tx_error_read(struct file *file,
return -EAGAIN; return -EAGAIN;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n"); pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n");
pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n", pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n",
...@@ -1936,10 +1907,8 @@ static ssize_t iwl_dbgfs_sensitivity_read(struct file *file, ...@@ -1936,10 +1907,8 @@ static ssize_t iwl_dbgfs_sensitivity_read(struct file *file,
data = &priv->sensitivity_data; data = &priv->sensitivity_data;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm:\t\t\t %u\n", pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm:\t\t\t %u\n",
data->auto_corr_ofdm); data->auto_corr_ofdm);
...@@ -2017,10 +1986,8 @@ static ssize_t iwl_dbgfs_chain_noise_read(struct file *file, ...@@ -2017,10 +1986,8 @@ static ssize_t iwl_dbgfs_chain_noise_read(struct file *file,
data = &priv->chain_noise_data; data = &priv->chain_noise_data;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
pos += scnprintf(buf + pos, bufsz - pos, "active_chains:\t\t\t %u\n", pos += scnprintf(buf + pos, bufsz - pos, "active_chains:\t\t\t %u\n",
data->active_chains); data->active_chains);
......
...@@ -1825,10 +1825,9 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file, ...@@ -1825,10 +1825,9 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,
bufsz = sizeof(char) * 64 * trans->cfg->base_params->num_of_queues; bufsz = sizeof(char) * 64 * trans->cfg->base_params->num_of_queues;
if (!trans_pcie->txq) { if (!trans_pcie->txq)
IWL_ERR(trans, "txq not ready\n");
return -EAGAIN; return -EAGAIN;
}
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
...@@ -1889,10 +1888,8 @@ static ssize_t iwl_dbgfs_interrupt_read(struct file *file, ...@@ -1889,10 +1888,8 @@ static ssize_t iwl_dbgfs_interrupt_read(struct file *file,
ssize_t ret; ssize_t ret;
buf = kzalloc(bufsz, GFP_KERNEL); buf = kzalloc(bufsz, GFP_KERNEL);
if (!buf) { if (!buf)
IWL_ERR(trans, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
}
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
"Interrupt Statistics Report:\n"); "Interrupt Statistics Report:\n");
......
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