• Niklas Cassel's avatar
    net: stmmac: add error handling in stmmac_mtl_setup() · 2ee2132f
    Niklas Cassel authored
    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: default avatarNiklas Cassel <niklas.cassel@axis.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2ee2132f
stmmac_platform.c 21.8 KB