diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_l3_smx.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_l3_smx.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c index 4321e7938929..873c0e33b512 100644 --- a/arch/arm/mach-omap2/omap_l3_smx.c +++ b/arch/arm/mach-omap2/omap_l3_smx.c | |||
@@ -155,7 +155,7 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3, | |||
155 | u8 multi = error & L3_ERROR_LOG_MULTI; | 155 | u8 multi = error & L3_ERROR_LOG_MULTI; |
156 | u32 address = omap3_l3_decode_addr(error_addr); | 156 | u32 address = omap3_l3_decode_addr(error_addr); |
157 | 157 | ||
158 | WARN(true, "%s Error seen by %s %s at address %x\n", | 158 | WARN(true, "%s seen by %s %s at address %x\n", |
159 | omap3_l3_code_string(code), | 159 | omap3_l3_code_string(code), |
160 | omap3_l3_initiator_string(initid), | 160 | omap3_l3_initiator_string(initid), |
161 | multi ? "Multiple Errors" : "", | 161 | multi ? "Multiple Errors" : "", |
@@ -167,21 +167,15 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3, | |||
167 | static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | 167 | static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) |
168 | { | 168 | { |
169 | struct omap3_l3 *l3 = _l3; | 169 | struct omap3_l3 *l3 = _l3; |
170 | |||
171 | u64 status, clear; | 170 | u64 status, clear; |
172 | u64 error; | 171 | u64 error; |
173 | u64 error_addr; | 172 | u64 error_addr; |
174 | u64 err_source = 0; | 173 | u64 err_source = 0; |
175 | void __iomem *base; | 174 | void __iomem *base; |
176 | int int_type; | 175 | int int_type; |
177 | |||
178 | irqreturn_t ret = IRQ_NONE; | 176 | irqreturn_t ret = IRQ_NONE; |
179 | 177 | ||
180 | if (irq == l3->app_irq) | 178 | int_type = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR; |
181 | int_type = L3_APPLICATION_ERROR; | ||
182 | else | ||
183 | int_type = L3_DEBUG_ERROR; | ||
184 | |||
185 | if (!int_type) { | 179 | if (!int_type) { |
186 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0); | 180 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0); |
187 | /* | 181 | /* |
@@ -202,7 +196,6 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | |||
202 | 196 | ||
203 | base = l3->rt + *(omap3_l3_bases[int_type] + err_source); | 197 | base = l3->rt + *(omap3_l3_bases[int_type] + err_source); |
204 | error = omap3_l3_readll(base, L3_ERROR_LOG); | 198 | error = omap3_l3_readll(base, L3_ERROR_LOG); |
205 | |||
206 | if (error) { | 199 | if (error) { |
207 | error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR); | 200 | error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR); |
208 | 201 | ||
@@ -210,9 +203,8 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | |||
210 | } | 203 | } |
211 | 204 | ||
212 | /* Clear the status register */ | 205 | /* Clear the status register */ |
213 | clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) | | 206 | clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) | |
214 | (L3_AGENT_STATUS_CLEAR_TA)); | 207 | L3_AGENT_STATUS_CLEAR_TA; |
215 | |||
216 | omap3_l3_writell(base, L3_AGENT_STATUS, clear); | 208 | omap3_l3_writell(base, L3_AGENT_STATUS, clear); |
217 | 209 | ||
218 | /* clear the error log register */ | 210 | /* clear the error log register */ |
@@ -228,10 +220,8 @@ static int __init omap3_l3_probe(struct platform_device *pdev) | |||
228 | int ret; | 220 | int ret; |
229 | 221 | ||
230 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | 222 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); |
231 | if (!l3) { | 223 | if (!l3) |
232 | ret = -ENOMEM; | 224 | return -ENOMEM; |
233 | goto err0; | ||
234 | } | ||
235 | 225 | ||
236 | platform_set_drvdata(pdev, l3); | 226 | platform_set_drvdata(pdev, l3); |
237 | 227 | ||
@@ -239,13 +229,13 @@ static int __init omap3_l3_probe(struct platform_device *pdev) | |||
239 | if (!res) { | 229 | if (!res) { |
240 | dev_err(&pdev->dev, "couldn't find resource\n"); | 230 | dev_err(&pdev->dev, "couldn't find resource\n"); |
241 | ret = -ENODEV; | 231 | ret = -ENODEV; |
242 | goto err1; | 232 | goto err0; |
243 | } | 233 | } |
244 | l3->rt = ioremap(res->start, resource_size(res)); | 234 | l3->rt = ioremap(res->start, resource_size(res)); |
245 | if (!(l3->rt)) { | 235 | if (!l3->rt) { |
246 | dev_err(&pdev->dev, "ioremap failed\n"); | 236 | dev_err(&pdev->dev, "ioremap failed\n"); |
247 | ret = -ENOMEM; | 237 | ret = -ENOMEM; |
248 | goto err2; | 238 | goto err0; |
249 | } | 239 | } |
250 | 240 | ||
251 | l3->debug_irq = platform_get_irq(pdev, 0); | 241 | l3->debug_irq = platform_get_irq(pdev, 0); |
@@ -254,28 +244,26 @@ static int __init omap3_l3_probe(struct platform_device *pdev) | |||
254 | "l3-debug-irq", l3); | 244 | "l3-debug-irq", l3); |
255 | if (ret) { | 245 | if (ret) { |
256 | dev_err(&pdev->dev, "couldn't request debug irq\n"); | 246 | dev_err(&pdev->dev, "couldn't request debug irq\n"); |
257 | goto err3; | 247 | goto err1; |
258 | } | 248 | } |
259 | 249 | ||
260 | l3->app_irq = platform_get_irq(pdev, 1); | 250 | l3->app_irq = platform_get_irq(pdev, 1); |
261 | ret = request_irq(l3->app_irq, omap3_l3_app_irq, | 251 | ret = request_irq(l3->app_irq, omap3_l3_app_irq, |
262 | IRQF_DISABLED | IRQF_TRIGGER_RISING, | 252 | IRQF_DISABLED | IRQF_TRIGGER_RISING, |
263 | "l3-app-irq", l3); | 253 | "l3-app-irq", l3); |
264 | |||
265 | if (ret) { | 254 | if (ret) { |
266 | dev_err(&pdev->dev, "couldn't request app irq\n"); | 255 | dev_err(&pdev->dev, "couldn't request app irq\n"); |
267 | goto err4; | 256 | goto err2; |
268 | } | 257 | } |
269 | 258 | ||
270 | goto err0; | 259 | return 0; |
271 | 260 | ||
272 | err4: | ||
273 | err3: | ||
274 | iounmap(l3->rt); | ||
275 | err2: | 261 | err2: |
262 | free_irq(l3->debug_irq, l3); | ||
276 | err1: | 263 | err1: |
277 | kfree(l3); | 264 | iounmap(l3->rt); |
278 | err0: | 265 | err0: |
266 | kfree(l3); | ||
279 | return ret; | 267 | return ret; |
280 | } | 268 | } |
281 | 269 | ||