]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: add error handling in stmmac_mtl_setup()
authorNiklas Cassel <niklas.cassel@axis.com>
Mon, 19 Feb 2018 17:11:14 +0000 (18:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Feb 2018 19:13:21 +0000 (14:13 -0500)
commite1486f55a65f987bfda68c1292c4bc58338d8283
tree95849d2f50a459c7c84a88342224d5d4751aba11
parentc495e6fa5198fc55c9f02b0e68330f4845a9169a
net: stmmac: add error handling in stmmac_mtl_setup()

The device tree binding for stmmac says:

- Multiple TX Queues parameters: below the list of all the parameters to
                                 configure the multiple TX queues:
        - snps,tx-queues-to-use: number of TX queues to be used in the driver
[...]
        - For each TX queue
[...]

However, if one specifies snps,tx-queues-to-use = 2,
but omits the queue subnodes, or defines just one queue subnode,
since the driver appears to initialize queues with sane default
values, we will get tx queue timeouts.

This is because the initialization code only initializes
as many queues as it finds subnodes. Potentially leaving
some queues uninitialized.

To avoid hard to debug issues, return an error if the number
of subnodes differ from snps,tx-queues-to-use/snps,rx-queues-to-use.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c