[PATCH v3 2/2] firmware: zynqmp: Move config object permission check

Stefan Herbrechtsmeier stefan.herbrechtsmeier-oss at weidmueller.com
Tue May 16 13:23:42 CEST 2023


Hi,

Am 16.05.2023 um 10:26 schrieb Michal Simek:

> Hi,
>
> first of all sorry for delay.
>
> On 4/27/23 12:31, Stefan Herbrechtsmeier wrote:
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
>>
>> Move the check of the permission to change a config object from
>> zynqmp_pmufw_node function to zynqmp_pmufw_load_config_object function
>> to simplify the code and check the permission only if required.
>>
>> Signed-off-by: Stefan Herbrechtsmeier 
>> <stefan.herbrechtsmeier at weidmueller.com>
>>
>> ---
>>
>> Changes in v3:
>> - Added
>>
>>   drivers/firmware/firmware-zynqmp.c | 32 +++++++++++++++---------------
>>   1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/firmware/firmware-zynqmp.c 
>> b/drivers/firmware/firmware-zynqmp.c
>> index 2b1ad5d2c3..d12159fa78 100644
>> --- a/drivers/firmware/firmware-zynqmp.c
>> +++ b/drivers/firmware/firmware-zynqmp.c
>> @@ -70,20 +70,11 @@ int zynqmp_pmufw_config_close(void)
>>     int zynqmp_pmufw_node(u32 id)
>>   {
>> -    static bool skip_config;
>> -    int ret;
>> -
>> -    if (skip_config)
>> -        return 0;
>> -
>>       /* Record power domain id */
>>       xpm_configobject[NODE_ID_LOCATION] = id;
>>   -    ret = zynqmp_pmufw_load_config_object(xpm_configobject,
>> -                          sizeof(xpm_configobject));
>> -
>> -    if (ret == -EACCES && id == NODE_OCM_BANK_0)
>> -        skip_config = true;
>> +    zynqmp_pmufw_load_config_object(xpm_configobject,
>> +                    sizeof(xpm_configobject));
>
> This is not right.
> It should be
> return zynqmp_pmufw_load... for error propagation.

At the moment the zynqmp_pmufw_node and zynqmp_pmufw_config_close 
doesn't return an error. Should the zynqmp_pmufw_load_config_object 
return 0 or -EACCES if it is skipped?

Regards
   Stefan



More information about the U-Boot mailing list