lkml.org 
[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.20 055/105] net: stmmac: Check if CBS is supported before configuring
    Date
    From: Jose Abreu <jose.abreu@synopsys.com>

    [ Upstream commit 0650d4017f4d2eee67230a02285a7ae5204240c2 ]

    Check if CBS is currently supported before trying to configure it in HW.

    Cc: Joao Pinto <jpinto@synopsys.com>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
    Cc: Alexandre Torgue <alexandre.torgue@st.com>
    Signed-off-by: Jose Abreu <joabreu@synopsys.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
    index 531294f4978b..58ea18af9813 100644
    --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
    +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
    @@ -301,6 +301,8 @@ static int tc_setup_cbs(struct stmmac_priv *priv,
    /* Queue 0 is not AVB capable */
    if (queue <= 0 || queue >= tx_queues_count)
    return -EINVAL;
    + if (!priv->dma_cap.av)
    + return -EOPNOTSUPP;
    if (priv->speed != SPEED_100 && priv->speed != SPEED_1000)
    return -EOPNOTSUPP;

    --
    2.19.1
    \
     
     \ /
      Last update: 2019-02-13 04:02    [W:4.120 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site