[Top] [All Lists]

Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k

To: Ralf Baechle <>
Subject: Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k
From: John Crispin <>
Date: Thu, 01 Aug 2013 16:16:47 +0200
Cc:, Florian Fainelli <>
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <> <> <1687511.8JA8mPPmNW@lenovo> <> <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

setup_irq() may fail but set_mode doesn't have a way to communicate an
error - other than leaving back a half-wrecked system so set_mode is not
a good place to do that kind of job.

much like the current code which does not check set_mode either. also, a core that boots and cannot get its clock irq is not half wrecked, its fully wrecked and wont be able to boot anyway.

How about using get_c0_compare_int() for a solution?  Currently
get_c0_compare_int() can not return an error.  If it could return a
negative value to indicate the unavailability of an interrupt for
cevt-r4k's use, that interrupt would be available for alternative use.

the code could be changed but get_c0_compare_int() returns an unsigned so that would require changing the return value everywhere the function is defined.

i still think that my proposed patch is valid, we could add a panic call if set_mode fails. having your kernel tell you to start an instance of your main clock and not being able to request said irq, does look like a valid cause for a panic() to me


<Prev in Thread] Current Thread [Next in Thread>