aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-06-10 02:30:03 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-06-13 11:46:41 -0400
commit64f6ebe63914835ad5cd5bc4c490f3deaeac2511 (patch)
treea8f01cf641a850ce17d71ef05bd236d6f14d0b35
parent1c146cd46fccfaa5525152f086da2752fe0ed4dd (diff)
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>
-rw-r--r--arch/mips/include/asm/netlogic/xlr/fmn.h4
-rw-r--r--arch/mips/netlogic/xlr/fmn.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/mips/include/asm/netlogic/xlr/fmn.h b/arch/mips/include/asm/netlogic/xlr/fmn.h
index 56c7b85ea7dd..5604db3d1836 100644
--- a/arch/mips/include/asm/netlogic/xlr/fmn.h
+++ b/arch/mips/include/asm/netlogic/xlr/fmn.h
@@ -241,7 +241,7 @@ static inline void nlm_msgwait(unsigned int mask)
241/* 241/*
242 * Disable interrupts and enable COP2 access 242 * Disable interrupts and enable COP2 access
243 */ 243 */
244static inline uint32_t nlm_cop2_enable(void) 244static inline uint32_t nlm_cop2_enable_irqsave(void)
245{ 245{
246 uint32_t sr = read_c0_status(); 246 uint32_t sr = read_c0_status();
247 247
@@ -249,7 +249,7 @@ static inline uint32_t nlm_cop2_enable(void)
249 return sr; 249 return sr;
250} 250}
251 251
252static inline void nlm_cop2_restore(uint32_t sr) 252static inline void nlm_cop2_disable_irqrestore(uint32_t sr)
253{ 253{
254 write_c0_status(sr); 254 write_c0_status(sr);
255} 255}
diff --git a/arch/mips/netlogic/xlr/fmn.c b/arch/mips/netlogic/xlr/fmn.c
index 0fdce61857cd..d428e8471eec 100644
--- a/arch/mips/netlogic/xlr/fmn.c
+++ b/arch/mips/netlogic/xlr/fmn.c
@@ -74,7 +74,7 @@ static irqreturn_t fmn_message_handler(int irq, void *data)
74 struct nlm_fmn_msg msg; 74 struct nlm_fmn_msg msg;
75 uint32_t mflags, bkt_status; 75 uint32_t mflags, bkt_status;
76 76
77 mflags = nlm_cop2_enable(); 77 mflags = nlm_cop2_enable_irqsave();
78 /* Disable message ring interrupt */ 78 /* Disable message ring interrupt */
79 nlm_fmn_setup_intr(irq, 0); 79 nlm_fmn_setup_intr(irq, 0);
80 while (1) { 80 while (1) {
@@ -97,16 +97,16 @@ static irqreturn_t fmn_message_handler(int irq, void *data)
97 pr_warn("No msgring handler for stnid %d\n", 97 pr_warn("No msgring handler for stnid %d\n",
98 src_stnid); 98 src_stnid);
99 else { 99 else {
100 nlm_cop2_restore(mflags); 100 nlm_cop2_disable_irqrestore(mflags);
101 hndlr->action(bucket, src_stnid, size, code, 101 hndlr->action(bucket, src_stnid, size, code,
102 &msg, hndlr->arg); 102 &msg, hndlr->arg);
103 mflags = nlm_cop2_enable(); 103 mflags = nlm_cop2_enable_irqsave();
104 } 104 }
105 } 105 }
106 }; 106 };
107 /* Enable message ring intr, to any thread in core */ 107 /* Enable message ring intr, to any thread in core */
108 nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1); 108 nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1);
109 nlm_cop2_restore(mflags); 109 nlm_cop2_disable_irqrestore(mflags);
110 return IRQ_HANDLED; 110 return IRQ_HANDLED;
111} 111}
112 112
@@ -128,7 +128,7 @@ void xlr_percpu_fmn_init(void)
128 128
129 bucket_sizes = xlr_board_fmn_config.bucket_size; 129 bucket_sizes = xlr_board_fmn_config.bucket_size;
130 cpu_fmn_info = &xlr_board_fmn_config.cpu[id]; 130 cpu_fmn_info = &xlr_board_fmn_config.cpu[id];
131 flags = nlm_cop2_enable(); 131 flags = nlm_cop2_enable_irqsave();
132 132
133 /* Setup bucket sizes for the core. */ 133 /* Setup bucket sizes for the core. */
134 nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]); 134 nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]);
@@ -166,7 +166,7 @@ void xlr_percpu_fmn_init(void)
166 166
167 /* enable FMN interrupts on this CPU */ 167 /* enable FMN interrupts on this CPU */
168 nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1); 168 nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
169 nlm_cop2_restore(flags); 169 nlm_cop2_disable_irqrestore(flags);
170} 170}
171 171
172 172
@@ -198,7 +198,7 @@ void nlm_setup_fmn_irq(void)
198 /* setup irq only once */ 198 /* setup irq only once */
199 setup_irq(IRQ_FMN, &fmn_irqaction); 199 setup_irq(IRQ_FMN, &fmn_irqaction);
200 200
201 flags = nlm_cop2_enable(); 201 flags = nlm_cop2_enable_irqsave();
202 nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1); 202 nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1);
203 nlm_cop2_restore(flags); 203 nlm_cop2_disable_irqrestore(flags);
204} 204}