[PATCH master] optee: don't warn about missing OP-TEE header

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Feb 29 03:46:20 PST 2024


On 29.02.24 12:13, Marco Felsch wrote:
> On 24-02-29, Ahmad Fatoum wrote:
>> On 29.02.24 10:33, Marco Felsch wrote:
>>> On 24-02-29, Ahmad Fatoum wrote:
>>>> hdr is a valid pointer for me, but it doesn't point at a header, which causes
>>>> me to get an error message.
>>>
>>> Yes, I have noticed the code path for non-pbl part as well now :/
>>>
>>> I was thinking about:
>>>
>>> 	if (hdr->magic == 0)
>>> 		return -EINVAL;
>>>
>>> but this is not far awways from you change. Therefore:
>>
>> This would assume that DRAM is zero-initialized after POR, which isn't given.
> 
> For i.MX8M and i.MX9 it should be the case since we call
> imx8m*_init_scratch_space which in turn does set the scratch space to
> zero. Anyway as said, I'm fine with lowering it to pr_debug() :)

Ah, I see. First time I ran into this, I was chainloading a new barebox from
an old barebox, so it read gibberish.

Cheers,
Ahmad

> 
> Regards,
>   Marco
> 
>>> Reviewed-by: Marco Felsch <m.felsch at pengutronix.de>
>>>
>>> PS: Could you please fix the silent check as well by using IS_ERR_OR_NULL()?
>>
>> I will send a separate patch for that, so this can be picked up as-is.
>>
>> Cheers,
>> Ahmad
>>
>>>
>>> Regards,
>>>   Marco
>>>
>>>>
>>>> Thanks,
>>>> Ahmad
>>>>
>>>>>
>>>>> Regards,
>>>>>   Marco
>>>>>
>>>>>>  
>>>>>>  	if (hdr->magic != OPTEE_MAGIC) {
>>>>>> -		pr_err("Invalid header magic 0x%08x, expected 0x%08x\n",
>>>>>> -			   hdr->magic, OPTEE_MAGIC);
>>>>>> +		pr_debug("Invalid header magic 0x%08x, expected 0x%08x\n",
>>>>>> +			 hdr->magic, OPTEE_MAGIC);
>>>>>>  		return -EINVAL;
>>>>>>  	}
>>>>>>  
>>>>>> -- 
>>>>>> 2.39.2
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Pengutronix e.K.                           |                             |
>>>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>>>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>>>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>>>
>>>>
>>>
>>
>> -- 
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list