Skip to content

Commit

Permalink
iwlwifi: remove flags argument for nic_access
Browse files Browse the repository at this point in the history
Since we no longer save interrupts, we no longer need the flags
argument here, remove it throughout.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210142629.8de8fe6f9fff.If040b056d0e8c771c65ac5c29230f939354a142b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
  • Loading branch information
Johannes Berg authored and Luca Coelho committed Feb 10, 2021
1 parent c52b251 commit 1ed08f6
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 101 deletions.
10 changes: 4 additions & 6 deletions drivers/net/wireless/intel/iwlwifi/dvm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
u32 i;
u32 ptr; /* SRAM byte address of log data */
u32 ev, time, data; /* event log data */
unsigned long reg_flags;

if (mode == 0)
ptr = base + (4 * sizeof(u32)) + (start_idx * 2 * sizeof(u32));
else
ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32));

/* Make sure device is powered up for SRAM reads */
if (!iwl_trans_grab_nic_access(priv->trans, &reg_flags))
if (!iwl_trans_grab_nic_access(priv->trans))
return;

/* Set starting address; reads will auto-increment */
Expand Down Expand Up @@ -446,7 +445,7 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
}
}
/* Allow device to power down */
iwl_trans_release_nic_access(priv->trans, &reg_flags);
iwl_trans_release_nic_access(priv->trans);
}

static void iwl_continuous_event_trace(struct iwl_priv *priv)
Expand Down Expand Up @@ -1694,7 +1693,6 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
u32 ptr; /* SRAM byte address of log data */
u32 ev, time, data; /* event log data */
unsigned long reg_flags;

struct iwl_trans *trans = priv->trans;

Expand All @@ -1718,7 +1716,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
ptr = base + EVENT_START_OFFSET + (start_idx * event_size);

/* Make sure device is powered up for SRAM reads */
if (!iwl_trans_grab_nic_access(trans, &reg_flags))
if (!iwl_trans_grab_nic_access(trans))
return pos;

/* Set starting address; reads will auto-increment */
Expand Down Expand Up @@ -1757,7 +1755,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
}

/* Allow device to power down */
iwl_trans_release_nic_access(trans, &reg_flags);
iwl_trans_release_nic_access(trans);
return pos;
}

Expand Down
7 changes: 3 additions & 4 deletions drivers/net/wireless/intel/iwlwifi/dvm/tt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Intel Corporation
* Copyright (C) 2018, 2020 Intel Corporation
*
* Portions of this file are derived from the ipw3945 project, as well
* as portions of the ieee80211 subsystem header files.
Expand Down Expand Up @@ -155,7 +155,6 @@ static void iwl_tt_check_exit_ct_kill(struct timer_list *t)
struct iwl_priv *priv = from_timer(priv, t,
thermal_throttle.ct_kill_exit_tm);
struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
unsigned long flags;

if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return;
Expand All @@ -171,8 +170,8 @@ static void iwl_tt_check_exit_ct_kill(struct timer_list *t)
priv->thermal_throttle.ct_kill_toggle = true;
}
iwl_read32(priv->trans, CSR_UCODE_DRV_GP1);
if (iwl_trans_grab_nic_access(priv->trans, &flags))
iwl_trans_release_nic_access(priv->trans, &flags);
if (iwl_trans_grab_nic_access(priv->trans))
iwl_trans_release_nic_access(priv->trans);

/* Reschedule the ct_kill timer to occur in
* CT_KILL_EXIT_DURATION seconds to ensure we get a
Expand Down
45 changes: 18 additions & 27 deletions drivers/net/wireless/intel/iwlwifi/fw/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ static void iwl_read_radio_regs(struct iwl_fw_runtime *fwrt,
struct iwl_fw_error_dump_data **dump_data)
{
u8 *pos = (void *)(*dump_data)->data;
unsigned long flags;
int i;

IWL_DEBUG_INFO(fwrt, "WRT radio registers dump\n");

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return;

(*dump_data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_RADIO_REG);
Expand All @@ -56,7 +55,7 @@ static void iwl_read_radio_regs(struct iwl_fw_runtime *fwrt,

*dump_data = iwl_fw_error_next_data(*dump_data);

iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);
}

static void iwl_fwrt_dump_rxf(struct iwl_fw_runtime *fwrt,
Expand Down Expand Up @@ -172,11 +171,10 @@ static void iwl_fw_dump_rxf(struct iwl_fw_runtime *fwrt,
struct iwl_fw_error_dump_data **dump_data)
{
struct iwl_fwrt_shared_mem_cfg *cfg = &fwrt->smem_cfg;
unsigned long flags;

IWL_DEBUG_INFO(fwrt, "WRT RX FIFO dump\n");

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return;

if (iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_RXF)) {
Expand All @@ -194,7 +192,7 @@ static void iwl_fw_dump_rxf(struct iwl_fw_runtime *fwrt,
LMAC2_PRPH_OFFSET, 2);
}

iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);
}

static void iwl_fw_dump_txf(struct iwl_fw_runtime *fwrt,
Expand All @@ -204,12 +202,11 @@ static void iwl_fw_dump_txf(struct iwl_fw_runtime *fwrt,
struct iwl_fwrt_shared_mem_cfg *cfg = &fwrt->smem_cfg;
u32 *fifo_data;
u32 fifo_len;
unsigned long flags;
int i, j;

IWL_DEBUG_INFO(fwrt, "WRT TX FIFO dump\n");

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return;

if (iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_TXF)) {
Expand Down Expand Up @@ -299,7 +296,7 @@ static void iwl_fw_dump_txf(struct iwl_fw_runtime *fwrt,
}
}

iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);
}

#define IWL8260_ICCM_OFFSET 0x44000 /* Only for B-step */
Expand Down Expand Up @@ -527,15 +524,14 @@ static void iwl_dump_prph(struct iwl_fw_runtime *fwrt,
struct iwl_trans *trans = fwrt->trans;
struct iwl_fw_error_dump_data **data =
(struct iwl_fw_error_dump_data **)ptr;
unsigned long flags;
u32 i;

if (!data)
return;

IWL_DEBUG_INFO(trans, "WRT PRPH dump\n");

if (!iwl_trans_grab_nic_access(trans, &flags))
if (!iwl_trans_grab_nic_access(trans))
return;

for (i = 0; i < range_len; i++) {
Expand All @@ -558,7 +554,7 @@ static void iwl_dump_prph(struct iwl_fw_runtime *fwrt,
*data = iwl_fw_error_next_data(*data);
}

iwl_trans_release_nic_access(trans, &flags);
iwl_trans_release_nic_access(trans);
}

/*
Expand Down Expand Up @@ -1048,7 +1044,6 @@ iwl_dump_ini_prph_phy_iter(struct iwl_fw_runtime *fwrt,
u32 addr = le32_to_cpu(reg->addrs[idx]);
u32 dphy_state;
u32 dphy_addr;
unsigned long flags;
int i;

range->internal_base_addr = cpu_to_le32(addr);
Expand All @@ -1060,7 +1055,7 @@ iwl_dump_ini_prph_phy_iter(struct iwl_fw_runtime *fwrt,
indirect_wr_addr += le32_to_cpu(reg->dev_addr.offset);
indirect_rd_addr += le32_to_cpu(reg->dev_addr.offset);

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return -EBUSY;

dphy_addr = (reg->dev_addr.offset) ? WFPM_LMAC2_PS_CTL_RW :
Expand All @@ -1082,7 +1077,7 @@ iwl_dump_ini_prph_phy_iter(struct iwl_fw_runtime *fwrt,
*val++ = cpu_to_le32(prph_val);
}

iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);
return sizeof(*range) + le32_to_cpu(range->range_data_size);
}

Expand Down Expand Up @@ -1297,13 +1292,12 @@ static int iwl_dump_ini_txf_iter(struct iwl_fw_runtime *fwrt,
u32 registers_num = iwl_tlv_array_len(reg_data->reg_tlv, reg, addrs);
u32 registers_size = registers_num * sizeof(*reg_dump);
__le32 *data;
unsigned long flags;
int i;

if (!iwl_ini_txf_iter(fwrt, reg_data, idx))
return -EIO;

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return -EBUSY;

range->fifo_hdr.fifo_num = cpu_to_le32(iter->fifo);
Expand Down Expand Up @@ -1345,7 +1339,7 @@ static int iwl_dump_ini_txf_iter(struct iwl_fw_runtime *fwrt,
*data++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr));

out:
iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);

return sizeof(*range) + le32_to_cpu(range->range_data_size);
}
Expand Down Expand Up @@ -1429,14 +1423,13 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt,
u32 registers_num = iwl_tlv_array_len(reg_data->reg_tlv, reg, addrs);
u32 registers_size = registers_num * sizeof(*reg_dump);
__le32 *data;
unsigned long flags;
int i;

iwl_ini_get_rxf_data(fwrt, reg_data, &rxf_data);
if (!rxf_data.size)
return -EIO;

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags))
if (!iwl_trans_grab_nic_access(fwrt->trans))
return -EBUSY;

range->fifo_hdr.fifo_num = cpu_to_le32(rxf_data.fifo_num);
Expand Down Expand Up @@ -1479,7 +1472,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt,
*data++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr));

out:
iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);

return sizeof(*range) + le32_to_cpu(range->range_data_size);
}
Expand Down Expand Up @@ -1596,9 +1589,8 @@ iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt,
{
struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;
u32 alloc_id = le32_to_cpu(reg->dram_alloc_id);
unsigned long flags;

if (!iwl_trans_grab_nic_access(fwrt->trans, &flags)) {
if (!iwl_trans_grab_nic_access(fwrt->trans)) {
IWL_ERR(fwrt, "Failed to get monitor header\n");
return NULL;
}
Expand All @@ -1615,7 +1607,7 @@ iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt,
data->cur_frag = iwl_get_mon_reg(fwrt, alloc_id,
&addrs->cur_frag);

iwl_trans_release_nic_access(fwrt->trans, &flags);
iwl_trans_release_nic_access(fwrt->trans);

data->header.version = cpu_to_le32(IWL_INI_DUMP_VER);

Expand Down Expand Up @@ -2762,7 +2754,6 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_stop_sync);
void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt)
{
struct iwl_trans *trans = fwrt->trans;
unsigned long flags;
int i;
struct {
u32 addr;
Expand All @@ -2782,7 +2773,7 @@ void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt)
FSEQ_REG(CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR),
};

if (!iwl_trans_grab_nic_access(trans, &flags))
if (!iwl_trans_grab_nic_access(trans))
return;

IWL_ERR(fwrt, "Fseq Registers:\n");
Expand All @@ -2792,7 +2783,7 @@ void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt)
iwl_read_prph_no_grab(trans, fseq_regs[i].addr),
fseq_regs[i].str);

iwl_trans_release_nic_access(trans, &flags);
iwl_trans_release_nic_access(trans);
}
IWL_EXPORT_SYMBOL(iwl_fw_error_print_fseq_regs);

Expand Down
Loading

0 comments on commit 1ed08f6

Please sign in to comment.