[PATCH] serial: pl01x: Add error value checking

Michal Simek michal.simek at xilinx.com
Thu Oct 15 18:11:04 CEST 2020


Hi,

On 15. 10. 20 17:09, André Przywara wrote:
> On 14/10/2020 09:42, Michal Simek wrote:
> 
> Hi,
> 
>> There also a need to check return values to make sure that clocks were
>> enabled and setup properly.
> 
> is that just clean-up or is there a particular problem that's fixed?
> 
> I am asking because I am not sure how useful debug output in a console
> driver is.
> Also in some cases the UART is actually already configured, so failure
> to get the clock (due to a sloppy/too complicated DTB) is not really
> fatal at the moment.
> 
> I am not against this patch, just wanted to make sure we don't break
> anything.

We have created the patch long time ago and it was also sent to mailing
list in October 2018.

https://github.com/Xilinx/u-boot-xlnx/commit/7c7266d3d058f4e5d99ad7449eddf6b7e9ff238d#diff-375baede8682cf017faf02039e060958d6574db7900775e7d6f17219bd4d0ecb

More or less the most of the part of it where already added by different
people. The only missing part was checking error values.
There are 2 reasons behind this patch.

1. it is good practice to check all return values - and coverity also
reports it.
2. at this time clock driver is up and running and if not you will get
errors. In our case we are asking firmware for doing that
action/returning value which needs to be catch.

And early console can be configured properly when DEBUG console is used
that's why debug message will be shown over this interface and it makes
sense to show message about it. And if you don't failed you can break
regular console by configuring by incorrect values.

Thanks,
Michal



More information about the U-Boot mailing list