mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge "Merge android11-5.4.274 (564901b) into msm-5.4"
This commit is contained in:
commit
13dd90963a
743 changed files with 56266 additions and 54424 deletions
|
|
@ -996,7 +996,7 @@ struct qman_portal {
|
|||
/* linked-list of CSCN handlers. */
|
||||
struct list_head cgr_cbs;
|
||||
/* list lock */
|
||||
spinlock_t cgr_lock;
|
||||
raw_spinlock_t cgr_lock;
|
||||
struct work_struct congestion_work;
|
||||
struct work_struct mr_work;
|
||||
char irqname[MAX_IRQNAME];
|
||||
|
|
@ -1286,7 +1286,7 @@ static int qman_create_portal(struct qman_portal *portal,
|
|||
/* if the given mask is NULL, assume all CGRs can be seen */
|
||||
qman_cgrs_fill(&portal->cgrs[0]);
|
||||
INIT_LIST_HEAD(&portal->cgr_cbs);
|
||||
spin_lock_init(&portal->cgr_lock);
|
||||
raw_spin_lock_init(&portal->cgr_lock);
|
||||
INIT_WORK(&portal->congestion_work, qm_congestion_task);
|
||||
INIT_WORK(&portal->mr_work, qm_mr_process_task);
|
||||
portal->bits = 0;
|
||||
|
|
@ -1461,11 +1461,14 @@ static void qm_congestion_task(struct work_struct *work)
|
|||
union qm_mc_result *mcr;
|
||||
struct qman_cgr *cgr;
|
||||
|
||||
spin_lock(&p->cgr_lock);
|
||||
/*
|
||||
* FIXME: QM_MCR_TIMEOUT is 10ms, which is too long for a raw spinlock!
|
||||
*/
|
||||
raw_spin_lock_irq(&p->cgr_lock);
|
||||
qm_mc_start(&p->p);
|
||||
qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION);
|
||||
if (!qm_mc_result_timeout(&p->p, &mcr)) {
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
dev_crit(p->config->dev, "QUERYCONGESTION timeout\n");
|
||||
qman_p_irqsource_add(p, QM_PIRQ_CSCI);
|
||||
return;
|
||||
|
|
@ -1481,7 +1484,7 @@ static void qm_congestion_task(struct work_struct *work)
|
|||
list_for_each_entry(cgr, &p->cgr_cbs, node)
|
||||
if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid))
|
||||
cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid));
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
qman_p_irqsource_add(p, QM_PIRQ_CSCI);
|
||||
}
|
||||
|
||||
|
|
@ -2438,7 +2441,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
|
|||
preempt_enable();
|
||||
|
||||
cgr->chan = p->config->channel;
|
||||
spin_lock(&p->cgr_lock);
|
||||
raw_spin_lock_irq(&p->cgr_lock);
|
||||
|
||||
if (opts) {
|
||||
struct qm_mcc_initcgr local_opts = *opts;
|
||||
|
|
@ -2475,12 +2478,28 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
|
|||
qman_cgrs_get(&p->cgrs[1], cgr->cgrid))
|
||||
cgr->cb(p, cgr, 1);
|
||||
out:
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(qman_create_cgr);
|
||||
|
||||
static struct qman_portal *qman_cgr_get_affine_portal(struct qman_cgr *cgr)
|
||||
{
|
||||
struct qman_portal *p = get_affine_portal();
|
||||
|
||||
if (cgr->chan != p->config->channel) {
|
||||
/* attempt to delete from other portal than creator */
|
||||
dev_err(p->config->dev, "CGR not owned by current portal");
|
||||
dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n",
|
||||
cgr->chan, p->config->channel);
|
||||
put_affine_portal();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
int qman_delete_cgr(struct qman_cgr *cgr)
|
||||
{
|
||||
unsigned long irqflags;
|
||||
|
|
@ -2488,19 +2507,13 @@ int qman_delete_cgr(struct qman_cgr *cgr)
|
|||
struct qm_mcc_initcgr local_opts;
|
||||
int ret = 0;
|
||||
struct qman_cgr *i;
|
||||
struct qman_portal *p = get_affine_portal();
|
||||
struct qman_portal *p = qman_cgr_get_affine_portal(cgr);
|
||||
|
||||
if (cgr->chan != p->config->channel) {
|
||||
/* attempt to delete from other portal than creator */
|
||||
dev_err(p->config->dev, "CGR not owned by current portal");
|
||||
dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n",
|
||||
cgr->chan, p->config->channel);
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
ret = -EINVAL;
|
||||
goto put_portal;
|
||||
}
|
||||
memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr));
|
||||
spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
list_del(&cgr->node);
|
||||
/*
|
||||
* If there are no other CGR objects for this CGRID in the list,
|
||||
|
|
@ -2525,8 +2538,7 @@ int qman_delete_cgr(struct qman_cgr *cgr)
|
|||
/* add back to the list */
|
||||
list_add(&cgr->node, &p->cgr_cbs);
|
||||
release_lock:
|
||||
spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_portal:
|
||||
raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2557,6 +2569,54 @@ void qman_delete_cgr_safe(struct qman_cgr *cgr)
|
|||
}
|
||||
EXPORT_SYMBOL(qman_delete_cgr_safe);
|
||||
|
||||
static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
|
||||
{
|
||||
int ret;
|
||||
unsigned long irqflags;
|
||||
struct qman_portal *p = qman_cgr_get_affine_portal(cgr);
|
||||
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
ret = qm_modify_cgr(cgr, 0, opts);
|
||||
raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct update_cgr_params {
|
||||
struct qman_cgr *cgr;
|
||||
struct qm_mcc_initcgr *opts;
|
||||
int ret;
|
||||
};
|
||||
|
||||
static void qman_update_cgr_smp_call(void *p)
|
||||
{
|
||||
struct update_cgr_params *params = p;
|
||||
|
||||
params->ret = qman_update_cgr(params->cgr, params->opts);
|
||||
}
|
||||
|
||||
int qman_update_cgr_safe(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
|
||||
{
|
||||
struct update_cgr_params params = {
|
||||
.cgr = cgr,
|
||||
.opts = opts,
|
||||
};
|
||||
|
||||
preempt_disable();
|
||||
if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id())
|
||||
smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
|
||||
qman_update_cgr_smp_call, ¶ms,
|
||||
true);
|
||||
else
|
||||
params.ret = qman_update_cgr(cgr, opts);
|
||||
preempt_enable();
|
||||
return params.ret;
|
||||
}
|
||||
EXPORT_SYMBOL(qman_update_cgr_safe);
|
||||
|
||||
/* Cleanup FQs */
|
||||
|
||||
static int _qm_mr_consume_and_match_verb(struct qm_portal *p, int v)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ static const struct rcar_sysc_area r8a77980_areas[] __initconst = {
|
|||
PD_CPU_NOCR },
|
||||
{ "ca53-cpu3", 0x200, 3, R8A77980_PD_CA53_CPU3, R8A77980_PD_CA53_SCU,
|
||||
PD_CPU_NOCR },
|
||||
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON },
|
||||
{ "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON,
|
||||
PD_CPU_NOCR },
|
||||
{ "a3ir", 0x180, 0, R8A77980_PD_A3IR, R8A77980_PD_ALWAYS_ON },
|
||||
{ "a2ir0", 0x400, 0, R8A77980_PD_A2IR0, R8A77980_PD_A3IR },
|
||||
{ "a2ir1", 0x400, 1, R8A77980_PD_A2IR1, R8A77980_PD_A3IR },
|
||||
|
|
|
|||
Loading…
Reference in a new issue