[PATCH v2] dm: uclass: don't assign aliased seq numbers
michal.simek at xilinx.com
Tue Feb 4 08:12:48 CET 2020
On 03. 02. 20 18:16, Michael Walle wrote:
> Hi Simon,
> Am 2020-01-30 03:16, schrieb Simon Glass:
>> Hi Michael,
>> On Fri, 20 Dec 2019 at 06:29, Michael Walle <michael at walle.cc> 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.
>>> Cc: Thomas Fitzsimmons <fitzsim at fitzsim.org>
>>> Cc: Michal Simek <michal.simek at xilinx.com>
>>> 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>
>>> As a side effect, this should also make the following commits
>>> Â - 7f3289bf6d ("dm: device: Request next sequence number")
>>> Â - 61607225d1 ("i2c: Fill req_seq in i2c_post_bind()")
>>> Â Â Although I don't understand the root cause of the said problem.
>>> Thomas, Michal, could you please test this and then I'd add a second
>>> patch removing the old code.
>> I think this is reasonable. We have discussed a possible rework of the
>> logic to merge seq and req_seq, but I don't think we have any patches
>> Please can you add a test to your patch? You can put it in test-fdt.c
>> for example.
> Just did a new version.
>> If you are reverting the other patches, could you please send patches
>> for those?
> Unfortunatly, neither Thomas nor Michal has responded, so there would be
> no test if that would work. But I could certainly prepare two patches.
I still have this in my inbox to take a look and retest. I just don't
have time to take a look at it now. I have tested this code on board
with i2c mux where I was trying to change aliases.
More information about the U-Boot