[PATCH v4] dm: uclass: don't assign aliased seq numbers
sjg at google.com
sjg at google.com
Sat Mar 14 21:33:52 CET 2020
On 03. 03. 20 8:47, Michael Walle wrote:
> If there are aliases for an uclass, set the base for the "dynamically"
> allocated numbers next to the highest alias.
>
> Please note, that this might lead to holes in the sequences, depending
> on the device tree. For example if there is only an alias "ethernet1",
> the next device seq number would be 2.
>
> In particular this fixes a problem with boards which are using ethernet
> aliases but also might have network add-in cards like the E1000. If the
> board is started with the add-in card and depending on the order of the
> drivers, the E1000 might occupy the first ethernet device and mess up
> all the hardware addresses, because the devices are now shifted by one.
>
> Also adapt the test cases to the new handling and add test cases
> checking the holes in the seq numbers.
>
> Signed-off-by: Michael Walle <michael at walle.cc>
> Reviewed-by: Alex Marginean <alexandru.marginean at nxp.com>
> Tested-by: Alex Marginean <alexandru.marginean at nxp.com>
> Acked-by: Vladimir Oltean <olteanv at gmail.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> ---
> changes since v3:
> - dev_read_alias_highest_id() is only available if CONFIG_OF_CONTROL is
> set. Thus added an additional condition "CONFIG_IS_ENABLED(OF_CONTROL)",
> thanks Simon.
>
> changes since v2:
> - adapt/new test cases, thanks Simon
>
> changes since v1:
> - move notice about superfluous commits from commit message to this
> section.
> - fix the comment style
>
> arch/sandbox/dts/test.dts | 4 ++--
> drivers/core/uclass.c | 21 +++++++++++++++------
> include/configs/sandbox.h | 6 +++---
> test/dm/eth.c | 14 +++++++-------
> test/dm/test-fdt.c | 22 +++++++++++++++++-----
> 5 files changed, 44 insertions(+), 23 deletions(-)
>
Applied to u-boot-dm/next, thanks!
More information about the U-Boot
mailing list