Re: [PM-WIP-OPP][PATCH 1/4] omap3: pm: cpufreq: BUG_ON cleanup

Felipe Balbi
2010-03-19T14:51:47Z

On Fri, Mar 19, 2010 at 03:21:34PM +0100, ext Nishanth Menon wrote:
>Kevin Hilman had written, on 03/18/2010 05:49 PM, the following:
>> Nishanth Menon <nm@ti.com> writes:
>>
>>> BUG_ON should not ideally contain a functional code. Remove it out.
>>
>> True. But this code should not be using BUG_ON() in the first place.
>>
>> We should not crash the whole kernel in this case, just fail
>> with a warning.
>>
>> If you're cleaning this up, can you make it fail more gracefully.
>I agree if this was a preipheral driver or a non-critical path. but in
>this case:
>
>a) we are speaking of a core description of the h/w - OPPs frequencies
>and voltages which out which the functionality of the system is at
>stake. I am not speaking of just having a basic kernel boot up to shell
>prompt - we need the kernel to do much better than that.
>
>b) Is there any reason why the registration could fail - if it did fail
>at this point, there is something catastrophic happening - some other
>driver is going beserk OR Opp layer is by itself screwed up - why
>continue if we can warn the system and force a fix of the code?

I agree with Nishanth here. If it fails at this point, we deserve the
BUG().

--
balbi