MIPS: Netlogic: rename nlm_cop2_save/restore
Rename macro nlm_cop2_enable() to nlm_cop2_enable_irqsave() and the macro nlm_cop2_restore to nlm_cop2_disable_irqrestore(). The new names will reflect the functionality better, and will make nlm_cop2_restore() available to be used later in COP2 save/restore patch. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Cc: ddaney.cavm@gmail.com Patchwork: https://patchwork.linux-mips.org/patch/5412/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
1c146cd46f
commit
64f6ebe639
|
@ -241,7 +241,7 @@ static inline void nlm_msgwait(unsigned int mask)
|
||||||
/*
|
/*
|
||||||
* Disable interrupts and enable COP2 access
|
* Disable interrupts and enable COP2 access
|
||||||
*/
|
*/
|
||||||
static inline uint32_t nlm_cop2_enable(void)
|
static inline uint32_t nlm_cop2_enable_irqsave(void)
|
||||||
{
|
{
|
||||||
uint32_t sr = read_c0_status();
|
uint32_t sr = read_c0_status();
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ static inline uint32_t nlm_cop2_enable(void)
|
||||||
return sr;
|
return sr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void nlm_cop2_restore(uint32_t sr)
|
static inline void nlm_cop2_disable_irqrestore(uint32_t sr)
|
||||||
{
|
{
|
||||||
write_c0_status(sr);
|
write_c0_status(sr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ static irqreturn_t fmn_message_handler(int irq, void *data)
|
||||||
struct nlm_fmn_msg msg;
|
struct nlm_fmn_msg msg;
|
||||||
uint32_t mflags, bkt_status;
|
uint32_t mflags, bkt_status;
|
||||||
|
|
||||||
mflags = nlm_cop2_enable();
|
mflags = nlm_cop2_enable_irqsave();
|
||||||
/* Disable message ring interrupt */
|
/* Disable message ring interrupt */
|
||||||
nlm_fmn_setup_intr(irq, 0);
|
nlm_fmn_setup_intr(irq, 0);
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -97,16 +97,16 @@ static irqreturn_t fmn_message_handler(int irq, void *data)
|
||||||
pr_warn("No msgring handler for stnid %d\n",
|
pr_warn("No msgring handler for stnid %d\n",
|
||||||
src_stnid);
|
src_stnid);
|
||||||
else {
|
else {
|
||||||
nlm_cop2_restore(mflags);
|
nlm_cop2_disable_irqrestore(mflags);
|
||||||
hndlr->action(bucket, src_stnid, size, code,
|
hndlr->action(bucket, src_stnid, size, code,
|
||||||
&msg, hndlr->arg);
|
&msg, hndlr->arg);
|
||||||
mflags = nlm_cop2_enable();
|
mflags = nlm_cop2_enable_irqsave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/* Enable message ring intr, to any thread in core */
|
/* Enable message ring intr, to any thread in core */
|
||||||
nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1);
|
nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1);
|
||||||
nlm_cop2_restore(mflags);
|
nlm_cop2_disable_irqrestore(mflags);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ void xlr_percpu_fmn_init(void)
|
||||||
|
|
||||||
bucket_sizes = xlr_board_fmn_config.bucket_size;
|
bucket_sizes = xlr_board_fmn_config.bucket_size;
|
||||||
cpu_fmn_info = &xlr_board_fmn_config.cpu[id];
|
cpu_fmn_info = &xlr_board_fmn_config.cpu[id];
|
||||||
flags = nlm_cop2_enable();
|
flags = nlm_cop2_enable_irqsave();
|
||||||
|
|
||||||
/* Setup bucket sizes for the core. */
|
/* Setup bucket sizes for the core. */
|
||||||
nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]);
|
nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]);
|
||||||
|
@ -166,7 +166,7 @@ void xlr_percpu_fmn_init(void)
|
||||||
|
|
||||||
/* enable FMN interrupts on this CPU */
|
/* enable FMN interrupts on this CPU */
|
||||||
nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
|
nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
|
||||||
nlm_cop2_restore(flags);
|
nlm_cop2_disable_irqrestore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ void nlm_setup_fmn_irq(void)
|
||||||
/* setup irq only once */
|
/* setup irq only once */
|
||||||
setup_irq(IRQ_FMN, &fmn_irqaction);
|
setup_irq(IRQ_FMN, &fmn_irqaction);
|
||||||
|
|
||||||
flags = nlm_cop2_enable();
|
flags = nlm_cop2_enable_irqsave();
|
||||||
nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
|
nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
|
||||||
nlm_cop2_restore(flags);
|
nlm_cop2_disable_irqrestore(flags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue