Merge "ath10k: Define structure for copy engine interrupt map for SNOC"

This commit is contained in:
Linux Build Service Account 2017-05-16 06:49:49 -07:00 committed by Gerrit - the friendly Code Review server
commit 6b2b446623
2 changed files with 23 additions and 8 deletions

View file

@ -969,7 +969,7 @@ int ath10k_snoc_get_ce_id(struct ath10k *ar, int irq)
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
for (i = 0; i < CE_COUNT_MAX; i++) { for (i = 0; i < CE_COUNT_MAX; i++) {
if (ar_snoc->ce_irqs[i] == irq) if (ar_snoc->ce_irqs[i].irq_line == irq)
return i; return i;
} }
ath10k_err(ar, "No matching CE id for irq %d\n", irq); ath10k_err(ar, "No matching CE id for irq %d\n", irq);
@ -1002,15 +1002,17 @@ static int ath10k_snoc_request_irq(struct ath10k *ar)
int irqflags = IRQF_TRIGGER_RISING; int irqflags = IRQF_TRIGGER_RISING;
for (id = 0; id < CE_COUNT_MAX; id++) { for (id = 0; id < CE_COUNT_MAX; id++) {
ret = request_irq(ar_snoc->ce_irqs[id], ret = request_irq(ar_snoc->ce_irqs[id].irq_line,
ath10k_snoc_per_engine_handler, ath10k_snoc_per_engine_handler,
irqflags, ce_name[id], ar); irqflags, ce_name[id], ar);
if (ret) { if (ret) {
ath10k_err(ar, ath10k_err(ar,
"%s: cannot register CE %d irq handler, ret = %d", "%s: cannot register CE %d irq handler, ret = %d",
__func__, id, ret); __func__, id, ret);
free_irq(ar_snoc->ce_irqs[id], ar); atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 0);
return ret; return ret;
} else {
atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 1);
} }
} }
@ -1022,11 +1024,14 @@ static void ath10k_snoc_free_irq(struct ath10k *ar)
int id; int id;
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
for (id = 0; id < CE_COUNT_MAX; id++) for (id = 0; id < CE_COUNT_MAX; id++) {
free_irq(ar_snoc->ce_irqs[id], ar); if (atomic_read(&ar_snoc->ce_irqs[id].irq_req_stat)) {
free_irq(ar_snoc->ce_irqs[id].irq_line, ar);
atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 0);
}
}
} }
static int ath10k_snoc_get_soc_info(struct ath10k *ar) static int ath10k_snoc_get_soc_info(struct ath10k *ar)
{ {
struct resource *res; struct resource *res;
@ -1198,7 +1203,7 @@ static int ath10k_snoc_resource_init(struct ath10k *ar)
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} else { } else {
ar_snoc->ce_irqs[i] = res->start; ar_snoc->ce_irqs[i].irq_line = res->start;
} }
} }

View file

@ -103,6 +103,15 @@ struct ath10k_service_notifier_context {
char name[QMI_SERVREG_LOC_NAME_LENGTH_V01 + 1]; char name[QMI_SERVREG_LOC_NAME_LENGTH_V01 + 1];
}; };
/* struct ath10k_snoc_ce_irq: copy engine irq struct
* @irq_req_stat: irq request status
* @irq_line: irq line
*/
struct ath10k_snoc_ce_irq {
atomic_t irq_req_stat;
u32 irq_line;
};
/* struct ath10k_snoc: SNOC info struct /* struct ath10k_snoc: SNOC info struct
* @dev: device structure * @dev: device structure
* @ar:ath10k base structure * @ar:ath10k base structure
@ -111,6 +120,7 @@ struct ath10k_service_notifier_context {
* @target_info: snoc target info * @target_info: snoc target info
* @mem_len: mempry map length * @mem_len: mempry map length
* @pipe_info: pipe info struct * @pipe_info: pipe info struct
* @ce_irqs: copy engine irq list
* @ce_lock: protect ce structures * @ce_lock: protect ce structures
* @ce_states: maps ce id to ce state * @ce_states: maps ce id to ce state
* @rx_post_retry: rx buffer post processing timer * @rx_post_retry: rx buffer post processing timer
@ -134,7 +144,7 @@ struct ath10k_snoc {
size_t mem_len; size_t mem_len;
struct ath10k_snoc_pipe pipe_info[CE_COUNT_MAX]; struct ath10k_snoc_pipe pipe_info[CE_COUNT_MAX];
struct timer_list rx_post_retry; struct timer_list rx_post_retry;
u32 ce_irqs[CE_COUNT_MAX]; struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX];
u32 *vaddr_rri_on_ddr; u32 *vaddr_rri_on_ddr;
bool is_driver_probed; bool is_driver_probed;
struct notifier_block modem_ssr_nb; struct notifier_block modem_ssr_nb;