[PATCH 05/25] OMAP4: Use WARN_ON() instead of BUG_ON() with graceful exit

Jean Pihet jean.pihet at newoldbits.com
Thu Sep 8 14:51:32 EDT 2011


Hi Santosh,

On Mon, Sep 5, 2011 at 12:51 PM, Santosh <santosh.shilimkar at ti.com> wrote:
> On Monday 05 September 2011 04:17 PM, Russell King - ARM Linux wrote:
>>
>> On Mon, Sep 05, 2011 at 04:12:02PM +0530, Santosh wrote:
>>>
>>> On Monday 05 September 2011 03:41 PM, Sergei Shtylyov wrote:
>
> [..]
>
>>>>> /* Static mapping, never released */
>>>>> l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
>>>>> - BUG_ON(!l2cache_base);
>>>>> + if (WARN_ON(!l2cache_base))
>>>>> + return -ENODEV;
>>>>
>>>> Rather ENOMEM...
>>>>
>>> Nope. Even though it's related to memory, it's
>>> a memory controller so DEV is right.
>>
>> No it's not.  The most likely reason ioremap() fails is because:
>>
>> 1. it's run out of memory for the metadata or page tables.
>> 2. you passed it an invalid memory type (unlikely, you're using ioremap
>>    which uses a fixed known good type).
>> 3. the address was>4GB but was not section aligned (also unlikely).
>>
>> Therefore, the error code should be "out of memory" not "no such device".
>
> Got it. Will fix that.
Patch [07/25] has the same code and so will need fixing too.

Regards,
Jean

> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



More information about the linux-arm-kernel mailing list